diff --git a/src/shell/CMakeLists.txt b/src/shell/CMakeLists.txt index 17713a165..5c4b36022 100644 --- a/src/shell/CMakeLists.txt +++ b/src/shell/CMakeLists.txt @@ -33,12 +33,6 @@ set(scripting_SRC scripting/widget.cpp ) -set(widgetexplorer_SRC - widgetexplorer/kcategorizeditemsviewmodels.cpp - widgetexplorer/plasmaappletitemmodel.cpp - widgetexplorer/widgetexplorer.cpp -) - add_executable(plasma-shell activity.cpp main.cpp @@ -54,7 +48,6 @@ add_executable(plasma-shell shellpluginloader.cpp shellmanager.cpp ${scripting_SRC} - ${widgetexplorer_SRC} ) # The Qt5Widgets_LIBRARIES variable also includes QtGui and QtCore @@ -84,4 +77,6 @@ if(X11_FOUND) endif() install(TARGETS plasma-shell ${INSTALL_TARGETS_DEFAULT_ARGS}) -install(FILES plasma-shell.desktop DESTINATION ${AUTOSTART_INSTALL_DIR}) \ No newline at end of file +install(FILES plasma-shell.desktop DESTINATION ${AUTOSTART_INSTALL_DIR}) + +add_subdirectory(widgetexplorer) diff --git a/src/shell/shellcorona.cpp b/src/shell/shellcorona.cpp index 2870402e4..d6ffa7567 100644 --- a/src/shell/shellcorona.cpp +++ b/src/shell/shellcorona.cpp @@ -97,9 +97,6 @@ ShellCorona::ShellCorona(QObject *parent) { d->desktopDefaultsConfig = KConfigGroup(KSharedConfig::openConfig(package().filePath("defaults")), "Desktop"); - qmlRegisterType("org.kde.plasma.private.shell", 2, 0, "WidgetExplorer"); - qmlRegisterType(); - connect(&d->appConfigSyncTimer, &QTimer::timeout, this, &ShellCorona::syncAppConfig); diff --git a/src/shell/widgetexplorer/CMakeLists.txt b/src/shell/widgetexplorer/CMakeLists.txt new file mode 100644 index 000000000..360b9edd4 --- /dev/null +++ b/src/shell/widgetexplorer/CMakeLists.txt @@ -0,0 +1,27 @@ +project(plasmawidgetexplorerplugin) + +set(widgetexplorer_SRC + kcategorizeditemsviewmodels.cpp + plasmaappletitemmodel.cpp + widgetexplorer.cpp + widgetexplorerplugin.cpp +) + +add_library(plasmawidgetexplorerplugin SHARED ${widgetexplorer_SRC}) +target_link_libraries(plasmawidgetexplorerplugin + Qt5::Core + Qt5::Quick + Qt5::Qml + Qt5::Gui + Qt5::Widgets + Qt5::Quick + Qt5::Qml + KF5::Plasma + KF5::PlasmaQuick + KF5::I18n + KF5::Service +) + +install(TARGETS plasmawidgetexplorerplugin DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/private/shell) + +install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/private/shell) diff --git a/src/shell/widgetexplorer/qmldir b/src/shell/widgetexplorer/qmldir new file mode 100644 index 000000000..d808b18cf --- /dev/null +++ b/src/shell/widgetexplorer/qmldir @@ -0,0 +1,2 @@ +module org.kde.plasma.private.shell +plugin plasmawidgetexplorerplugin diff --git a/src/shell/widgetexplorer/widgetexplorerplugin.cpp b/src/shell/widgetexplorer/widgetexplorerplugin.cpp new file mode 100644 index 000000000..f21178beb --- /dev/null +++ b/src/shell/widgetexplorer/widgetexplorerplugin.cpp @@ -0,0 +1,36 @@ +/* + Copyright 2014 by David Edmundson + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ + +#include "widgetexplorerplugin.h" + +#include + +#include "widgetexplorer.h" +#include + +void WidgetExplorerPlugin::registerTypes(const char *uri) +{ + Q_ASSERT(uri == QLatin1String("org.kde.plasma.private.shell")); + + qmlRegisterType(); + qmlRegisterType(uri, 2, 0, "WidgetExplorer"); +} diff --git a/src/shell/widgetexplorer/widgetexplorerplugin.h b/src/shell/widgetexplorer/widgetexplorerplugin.h new file mode 100644 index 000000000..3ee262e52 --- /dev/null +++ b/src/shell/widgetexplorer/widgetexplorerplugin.h @@ -0,0 +1,37 @@ +/* + Copyright 2014 by David Edmundson + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ + +#ifndef WIDGETEXPLORERPLUGIN_H +#define WIDGETEXPLORERPLUGIN_H + +#include + +class WidgetExplorerPlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") + +public: + void registerTypes(const char *uri); +}; + +#endif