implement binary module

This commit is contained in:
arcan1s
2014-12-28 17:42:08 +03:00
parent f188dea8a7
commit edb386d24e
12 changed files with 183 additions and 414 deletions

View File

@ -0,0 +1,15 @@
include_directories (${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/../
${PROJECT_TRDPARTY_DIR}
${Qt_INCLUDE}
${Kf5_INCLUDE})
file (GLOB SUBPROJECT_SOURCE *.cpp)
add_library (${PLUGIN_NAME} SHARED ${SUBPROJECT_SOURCE})
target_link_libraries (${PLUGIN_NAME} ${Qt5Core_LIBRARIES} ${Qt5Qml_LIBRARIES} ${I18n_LIBRARIES} ${Plasma_LIBRARIES})
install (TARGETS ${PLUGIN_NAME} DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/private/netctl)
install (FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/private/netctl)

View File

@ -0,0 +1,40 @@
/***************************************************************************
* This file is part of netctl-gui *
* *
* netctl-gui is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* netctl-gui is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#include <QtQml>
#include <pdebug/pdebug.h>
#include "netctl.h"
#include "version.h"
QString NetctlPlugin::parsePattern(QString pattern, const QString key, const QString value)
{
// if (debug) qDebug() << PDEBUG;
return pattern.replace(QString("$") + key, value);
}
void NetctlPlugin::registerTypes(const char *uri)
{
Q_ASSERT(uri == QLatin1String("org.kde.plasma.private.netctl"));
// qmlRegisterType<ProcessRunner>(uri, 1, 0, "ProcessRunner");
// qmlRegisterType<TimeZoneModel>(uri, 1, 0, "TimeZoneModel");
// qmlRegisterSingletonType<TimezonesI18n>(uri, 1, 0, "TimezonesI18n", timezonesi18n_singletontype_provider);
}

View File

@ -0,0 +1,38 @@
/***************************************************************************
* This file is part of netctl-gui *
* *
* netctl-gui is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* netctl-gui is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#ifndef NETCTLPLUGIN_H
#define NETCTLPLUGIN_H
#include <QQmlExtensionPlugin>
class QQmlEngine;
class NetctlPlugin : public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
public:
void registerTypes(const char *uri);
static QString parsePattern(QString pattern, const QString key, const QString value);
};
#endif /* NETCTLPLUGIN_H */

View File

@ -0,0 +1,3 @@
module org.kde.plasma.private.netctl
plugin netctlplugin