diff --git a/CMakeLists.txt b/CMakeLists.txt index c9ce31e66..8b60011de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,7 @@ find_package(KF5 CONFIG REQUIRED IdleTime ItemModels WidgetsAddons WindowSystem Bookmarks Declarative UnitConversion Parts Kross KIO DNSSD KDE4Support) -find_package(KActivities) +find_package(KActivities 5.0.0 CONFIG REQUIRED) set_package_properties(KActivities PROPERTIES DESCRIPTION "The KActivities library" URL "https://projects.kde.org/kactivities" TYPE REQUIRED diff --git a/src/declarativeimports/accessdenied/CMakeLists.txt b/src/declarativeimports/accessdenied/CMakeLists.txt index 958743ee4..3fbda194c 100644 --- a/src/declarativeimports/accessdenied/CMakeLists.txt +++ b/src/declarativeimports/accessdenied/CMakeLists.txt @@ -1,4 +1,4 @@ project(accessdenied) -install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/core) +install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/plasma/accessdenied) diff --git a/src/declarativeimports/core/CMakeLists.txt b/src/declarativeimports/core/CMakeLists.txt index 99c85bae7..71f2cb351 100644 --- a/src/declarativeimports/core/CMakeLists.txt +++ b/src/declarativeimports/core/CMakeLists.txt @@ -35,7 +35,6 @@ target_link_libraries(corebindingsplugin KF5::Declarative KF5::CoreAddons KF5::IconThemes - KF5::KDE4Support #for kglobal.h KF5::Service #for kplugininfo.h KF5::WindowSystem KF5::Plasma) diff --git a/src/declarativeimports/core/dialogshadows.cpp b/src/declarativeimports/core/dialogshadows.cpp index 993272b12..5a0ee8257 100644 --- a/src/declarativeimports/core/dialogshadows.cpp +++ b/src/declarativeimports/core/dialogshadows.cpp @@ -18,6 +18,7 @@ #include "dialogshadows_p.h" +#include #include #include @@ -30,7 +31,6 @@ #endif #include -#include class DialogShadows::Private { @@ -94,7 +94,7 @@ public: DialogShadows self; }; -K_GLOBAL_STATIC(DialogShadowsSingleton, privateDialogShadowsSelf) +Q_GLOBAL_STATIC(DialogShadowsSingleton, privateDialogShadowsSelf) DialogShadows::DialogShadows(QObject *parent, const QString &prefix) : Plasma::Svg(parent), diff --git a/src/declarativeimports/core/tests/CMakeLists.txt b/src/declarativeimports/core/tests/CMakeLists.txt index 79eba5d48..b49f91d09 100644 --- a/src/declarativeimports/core/tests/CMakeLists.txt +++ b/src/declarativeimports/core/tests/CMakeLists.txt @@ -16,7 +16,6 @@ target_link_libraries(sortfiltermodeltest Qt5::Gui Qt5::Test KF5::I18n - KF5::KDE4Support #qtest_kde.h KF5::Service Qt5::Qml ) diff --git a/src/declarativeimports/core/tests/sortfiltermodeltest.cpp b/src/declarativeimports/core/tests/sortfiltermodeltest.cpp index f59da38b5..f4f930c2e 100644 --- a/src/declarativeimports/core/tests/sortfiltermodeltest.cpp +++ b/src/declarativeimports/core/tests/sortfiltermodeltest.cpp @@ -21,12 +21,12 @@ #include // KDE -#include // Qt #include #include #include +#include using namespace Plasma; 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