diff --git a/components/mmplugin/CMakeLists.txt b/components/mmplugin/CMakeLists.txt index b0d02d83..ec4fb882 100644 --- a/components/mmplugin/CMakeLists.txt +++ b/components/mmplugin/CMakeLists.txt @@ -1,14 +1,14 @@ # SPDX-FileCopyrightText: 2021 Tobias Fella # SPDX-License-Identifier: GPL-2.0-or-later -add_library(ppc-mmqmlplugin) +ecm_add_qml_module(ppc-mmqmlplugin URI org.kde.plasma.mm GENERATE_PLUGIN_SOURCE) target_sources(ppc-mmqmlplugin PRIVATE - mmqmlplugin.cpp signalindicator.cpp profilesettings.cpp ) -target_link_libraries(ppc-mmqmlplugin + +target_link_libraries(ppc-mmqmlplugin PRIVATE Qt::Qml KF6::ModemManagerQt KF6::NetworkManagerQt @@ -16,8 +16,5 @@ target_link_libraries(ppc-mmqmlplugin KF6::I18n ) -set_property(TARGET ppc-mmqmlplugin PROPERTY LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/org/kde/plasma/mm) -file(COPY qmldir DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/org/kde/plasma/mm) -install(TARGETS ppc-mmqmlplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/mm) -install(FILES qmldir ${qml_SRC} DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/mm) +ecm_finalize_qml_module(ppc-mmqmlplugin) diff --git a/components/mmplugin/mmqmlplugin.cpp b/components/mmplugin/mmqmlplugin.cpp deleted file mode 100644 index 7766ae94..00000000 --- a/components/mmplugin/mmqmlplugin.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Tobias Fella -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "mmqmlplugin.h" - -#include -#include - -#include "signalindicator.h" - -void MmQmlPlugin::registerTypes(const char *) -{ - qmlRegisterSingletonType("org.kde.plasma.mm", 1, 0, "SignalIndicator", [](QQmlEngine *, QJSEngine *) -> QObject * { - return new SignalIndicator(); - }); -} diff --git a/components/mmplugin/mmqmlplugin.h b/components/mmplugin/mmqmlplugin.h deleted file mode 100644 index 59053edb..00000000 --- a/components/mmplugin/mmqmlplugin.h +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Tobias Fella -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include - -class MmQmlPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") - - void registerTypes(const char *uri) override; -}; diff --git a/components/mmplugin/qmldir b/components/mmplugin/qmldir deleted file mode 100644 index 3d859e45..00000000 --- a/components/mmplugin/qmldir +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-FileCopyrightText: 2021 Tobias Fella -# SPDX-License-Identifier: GPL-2.0-or-later - -module org.kde.plasma.mm -plugin ppc-mmqmlplugin -classname MmQmlPlugin diff --git a/components/mmplugin/signalindicator.h b/components/mmplugin/signalindicator.h index 69d57c37..b17ba783 100644 --- a/components/mmplugin/signalindicator.h +++ b/components/mmplugin/signalindicator.h @@ -11,6 +11,7 @@ #include #include +#include #include "profilesettings.h" @@ -18,6 +19,8 @@ class SignalIndicator : public QObject { Q_OBJECT + QML_ELEMENT + QML_SINGLETON Q_PROPERTY(int strength READ strength NOTIFY strengthChanged) Q_PROPERTY(QString name READ name NOTIFY nameChanged) diff --git a/components/mobileshell/CMakeLists.txt b/components/mobileshell/CMakeLists.txt index 965cc1f1..3d86a96e 100644 --- a/components/mobileshell/CMakeLists.txt +++ b/components/mobileshell/CMakeLists.txt @@ -1,19 +1,36 @@ # SPDX-FileCopyrightText: 2021 Devin Lin # SPDX-License-Identifier: GPL-2.0-or-later -include_directories(${CMAKE_CURRENT_BINARY_DIR}/..) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) - +ecm_add_qml_module(mobileshellplugin URI org.kde.plasma.private.mobileshell GENERATE_PLUGIN_SOURCE) + set(mobileshellplugin_SRCS - mobileshellplugin.cpp shellutil.cpp components/direction.cpp + components/direction.h components/swipearea.cpp notifications/notificationthumbnailer.cpp notifications/notificationfilemenu.cpp ) -qt_add_resources(RESOURCES resources.qrc) -add_library(mobileshellplugin SHARED ${mobileshellplugin_SRCS} ${RESOURCES}) +target_include_directories(mobileshellplugin PRIVATE components) +target_include_directories(mobileshellplugin PRIVATE notifications) +target_sources(mobileshellplugin PRIVATE ${mobileshellplugin_SRCS}) + +# Singleton declarations +set_source_files_properties(qml/components/AppLaunch.qml PROPERTIES QT_QML_SINGLETON_TYPE TRUE) +set_source_files_properties(qml/components/Constants.qml PROPERTIES QT_QML_SINGLETON_TYPE TRUE) +set_source_files_properties(qml/dataproviders/AudioInfo.qml PROPERTIES QT_QML_SINGLETON_TYPE TRUE) +set_source_files_properties(qml/dataproviders/BatteryInfo.qml PROPERTIES QT_QML_SINGLETON_TYPE TRUE) +set_source_files_properties(qml/dataproviders/BluetoothInfo.qml PROPERTIES QT_QML_SINGLETON_TYPE TRUE) +set_source_files_properties(qml/dataproviders/SignalStrengthInfo.qml PROPERTIES QT_QML_SINGLETON_TYPE TRUE) +set_source_files_properties(qml/volumeosd/VolumeOSDProviderLoader.qml PROPERTIES QT_QML_SINGLETON_TYPE TRUE) + +# Include qml and js files within ./qml/ +file(GLOB_RECURSE _qml_sources + "qml/*.qml" + "qml/*.js" +) +ecm_target_qml_sources(mobileshellplugin SOURCES ${_qml_sources}) + target_link_libraries(mobileshellplugin PUBLIC @@ -36,8 +53,4 @@ target_link_libraries(mobileshellplugin KF6::Package ) -# we compiled the qml files, just install qmldir -install(FILES qmldir DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/mobileshell) - -ecm_generate_qmltypes(org.kde.plasma.private.mobileshell 1.0 DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/mobileshell) -install(TARGETS mobileshellplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/mobileshell) +ecm_finalize_qml_module(mobileshellplugin) diff --git a/components/mobileshell/components/direction.h b/components/mobileshell/components/direction.h index 11375ce8..7e480343 100644 --- a/components/mobileshell/components/direction.h +++ b/components/mobileshell/components/direction.h @@ -7,10 +7,12 @@ #pragma once #include +#include class Direction : public QObject { Q_OBJECT + QML_ELEMENT public: enum Type { None = 0, Up, Down, Left, Right }; diff --git a/components/mobileshell/components/swipearea.h b/components/mobileshell/components/swipearea.h index 89097cf4..4ee872c9 100644 --- a/components/mobileshell/components/swipearea.h +++ b/components/mobileshell/components/swipearea.h @@ -22,13 +22,12 @@ class SwipeArea : public QQuickItem { Q_OBJECT + QML_ELEMENT Q_PROPERTY(SwipeArea::Mode mode READ mode WRITE setMode NOTIFY modeChanged) Q_PROPERTY(bool interactive READ interactive WRITE setInteractive NOTIFY interactiveChanged) Q_PROPERTY(bool moving READ moving NOTIFY movingChanged) Q_PROPERTY(bool pressed READ pressed NOTIFY pressedChanged) - QML_NAMED_ELEMENT(SwipeArea) - public: SwipeArea(QQuickItem *parent = nullptr); diff --git a/components/mobileshell/mobileshellplugin.cpp b/components/mobileshell/mobileshellplugin.cpp deleted file mode 100644 index c83d3673..00000000 --- a/components/mobileshell/mobileshellplugin.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021 Devin Lin - * - * SPDX-License-Identifier: GPL-2.0-or-later - */ - -#include "mobileshellplugin.h" - -#include -#include - -#include "components/direction.h" -#include "components/swipearea.h" - -#include "notifications/notificationfilemenu.h" -#include "notifications/notificationthumbnailer.h" - -#include "shellutil.h" - -QUrl resolvePath(std::string str) -{ - return QUrl("qrc:/org/kde/plasma/private/mobileshell/qml/" + QString::fromStdString(str)); -} - -void MobileShellPlugin::registerTypes(const char *uri) -{ - Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.plasma.private.mobileshell")); - - qmlRegisterSingletonType(uri, 1, 0, "ShellUtil", [](QQmlEngine *, QJSEngine *) -> QObject * { - return ShellUtil::instance(); - }); - - // components - qmlRegisterType(uri, 1, 0, "Direction"); - qmlRegisterType(uri, 1, 0, "SwipeArea"); - - // notifications - qmlRegisterType(uri, 1, 0, "NotificationThumbnailer"); - qmlRegisterType(uri, 1, 0, "NotificationFileMenu"); - - // qml modules - - // /actiondrawer - qmlRegisterType(resolvePath("actiondrawer/ActionDrawer.qml"), uri, 1, 0, "ActionDrawer"); - qmlRegisterType(resolvePath("actiondrawer/ActionDrawerOpenSurface.qml"), uri, 1, 0, "ActionDrawerOpenSurface"); - qmlRegisterType(resolvePath("actiondrawer/ActionDrawerWindow.qml"), uri, 1, 0, "ActionDrawerWindow"); - - // /components - qmlRegisterSingletonType(resolvePath("components/AppLaunch.qml"), uri, 1, 0, "AppLaunch"); - qmlRegisterType(resolvePath("components/BaseItem.qml"), uri, 1, 0, "BaseItem"); - qmlRegisterSingletonType(resolvePath("components/Constants.qml"), uri, 1, 0, "Constants"); - qmlRegisterType(resolvePath("components/ExtendedAbstractButton.qml"), uri, 1, 0, "ExtendedAbstractButton"); - qmlRegisterType(resolvePath("components/Flickable.qml"), uri, 1, 0, "Flickable"); - qmlRegisterType(resolvePath("components/GridView.qml"), uri, 1, 0, "GridView"); - qmlRegisterType(resolvePath("components/HapticsEffectLoader.qml"), uri, 1, 0, "HapticsEffectLoader"); - qmlRegisterType(resolvePath("components/ListView.qml"), uri, 1, 0, "ListView"); - qmlRegisterType(resolvePath("components/PopupMenu.qml"), uri, 1, 0, "PopupMenu"); - qmlRegisterType(resolvePath("components/StartupFeedback.qml"), uri, 1, 0, "StartupFeedback"); - qmlRegisterType(resolvePath("components/TextDropShadow.qml"), uri, 1, 0, "TextDropShadow"); - qmlRegisterType(resolvePath("components/VelocityCalculator.qml"), uri, 1, 0, "VelocityCalculator"); - - // /dataproviders - qmlRegisterSingletonType(resolvePath("dataproviders/AudioInfo.qml"), uri, 1, 0, "AudioInfo"); - qmlRegisterSingletonType(resolvePath("dataproviders/BatteryInfo.qml"), uri, 1, 0, "BatteryInfo"); - qmlRegisterSingletonType(resolvePath("dataproviders/BluetoothInfo.qml"), uri, 1, 0, "BluetoothInfo"); - qmlRegisterSingletonType(resolvePath("dataproviders/SignalStrengthInfo.qml"), uri, 1, 0, "SignalStrengthInfo"); - - // /homescreen - qmlRegisterType(resolvePath("homescreen/HomeScreen.qml"), uri, 1, 0, "HomeScreen"); - - // /navigationpanel - qmlRegisterType(resolvePath("navigationpanel/NavigationPanel.qml"), uri, 1, 0, "NavigationPanel"); - qmlRegisterType(resolvePath("navigationpanel/NavigationPanelAction.qml"), uri, 1, 0, "NavigationPanelAction"); - - // /statusbar - qmlRegisterType(resolvePath("statusbar/StatusBar.qml"), uri, 1, 0, "StatusBar"); - - // /volumeosd - qmlRegisterType(resolvePath("volumeosd/VolumeOSD.qml"), uri, 1, 0, "VolumeOSD"); - qmlRegisterType(resolvePath("volumeosd/VolumeOSDProvider.qml"), uri, 1, 0, "VolumeOSDProvider"); - qmlRegisterSingletonType(resolvePath("volumeosd/VolumeOSDProviderLoader.qml"), uri, 1, 0, "VolumeOSDProviderLoader"); - - // /widgets - qmlRegisterType(resolvePath("widgets/krunner/KRunnerScreen.qml"), uri, 1, 0, "KRunnerScreen"); - qmlRegisterType(resolvePath("widgets/krunner/KRunnerWidget.qml"), uri, 1, 0, "KRunnerWidget"); - qmlRegisterType(resolvePath("widgets/mediacontrols/MediaControlsWidget.qml"), uri, 1, 0, "MediaControlsWidget"); - qmlRegisterType(resolvePath("widgets/notifications/NotificationsWidget.qml"), uri, 1, 0, "NotificationsWidget"); - qmlRegisterType(resolvePath("widgets/notifications/NotificationsModelType.qml"), uri, 1, 0, "NotificationsModelType"); -} diff --git a/components/mobileshell/mobileshellplugin.h b/components/mobileshell/mobileshellplugin.h deleted file mode 100644 index 23b850d9..00000000 --- a/components/mobileshell/mobileshellplugin.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021 Devin Lin - * - * SPDX-License-Identifier: GPL-2.0-or-later - */ - -#pragma once - -#include - -#include -#include - -class MobileShellPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") - -public: - void registerTypes(const char *uri) override; -}; diff --git a/components/mobileshell/notifications/notificationfilemenu.h b/components/mobileshell/notifications/notificationfilemenu.h index ca4fe442..f39f1887 100644 --- a/components/mobileshell/notifications/notificationfilemenu.h +++ b/components/mobileshell/notifications/notificationfilemenu.h @@ -6,16 +6,17 @@ #pragma once +#include #include #include #include #include - -class QAction; +#include class NotificationFileMenu : public QObject { Q_OBJECT + QML_ELEMENT Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged) Q_PROPERTY(QQuickItem *visualParent READ visualParent WRITE setVisualParent NOTIFY visualParentChanged) Q_PROPERTY(bool visible READ visible WRITE setVisible NOTIFY visibleChanged) diff --git a/components/mobileshell/notifications/notificationthumbnailer.h b/components/mobileshell/notifications/notificationthumbnailer.h index b076a61b..ba39288f 100644 --- a/components/mobileshell/notifications/notificationthumbnailer.h +++ b/components/mobileshell/notifications/notificationthumbnailer.h @@ -12,10 +12,12 @@ #include #include #include +#include class NotificationThumbnailer : public QObject, public QQmlParserStatus { Q_OBJECT + QML_ELEMENT Q_INTERFACES(QQmlParserStatus) Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged) diff --git a/components/mobileshell/qml/actiondrawer/ActionDrawer.qml b/components/mobileshell/qml/actiondrawer/ActionDrawer.qml index cc775288..480680c3 100644 --- a/components/mobileshell/qml/actiondrawer/ActionDrawer.qml +++ b/components/mobileshell/qml/actiondrawer/ActionDrawer.qml @@ -12,11 +12,9 @@ import QtQuick.Window 2.2 import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.private.nanoshell 2.0 as NanoShell -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.kirigami 2.20 as Kirigami -import "../components" as Components - Item { id: root diff --git a/components/mobileshell/qml/actiondrawer/ActionDrawerWindow.qml b/components/mobileshell/qml/actiondrawer/ActionDrawerWindow.qml index c5897280..43884588 100644 --- a/components/mobileshell/qml/actiondrawer/ActionDrawerWindow.qml +++ b/components/mobileshell/qml/actiondrawer/ActionDrawerWindow.qml @@ -12,8 +12,6 @@ import QtQuick.Window 2.2 import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.private.nanoshell 2.0 as NanoShell -import "../components" as Components - /** * Window with the ActionDrawer component embedded in it. * diff --git a/components/mobileshell/qml/actiondrawer/LandscapeContentContainer.qml b/components/mobileshell/qml/actiondrawer/LandscapeContentContainer.qml index 1823ddb2..180d3445 100644 --- a/components/mobileshell/qml/actiondrawer/LandscapeContentContainer.qml +++ b/components/mobileshell/qml/actiondrawer/LandscapeContentContainer.qml @@ -14,12 +14,7 @@ import org.kde.kirigami 2.12 as Kirigami import org.kde.plasma.core as PlasmaCore import org.kde.plasma.plasma5support 2.0 as P5Support import org.kde.plasma.components 3.0 as PlasmaComponents -import org.kde.plasma.private.mobileshell 1.0 as MobileShell - -import "../components" as Components -import "../widgets/mediacontrols" as MediaControls -import "../widgets/notifications" as Notifications -import "quicksettings" +import org.kde.plasma.private.mobileshell as MobileShell /** * Root element that contains all of the ActionDrawer's contents, and is anchored to the screen. @@ -83,7 +78,7 @@ Item { } anchors.margins: minWidthHeight * 0.06 - Notifications.NotificationsWidget { + MobileShell.NotificationsWidget { id: notificationWidget historyModel: root.actionDrawer.notificationModel historyModelType: root.actionDrawer.notificationModelType @@ -146,7 +141,7 @@ Item { font.weight: Font.Light } - MediaControls.MediaControlsWidget { + MobileShell.MediaControlsWidget { id: mediaWidget property real fullHeight: visible ? height + Kirigami.Units.smallSpacing * 6 : 0 @@ -163,7 +158,7 @@ Item { } // right sidebar - QuickSettingsPanel { + MobileShell.QuickSettingsPanel { id: quickSettings height: quickSettings.contentImplicitHeight + quickSettings.topPadding + quickSettings.bottomPadding width: intendedWidth diff --git a/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml b/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml index aed70878..09d4ab5d 100644 --- a/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml +++ b/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml @@ -9,13 +9,10 @@ import QtQuick.Controls 2.15 import QtQuick.Layouts 1.1 import QtQuick.Window 2.2 +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.kirigami 2.20 as Kirigami -import "../components" as Components -import "../widgets/notifications" as Notifications -import "quicksettings" - /** * Root element that contains all of the ActionDrawer's contents, and is anchored to the screen. */ @@ -51,7 +48,7 @@ Item { opacity: Math.max(0, Math.min(1, actionDrawer.offset / root.minimizedQuickSettingsOffset)) } - QuickSettingsDrawer { + MobileShell.QuickSettingsDrawer { id: quickSettings z: 1 // ensure it's above notifications anchors.top: parent.top @@ -95,7 +92,7 @@ Item { } } - Notifications.NotificationsWidget { + MobileShell.NotificationsWidget { id: notificationWidget historyModel: root.actionDrawer.notificationModel historyModelType: root.actionDrawer.notificationModelType diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml index ec09b7df..2f8a6c86 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml @@ -10,13 +10,11 @@ import QtQuick.Controls 2.15 import QtQuick.Layouts 1.1 import QtQuick.Window 2.2 +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS import org.kde.kirigami 2.20 as Kirigami -import "../../components" as Components -import "../../components/util.js" as Util - /** * Quick settings elements layout, change the height to clip. */ @@ -32,9 +30,9 @@ Item { ScrollView } - readonly property real columns: Math.round(Util.applyMinMaxRange(3, 6, width / intendedColumnWidth)) + readonly property real columns: Math.round(Math.min(6, Math.max(3, width / intendedColumnWidth))) readonly property real columnWidth: Math.floor(width / columns) - readonly property int minimizedColumns: Math.round(Util.applyMinMaxRange(5, 8, width / intendedMinimizedColumnWidth)) + readonly property int minimizedColumns: Math.round(Math.min(8, Math.max(5, width / intendedMinimizedColumnWidth))) readonly property real minimizedColumnWidth: Math.floor(width / minimizedColumns) readonly property real rowHeight: columnWidth * 0.7 @@ -134,7 +132,7 @@ Item { sourceModel: quickSettingsModel pageSize: minimizedColumns } - delegate: Components.BaseItem { + delegate: MobileShell.BaseItem { required property var modelData implicitHeight: root.minimizedRowHeight @@ -293,7 +291,7 @@ Item { Component { id: quickSettingComponent - Components.BaseItem { + MobileShell.BaseItem { height: root.rowHeight width: root.columnWidth padding: Kirigami.Units.smallSpacing diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDelegate.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDelegate.qml index 7a9ce940..79b7e5ac 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDelegate.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDelegate.qml @@ -16,9 +16,7 @@ import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.private.mobileshell.state as MobileShellState import org.kde.plasma.components 3.0 as PlasmaComponents -import "../../components" as Components - -Components.BaseItem { +MobileShell.BaseItem { id: root required property bool restrictedPermissions diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDrawer.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDrawer.qml index 4f3c742e..2872c861 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDrawer.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDrawer.qml @@ -12,17 +12,13 @@ import org.kde.kirigami 2.12 as Kirigami import org.kde.ksvg 1.0 as KSvg import org.kde.plasma.core as PlasmaCore - -import "../../statusbar" as StatusBar -import "../../components" as Components -import "../../widgets/mediacontrols" as MediaControls -import "../" +import org.kde.plasma.private.mobileshell as MobileShell /** * Quick settings drawer pulled down from the top (for portrait mode). * For the landscape view quicksettings container, see QuickSettingsPanel. */ -Components.BaseItem { +MobileShell.BaseItem { id: root required property var actionDrawer @@ -75,10 +71,10 @@ Components.BaseItem { anchors.top: parent.top spacing: 0 - StatusBar.StatusBar { + MobileShell.StatusBar { id: statusBar Layout.fillWidth: true - Layout.preferredHeight: Components.Constants.topPanelHeight + Kirigami.Units.gridUnit * 0.8 + Layout.preferredHeight: MobileShell.Constants.topPanelHeight + Kirigami.Units.gridUnit * 0.8 Kirigami.Theme.colorSet: Kirigami.Theme.Window Kirigami.Theme.inherit: false @@ -91,7 +87,7 @@ Components.BaseItem { disableSystemTray: actionDrawer.restrictedPermissions } - QuickSettings { + MobileShell.QuickSettings { id: quickSettings Layout.preferredHeight: root.minimizedQuickSettingsHeight + root.addedHeight Layout.topMargin: Kirigami.Units.smallSpacing @@ -105,7 +101,7 @@ Components.BaseItem { width: parent.width } - MediaControls.MediaControlsWidget { + MobileShell.MediaControlsWidget { id: mediaWidget property real fullHeight: height + Layout.topMargin Layout.fillWidth: true diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsFullDelegate.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsFullDelegate.qml index 7447c691..e0c75b4b 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsFullDelegate.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsFullDelegate.qml @@ -11,11 +11,10 @@ import QtQuick.Layouts 1.1 import org.kde.kirigami 2.12 as Kirigami import org.kde.plasma.core as PlasmaCore +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings import org.kde.plasma.components 3.0 as PlasmaComponents -import "../../components" as Components - QuickSettingsDelegate { id: root @@ -54,7 +53,7 @@ QuickSettingsDelegate { } } - Components.HapticsEffectLoader { + MobileShell.HapticsEffectLoader { id: haptics } @@ -94,7 +93,7 @@ QuickSettingsDelegate { font.weight: Font.Bold } - Components.MarqueeLabel { + MobileShell.MarqueeLabel { // if no status is given, just use On/Off inputText: root.status ? root.status : (root.enabled ? i18n("On") : i18n("Off")) opacity: 0.6 diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsMinimizedDelegate.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsMinimizedDelegate.qml index cb4f39b3..f749e43f 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsMinimizedDelegate.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsMinimizedDelegate.qml @@ -9,13 +9,12 @@ import QtQuick.Layouts 1.1 import org.kde.kirigami 2.12 as Kirigami +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.core as PlasmaCore import org.kde.plasma.private.nanoshell 2.0 as NanoShell import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings import org.kde.plasma.components 3.0 as PlasmaComponents -import "../../components" as Components - QuickSettingsDelegate { id: root @@ -52,7 +51,7 @@ QuickSettingsDelegate { } } - Components.HapticsEffectLoader { + MobileShell.HapticsEffectLoader { id: haptics } diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsPanel.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsPanel.qml index e9c79398..210df77b 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsPanel.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsPanel.qml @@ -10,18 +10,14 @@ import QtQuick.Layouts import org.kde.kirigami 2.12 as Kirigami import org.kde.ksvg 1.0 as KSvg - +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.core as PlasmaCore -import "../../statusbar" as StatusBar -import "../../components" as Components -import "../" - /** * Quick settings panel for landscape view (right sidebar). * For the portrait view quicksettings container, see QuickSettingsDrawer. */ -Components.BaseItem { +MobileShell.BaseItem { id: root required property var actionDrawer @@ -56,7 +52,7 @@ Components.BaseItem { height: root.fullScreenHeight spacing: 0 - StatusBar.StatusBar { + MobileShell.StatusBar { id: statusBar Layout.alignment: Qt.AlignTop Layout.fillWidth: true @@ -75,7 +71,7 @@ Components.BaseItem { disableSystemTray: actionDrawer.restrictedPermissions } - QuickSettings { + MobileShell.QuickSettings { id: quickSettings mode: QuickSettings.ScrollView diff --git a/components/mobileshell/qml/components/HapticsEffectLoader.qml b/components/mobileshell/qml/components/HapticsEffectLoader.qml index dbf1db21..08b861e6 100644 --- a/components/mobileshell/qml/components/HapticsEffectLoader.qml +++ b/components/mobileshell/qml/components/HapticsEffectLoader.qml @@ -7,6 +7,7 @@ import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings Loader { // source: "qrc:/org/kde/plasma/private/mobileshell/qml/components/HapticsEffectWrapper.qml" + // FIXME: the source above will have to be ported to Component type, as in `VolumeOSDProviderLoader.qml` property bool valid: item !== null function buttonVibrate() { diff --git a/components/mobileshell/qml/components/util.js b/components/mobileshell/qml/components/util.js deleted file mode 100644 index eca9b1b8..00000000 --- a/components/mobileshell/qml/components/util.js +++ /dev/null @@ -1,9 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Devin Lin -// SPDX-License-Identifier: GPL-2.0-or-later - -/** - * Applies both the min and max functions to a value. - */ -function applyMinMaxRange(min, max, num) { - return Math.min(max, Math.max(min, num)); -} diff --git a/components/mobileshell/qml/dataproviders/SignalStrengthInfo.qml b/components/mobileshell/qml/dataproviders/SignalStrengthInfo.qml index d448da21..0705ea5e 100644 --- a/components/mobileshell/qml/dataproviders/SignalStrengthInfo.qml +++ b/components/mobileshell/qml/dataproviders/SignalStrengthInfo.qml @@ -9,7 +9,7 @@ pragma Singleton import QtQuick 2.1 -import org.kde.plasma.mm 1.0 +import org.kde.plasma.mm QtObject { readonly property string icon: "network-mobile-" + Math.floor(SignalIndicator.strength / 20) * 20 diff --git a/components/mobileshell/qml/homescreen/HomeScreen.qml b/components/mobileshell/qml/homescreen/HomeScreen.qml index 8b009f89..adc5863e 100644 --- a/components/mobileshell/qml/homescreen/HomeScreen.qml +++ b/components/mobileshell/qml/homescreen/HomeScreen.qml @@ -7,12 +7,11 @@ import QtQuick.Window import org.kde.plasma.plasmoid import org.kde.taskmanager as TaskManager +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings import org.kde.plasma.private.mobileshell.state as MobileShellState import org.kde.plasma.private.mobileshell.windowplugin as WindowPlugin -import "../components" as Components - /** * The base homescreen component, implementing features that simplify * homescreen implementation. @@ -138,7 +137,7 @@ Item { } // homescreen visual component - Components.BaseItem { + MobileShell.BaseItem { id: itemContainer anchors.fill: parent @@ -209,7 +208,7 @@ Item { } // start app animation component - Components.StartupFeedback { + MobileShell.StartupFeedback { id: startupFeedback z: 999999 anchors.fill: parent diff --git a/components/mobileshell/qml/navigationpanel/NavigationPanel.qml b/components/mobileshell/qml/navigationpanel/NavigationPanel.qml index 4131d23d..6cf5f7f4 100644 --- a/components/mobileshell/qml/navigationpanel/NavigationPanel.qml +++ b/components/mobileshell/qml/navigationpanel/NavigationPanel.qml @@ -13,10 +13,7 @@ import QtQuick.Effects import org.kde.kirigami 2.20 as Kirigami import org.kde.taskmanager 0.1 as TaskManager import org.kde.kquickcontrolsaddons 2.0 - -import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState - -import "../components" as Components +import org.kde.plasma.private.mobileshell.state as MobileShellState Item { id: root diff --git a/components/mobileshell/qml/statusbar/ClockText.qml b/components/mobileshell/qml/statusbar/ClockText.qml index b8fa908f..60d16b8f 100644 --- a/components/mobileshell/qml/statusbar/ClockText.qml +++ b/components/mobileshell/qml/statusbar/ClockText.qml @@ -10,12 +10,10 @@ import QtQuick.Layouts 1.15 import org.kde.plasma.plasma5support 2.0 as P5Support import org.kde.plasma.components 3.0 as PlasmaComponents -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.kirigami as Kirigami -import "indicators" as Indicators - PlasmaComponents.Label { id: clock diff --git a/components/mobileshell/qml/statusbar/StatusBar.qml b/components/mobileshell/qml/statusbar/StatusBar.qml index d5cff19a..4b78754b 100644 --- a/components/mobileshell/qml/statusbar/StatusBar.qml +++ b/components/mobileshell/qml/statusbar/StatusBar.qml @@ -18,10 +18,7 @@ import org.kde.plasma.core as PlasmaCore import org.kde.plasma.plasma5support 2.0 as P5Support import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.kitemmodels as KItemModels -import org.kde.plasma.private.mobileshell 1.0 as MobileShell - -import "indicators" as Indicators -import "../components" as Components +import org.kde.plasma.private.mobileshell as MobileShell Item { id: root @@ -114,7 +111,7 @@ Item { RowLayout { id: mainRow - readonly property real rowHeight: Components.Constants.topPanelHeight - Kirigami.Units.smallSpacing * 2 + readonly property real rowHeight: MobileShell.Constants.topPanelHeight - Kirigami.Units.smallSpacing * 2 Layout.fillWidth: true Layout.preferredHeight: rowHeight @@ -129,7 +126,7 @@ Item { source: timeSource } - Indicators.SignalStrengthIndicator { + MobileShell.SignalStrengthIndicator { Layout.fillHeight: true showLabel: true visible: !root.showTime @@ -166,27 +163,27 @@ Item { spacing: root.elementSpacing - Indicators.SignalStrengthIndicator { + MobileShell.SignalStrengthIndicator { showLabel: false visible: root.showTime internetIndicator: internetIndicatorItem implicitHeight: mainRow.rowHeight Layout.preferredWidth: height } - Indicators.BluetoothIndicator { + MobileShell.BluetoothIndicator { implicitHeight: mainRow.rowHeight Layout.preferredWidth: height } - Indicators.InternetIndicator { + MobileShell.InternetIndicator { id: internetIndicatorItem implicitHeight: mainRow.rowHeight Layout.preferredWidth: height } - Indicators.VolumeIndicator { + MobileShell.VolumeIndicator { implicitHeight: mainRow.rowHeight Layout.preferredWidth: height } - Indicators.BatteryIndicator { + MobileShell.BatteryIndicator { spacing: root.elementSpacing textPixelSize: root.textPixelSize implicitHeight: mainRow.rowHeight diff --git a/components/mobileshell/qml/statusbar/indicators/BatteryIndicator.qml b/components/mobileshell/qml/statusbar/indicators/BatteryIndicator.qml index 9d1db113..ca5acd40 100644 --- a/components/mobileshell/qml/statusbar/indicators/BatteryIndicator.qml +++ b/components/mobileshell/qml/statusbar/indicators/BatteryIndicator.qml @@ -12,7 +12,7 @@ import org.kde.kirigami 2.20 as Kirigami import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.workspace.components 2.0 as PW -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell RowLayout { property real textPixelSize: Kirigami.Units.gridUnit * 0.6 diff --git a/components/mobileshell/qml/statusbar/indicators/BluetoothIndicator.qml b/components/mobileshell/qml/statusbar/indicators/BluetoothIndicator.qml index 2928c48a..f7830997 100644 --- a/components/mobileshell/qml/statusbar/indicators/BluetoothIndicator.qml +++ b/components/mobileshell/qml/statusbar/indicators/BluetoothIndicator.qml @@ -10,7 +10,7 @@ import QtQuick import QtQuick.Layouts import org.kde.kirigami 2.20 as Kirigami -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell Kirigami.Icon { id: connectionIcon diff --git a/components/mobileshell/qml/statusbar/indicators/SignalStrengthIndicator.qml b/components/mobileshell/qml/statusbar/indicators/SignalStrengthIndicator.qml index 60ef8f14..f987a290 100644 --- a/components/mobileshell/qml/statusbar/indicators/SignalStrengthIndicator.qml +++ b/components/mobileshell/qml/statusbar/indicators/SignalStrengthIndicator.qml @@ -11,7 +11,7 @@ import QtQuick.Layouts import org.kde.plasma.core as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.kirigami as Kirigami -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell Item { property InternetIndicator internetIndicator diff --git a/components/mobileshell/qml/statusbar/indicators/VolumeIndicator.qml b/components/mobileshell/qml/statusbar/indicators/VolumeIndicator.qml index 04dad06f..249326b3 100644 --- a/components/mobileshell/qml/statusbar/indicators/VolumeIndicator.qml +++ b/components/mobileshell/qml/statusbar/indicators/VolumeIndicator.qml @@ -12,7 +12,7 @@ import QtQuick.Layouts import org.kde.plasma.private.volume 0.1 import org.kde.kirigami as Kirigami -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell Kirigami.Icon { id: paIcon diff --git a/components/mobileshell/qml/volumeosd/AudioApplet.qml b/components/mobileshell/qml/volumeosd/AudioApplet.qml index cbae84c9..313e75d3 100644 --- a/components/mobileshell/qml/volumeosd/AudioApplet.qml +++ b/components/mobileshell/qml/volumeosd/AudioApplet.qml @@ -13,7 +13,7 @@ import QtQuick.Controls as Controls import org.kde.kirigami 2.20 as Kirigami import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.kquickcontrolsaddons as KQCAddons -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.private.volume diff --git a/components/mobileshell/qml/volumeosd/VolumeOSD.qml b/components/mobileshell/qml/volumeosd/VolumeOSD.qml index bd28f45a..476bf87c 100644 --- a/components/mobileshell/qml/volumeosd/VolumeOSD.qml +++ b/components/mobileshell/qml/volumeosd/VolumeOSD.qml @@ -14,10 +14,8 @@ import QtQuick.Window import org.kde.kirigami 2.20 as Kirigami import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.private.nanoshell 2.0 as NanoShell -import org.kde.plasma.private.mobileshell 1.0 as MobileShell -import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState - -import "../dataproviders" as DataProviders +import org.kde.plasma.private.mobileshell as MobileShell +import org.kde.plasma.private.mobileshell.state as MobileShellState NanoShell.FullScreenOverlay { id: window diff --git a/components/mobileshell/qml/volumeosd/VolumeOSDProvider.qml b/components/mobileshell/qml/volumeosd/VolumeOSDProvider.qml index 12b3eff7..846b2984 100644 --- a/components/mobileshell/qml/volumeosd/VolumeOSDProvider.qml +++ b/components/mobileshell/qml/volumeosd/VolumeOSDProvider.qml @@ -11,7 +11,7 @@ import QtQuick.Layouts import org.kde.plasma.private.volume 0.1 as VolumeLib import org.kde.plasma.private.mobileshell.state as MobileShellState -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell /** * This imports the volume OSD and also sets up keyboard/hardware button bindings. diff --git a/components/mobileshell/qml/volumeosd/VolumeOSDProviderLoader.qml b/components/mobileshell/qml/volumeosd/VolumeOSDProviderLoader.qml index 8fff5cbf..8367db3c 100644 --- a/components/mobileshell/qml/volumeosd/VolumeOSDProviderLoader.qml +++ b/components/mobileshell/qml/volumeosd/VolumeOSDProviderLoader.qml @@ -2,6 +2,7 @@ // SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL import QtQuick +import org.kde.plasma.private.mobileshell as MobileShell pragma Singleton @@ -11,7 +12,9 @@ pragma Singleton */ Loader { id: root - source: "qrc:/org/kde/plasma/private/mobileshell/qml/volumeosd/VolumeOSDProvider.qml" + sourceComponent: Component { + MobileShell.VolumeOSDProvider {} + } // WARNING: only call this load from within the plasmashell process, because // multiple bindings of the shortcut may break it entirely (hardware volume keys) diff --git a/components/mobileshell/qml/widgets/krunner/KRunnerScreen.qml b/components/mobileshell/qml/widgets/krunner/KRunnerScreen.qml index 39ba5bcf..b48ee290 100644 --- a/components/mobileshell/qml/widgets/krunner/KRunnerScreen.qml +++ b/components/mobileshell/qml/widgets/krunner/KRunnerScreen.qml @@ -18,8 +18,6 @@ import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.milou as Milou import org.kde.kirigami 2.19 as Kirigami -import "../../components" as Components - Item { id: root diff --git a/components/mobileshell/qml/widgets/krunner/KRunnerWidget.qml b/components/mobileshell/qml/widgets/krunner/KRunnerWidget.qml index 43cafcd7..1ee9a125 100644 --- a/components/mobileshell/qml/widgets/krunner/KRunnerWidget.qml +++ b/components/mobileshell/qml/widgets/krunner/KRunnerWidget.qml @@ -18,8 +18,6 @@ import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.milou as Milou import org.kde.kirigami 2.19 as Kirigami -import "../../components" as Components - /** * Search widget that is embedded into the homescreen. The dimensions of * the root item is assumed to be the available screen area for applications. diff --git a/components/mobileshell/qml/widgets/mediacontrols/MediaControlsWidget.qml b/components/mobileshell/qml/widgets/mediacontrols/MediaControlsWidget.qml index a4e4413d..4dc812ad 100644 --- a/components/mobileshell/qml/widgets/mediacontrols/MediaControlsWidget.qml +++ b/components/mobileshell/qml/widgets/mediacontrols/MediaControlsWidget.qml @@ -8,13 +8,12 @@ import QtQuick.Controls as QQC2 import org.kde.kirigami as Kirigami -import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState +import org.kde.plasma.private.mobileshell as MobileShell +import org.kde.plasma.private.mobileshell.state as MobileShellState import org.kde.plasma.components 3.0 as PlasmaComponents3 import org.kde.plasma.private.mpris as Mpris -import "../../components" as Components - /** * Embeddable component that provides MPRIS control. */ @@ -90,11 +89,11 @@ Item { implicitWidth: playerItem.implicitWidth onClicked: { - Components.AppLaunch.launchOrActivateApp(model.desktopEntry + ".desktop"); + MobileShell.AppLaunch.launchOrActivateApp(model.desktopEntry + ".desktop"); MobileShellState.ShellDBusClient.closeActionDrawer(); } - Components.BaseItem { + MobileShell.BaseItem { id: playerItem anchors.fill: parent @@ -137,7 +136,7 @@ Item { spacing: Kirigami.Units.smallSpacing // media track name text - Components.MarqueeLabel { + MobileShell.MarqueeLabel { id: trackLabel Layout.fillWidth: true @@ -148,7 +147,7 @@ Item { } // media artist name text - Components.MarqueeLabel { + MobileShell.MarqueeLabel { id: artistLabel Layout.fillWidth: true diff --git a/components/mobileshell/qml/widgets/notifications/NotificationGroupHeader.qml b/components/mobileshell/qml/widgets/notifications/NotificationGroupHeader.qml index 9022995b..75b7799d 100644 --- a/components/mobileshell/qml/widgets/notifications/NotificationGroupHeader.qml +++ b/components/mobileshell/qml/widgets/notifications/NotificationGroupHeader.qml @@ -14,13 +14,10 @@ import org.kde.kirigami 2.12 as Kirigami import org.kde.plasma.core as PlasmaCore import org.kde.plasma.plasma5support 2.0 as P5Support import org.kde.plasma.components 3.0 as PlasmaComponents - import org.kde.notificationmanager as NotificationManager import org.kde.coreaddons 1.0 as KCoreAddons -import "util.js" as Util - RowLayout { id: notificationHeading property int notificationType diff --git a/components/mobileshell/qml/widgets/notifications/NotificationItem.qml b/components/mobileshell/qml/widgets/notifications/NotificationItem.qml index 9510af72..2f212b0a 100644 --- a/components/mobileshell/qml/widgets/notifications/NotificationItem.qml +++ b/components/mobileshell/qml/widgets/notifications/NotificationItem.qml @@ -9,6 +9,7 @@ import QtQuick 2.15 import QtQuick.Layouts 1.1 import QtQuick.Window 2.2 +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.core as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents @@ -18,8 +19,6 @@ import org.kde.kirigami 2.12 as Kirigami import org.kde.coreaddons 1.0 as KCoreAddons -import "util.js" as Util - // notification properties are in BaseNotificationItem BaseNotificationItem { id: notificationItem @@ -80,7 +79,7 @@ BaseNotificationItem { maximumLineCount: 3 wrapMode: Text.WordWrap elide: Text.ElideRight - text: Util.determineNotificationHeadingText(notificationItem) + text: MobileShell.NotificationsUtils.determineNotificationHeadingText(notificationItem) visible: text !== "" font.weight: Font.DemiBold } diff --git a/components/mobileshell/qml/widgets/notifications/NotificationTimeText.qml b/components/mobileshell/qml/widgets/notifications/NotificationTimeText.qml index f032237b..9054fe1f 100644 --- a/components/mobileshell/qml/widgets/notifications/NotificationTimeText.qml +++ b/components/mobileshell/qml/widgets/notifications/NotificationTimeText.qml @@ -9,6 +9,7 @@ import QtQuick 2.8 import QtQuick.Layouts 1.1 import QtQuick.Window 2.2 +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.plasma5support 2.0 as P5Support import org.kde.plasma.components 3.0 as PlasmaComponents @@ -17,8 +18,6 @@ import org.kde.notificationmanager as NotificationManager import org.kde.coreaddons 1.0 as KCoreAddons -import "util.js" as Util - PlasmaComponents.Label { id: ageLabel @@ -43,7 +42,7 @@ PlasmaComponents.Label { Component.onCompleted: updateAgoText() function updateAgoText() { - ageLabel.agoText = Util.generateNotificationHeaderAgoText(time, jobState); + ageLabel.agoText = MobileShell.NotificationsUtils.generateNotificationHeaderAgoText(time, jobState); } font.pixelSize: Kirigami.Theme.defaultFont.pixelSize * 0.8 @@ -53,5 +52,5 @@ PlasmaComponents.Label { property string agoText: "" visible: text !== "" opacity: 0.6 - text: Util.generateNotificationHeaderRemainingText(notificationType, jobState, jobDetails) || agoText + text: MobileShell.NotificationsUtils.generateNotificationHeaderRemainingText(notificationType, jobState, jobDetails) || agoText } diff --git a/components/mobileshell/qml/widgets/notifications/util.js b/components/mobileshell/qml/widgets/notifications/NotificationsUtils.js similarity index 100% rename from components/mobileshell/qml/widgets/notifications/util.js rename to components/mobileshell/qml/widgets/notifications/NotificationsUtils.js diff --git a/components/mobileshell/qml/widgets/notifications/NotificationsWidget.qml b/components/mobileshell/qml/widgets/notifications/NotificationsWidget.qml index 53b50c0f..7558f921 100644 --- a/components/mobileshell/qml/widgets/notifications/NotificationsWidget.qml +++ b/components/mobileshell/qml/widgets/notifications/NotificationsWidget.qml @@ -13,7 +13,7 @@ import Qt5Compat.GraphicalEffects import org.kde.kirigami 2.12 as Kirigami import org.kde.plasma.plasma5support 2.0 as P5Support -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.plasma.components 3.0 as PlasmaComponents3 diff --git a/components/mobileshell/qml/widgets/notifications/ThumbnailStrip.qml b/components/mobileshell/qml/widgets/notifications/ThumbnailStrip.qml index 6886a77c..4c753682 100644 --- a/components/mobileshell/qml/widgets/notifications/ThumbnailStrip.qml +++ b/components/mobileshell/qml/widgets/notifications/ThumbnailStrip.qml @@ -11,7 +11,7 @@ import QtQuick.Effects import org.kde.kirigami 2.20 as Kirigami import org.kde.plasma.core as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents3 -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.kquickcontrolsaddons 2.0 as KQCAddons diff --git a/components/mobileshell/qmldir b/components/mobileshell/qmldir deleted file mode 100644 index 53c3101e..00000000 --- a/components/mobileshell/qmldir +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-FileCopyrightText: 2021-2022 Devin Lin -# SPDX-License-Identifier: GPL-2.0-or-later - -module org.kde.plasma.private.mobileshell - -plugin mobileshellplugin - diff --git a/components/mobileshell/shellutil.cpp b/components/mobileshell/shellutil.cpp index efba4f37..edbdb40f 100644 --- a/components/mobileshell/shellutil.cpp +++ b/components/mobileshell/shellutil.cpp @@ -28,12 +28,6 @@ ShellUtil::ShellUtil(QObject *parent) { } -ShellUtil *ShellUtil::instance() -{ - static ShellUtil *inst = new ShellUtil(nullptr); - return inst; -} - void ShellUtil::stackItemBefore(QQuickItem *item1, QQuickItem *item2) { if (!item1 || !item2 || item1 == item2 || item1->parentItem() != item2->parentItem()) { diff --git a/components/mobileshell/shellutil.h b/components/mobileshell/shellutil.h index 608d7197..a5d746e3 100644 --- a/components/mobileshell/shellutil.h +++ b/components/mobileshell/shellutil.h @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -22,11 +23,12 @@ class ShellUtil : public QObject { Q_OBJECT + QML_ELEMENT + QML_SINGLETON Q_PROPERTY(bool isSystem24HourFormat READ isSystem24HourFormat NOTIFY isSystem24HourFormatChanged) public: ShellUtil(QObject *parent = nullptr); - static ShellUtil *instance(); /** * Change the stacking order to have the first item behind the second item. diff --git a/components/mobileshellstate/CMakeLists.txt b/components/mobileshellstate/CMakeLists.txt index 22fac592..f5911bf3 100644 --- a/components/mobileshellstate/CMakeLists.txt +++ b/components/mobileshellstate/CMakeLists.txt @@ -1,11 +1,7 @@ # SPDX-FileCopyrightText: 2022 Devin Lin # SPDX-License-Identifier: GPL-2.0-or-later -include_directories(${CMAKE_CURRENT_BINARY_DIR}/..) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) - set(mobileshellstateplugin_SRCS - mobileshellstateplugin.cpp shelldbusobject.cpp shelldbusclient.cpp lockscreendbusclient.cpp @@ -23,7 +19,10 @@ qt_add_dbus_interface(mobileshellstateplugin_SRCS ${CMAKE_CURRENT_BINARY_DIR}/or install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.plasmashell.Mobile.xml DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR}) -add_library(mobileshellstateplugin SHARED ${mobileshellstateplugin_SRCS} ${RESOURCES}) + +ecm_add_qml_module(mobileshellstateplugin URI org.kde.plasma.private.mobileshell.state GENERATE_PLUGIN_SOURCE) + +target_sources(mobileshellstateplugin PRIVATE ${mobileshellstateplugin_SRCS} ${RESOURCES}) target_link_libraries(mobileshellstateplugin PUBLIC @@ -40,9 +39,4 @@ target_link_libraries(mobileshellstateplugin KF6::PlasmaQuick ) -# we compiled the qml files, just install qmldir -install(FILES qmldir DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/mobileshell/state) - -ecm_generate_qmltypes(org.kde.plasma.private.mobileshell.state 1.0 DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/mobileshell/state) -install(TARGETS mobileshellstateplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/mobileshell/state) - +ecm_finalize_qml_module(mobileshellstateplugin) diff --git a/components/mobileshellstate/lockscreendbusclient.cpp b/components/mobileshellstate/lockscreendbusclient.cpp index 7c4d8f3f..8d00502b 100644 --- a/components/mobileshellstate/lockscreendbusclient.cpp +++ b/components/mobileshellstate/lockscreendbusclient.cpp @@ -28,12 +28,6 @@ LockscreenDBusClient::LockscreenDBusClient(QObject *parent) SLOT(slotLockscreenActiveChanged(bool))); } -LockscreenDBusClient *LockscreenDBusClient::self() -{ - static LockscreenDBusClient *instance = new LockscreenDBusClient; - return instance; -} - bool LockscreenDBusClient::lockscreenActive() const { return m_lockscreenActive; @@ -58,4 +52,4 @@ void LockscreenDBusClient::slotLockscreenActiveChanged(bool active) void LockscreenDBusClient::dbusError(QDBusError error) { qDebug() << "Error fetching lockscreen state using DBus:" << error.message(); -} \ No newline at end of file +} diff --git a/components/mobileshellstate/lockscreendbusclient.h b/components/mobileshellstate/lockscreendbusclient.h index dbfaa395..b277160e 100644 --- a/components/mobileshellstate/lockscreendbusclient.h +++ b/components/mobileshellstate/lockscreendbusclient.h @@ -7,15 +7,17 @@ #include #include #include +#include class LockscreenDBusClient : public QObject { Q_OBJECT + QML_ELEMENT + QML_SINGLETON Q_PROPERTY(bool lockscreenActive READ lockscreenActive NOTIFY lockscreenActiveChanged); public: explicit LockscreenDBusClient(QObject *parent = nullptr); - static LockscreenDBusClient *self(); bool lockscreenActive() const; diff --git a/components/mobileshellstate/mobileshellstateplugin.cpp b/components/mobileshellstate/mobileshellstateplugin.cpp deleted file mode 100644 index 5044f419..00000000 --- a/components/mobileshellstate/mobileshellstateplugin.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Devin Lin -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "mobileshellstateplugin.h" -#include "lockscreendbusclient.h" -#include "shelldbusclient.h" -#include "shelldbusobject.h" - -#include -#include - -QUrl resolvePath(std::string str) -{ - return QUrl("qrc:/org/kde/plasma/private/mobileshell/state/qml/" + QString::fromStdString(str)); -} - -void MobileShellStatePlugin::registerTypes(const char *uri) -{ - Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.plasma.private.mobileshell.state")); - - qmlRegisterSingletonType(uri, 1, 0, "ShellDBusClient", [](QQmlEngine *, QJSEngine *) -> QObject * { - return ShellDBusClient::self(); - }); - qmlRegisterSingletonType(uri, 1, 0, "ShellDBusObject", [](QQmlEngine *, QJSEngine *) -> QObject * { - return ShellDBusObject::self(); - }); - qmlRegisterSingletonType(uri, 1, 0, "LockscreenDBusClient", [](QQmlEngine *, QJSEngine *) -> QObject * { - return LockscreenDBusClient::self(); - }); -} diff --git a/components/mobileshellstate/mobileshellstateplugin.h b/components/mobileshellstate/mobileshellstateplugin.h deleted file mode 100644 index 45dd3db9..00000000 --- a/components/mobileshellstate/mobileshellstateplugin.h +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-FileCopyrightText: 2022 Devin Lin -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include - -#include -#include - -class MobileShellStatePlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") - -public: - void registerTypes(const char *uri) override; -}; diff --git a/components/mobileshellstate/qmldir b/components/mobileshellstate/qmldir deleted file mode 100644 index a6700d6c..00000000 --- a/components/mobileshellstate/qmldir +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-FileCopyrightText: 2021-2022 Devin Lin -# SPDX-License-Identifier: GPL-2.0-or-later - -module org.kde.plasma.private.mobileshell.state - -plugin mobileshellstateplugin diff --git a/components/mobileshellstate/shelldbusclient.cpp b/components/mobileshellstate/shelldbusclient.cpp index 128e53be..8b17edc0 100644 --- a/components/mobileshellstate/shelldbusclient.cpp +++ b/components/mobileshellstate/shelldbusclient.cpp @@ -27,12 +27,6 @@ ShellDBusClient::ShellDBusClient(QObject *parent) }); } -ShellDBusClient *ShellDBusClient::self() -{ - static ShellDBusClient *instance = new ShellDBusClient; - return instance; -} - void ShellDBusClient::connectSignals() { connect(m_interface, &OrgKdePlasmashellInterface::isActionDrawerOpenChanged, this, &ShellDBusClient::updateIsActionDrawerOpen); diff --git a/components/mobileshellstate/shelldbusclient.h b/components/mobileshellstate/shelldbusclient.h index c4b1a827..29a43afd 100644 --- a/components/mobileshellstate/shelldbusclient.h +++ b/components/mobileshellstate/shelldbusclient.h @@ -8,17 +8,20 @@ #include #include #include +#include class ShellDBusClient : public QObject { Q_OBJECT + QML_ELEMENT + QML_SINGLETON + Q_PROPERTY(bool doNotDisturb READ doNotDisturb WRITE setDoNotDisturb NOTIFY doNotDisturbChanged) Q_PROPERTY(bool isActionDrawerOpen READ isActionDrawerOpen WRITE setIsActionDrawerOpen NOTIFY isActionDrawerOpenChanged) Q_PROPERTY(bool isTaskSwitcherVisible READ isTaskSwitcherVisible NOTIFY isTaskSwitcherVisibleChanged) public: explicit ShellDBusClient(QObject *parent = nullptr); - static ShellDBusClient *self(); bool doNotDisturb() const; void setDoNotDisturb(bool value); diff --git a/components/mobileshellstate/shelldbusobject.cpp b/components/mobileshellstate/shelldbusobject.cpp index b626f1b2..d8897d17 100644 --- a/components/mobileshellstate/shelldbusobject.cpp +++ b/components/mobileshellstate/shelldbusobject.cpp @@ -11,12 +11,6 @@ ShellDBusObject::ShellDBusObject(QObject *parent) { } -ShellDBusObject *ShellDBusObject::self() -{ - static ShellDBusObject *instance = new ShellDBusObject; - return instance; -} - void ShellDBusObject::registerObject() { if (!m_initialized) { diff --git a/components/mobileshellstate/shelldbusobject.h b/components/mobileshellstate/shelldbusobject.h index ef9c0be1..b1dbca14 100644 --- a/components/mobileshellstate/shelldbusobject.h +++ b/components/mobileshellstate/shelldbusobject.h @@ -5,15 +5,17 @@ #include #include +#include class ShellDBusObject : public QObject { Q_OBJECT + QML_ELEMENT + QML_SINGLETON Q_CLASSINFO("D-Bus Interface", "org.kde.plasmashell") public: ShellDBusObject(QObject *parent = nullptr); - static ShellDBusObject *self(); // called by QML Q_INVOKABLE void registerObject(); diff --git a/components/quicksettingsplugin/CMakeLists.txt b/components/quicksettingsplugin/CMakeLists.txt index 94af94fd..d14a1895 100644 --- a/components/quicksettingsplugin/CMakeLists.txt +++ b/components/quicksettingsplugin/CMakeLists.txt @@ -1,18 +1,17 @@ # SPDX-FileCopyrightText: 2023 Devin Lin # SPDX-License-Identifier: GPL-2.0-or-later -add_library(quicksettingsplugin) +ecm_add_qml_module(quicksettingsplugin URI org.kde.plasma.private.mobileshell.quicksettingsplugin GENERATE_PLUGIN_SOURCE) target_sources(quicksettingsplugin PRIVATE paginatemodel.cpp quicksetting.cpp quicksettingsmodel.cpp - quicksettingsplugin.cpp quicksettingsconfig.cpp savedquicksettings.cpp savedquicksettingsmodel.cpp ) -target_link_libraries(quicksettingsplugin +target_link_libraries(quicksettingsplugin PRIVATE Qt::Qml Qt::DBus Qt::Gui @@ -23,10 +22,6 @@ target_link_libraries(quicksettingsplugin KF6::Package ) -set_property(TARGET quicksettingsplugin PROPERTY LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/org/kde/plasma/private/mobileshell/quicksettingsplugin) -file(COPY qmldir DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/org/kde/plasma/private/mobileshell/quicksettingsplugin) - -install(TARGETS quicksettingsplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/mobileshell/quicksettingsplugin) -install(FILES qmldir ${qml_SRC} DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/mobileshell/quicksettingsplugin) +ecm_finalize_qml_module(quicksettingsplugin) diff --git a/components/quicksettingsplugin/paginatemodel.h b/components/quicksettingsplugin/paginatemodel.h index 0602e44e..8a8372f9 100644 --- a/components/quicksettingsplugin/paginatemodel.h +++ b/components/quicksettingsplugin/paginatemodel.h @@ -7,6 +7,7 @@ #pragma once #include +#include /** * @class PaginateModel @@ -19,6 +20,8 @@ class PaginateModel : public QAbstractListModel { Q_OBJECT + QML_ELEMENT + /** Holds the number of elements that will fit in a page */ Q_PROPERTY(int pageSize READ pageSize WRITE setPageSize NOTIFY pageSizeChanged) diff --git a/components/quicksettingsplugin/qmldir b/components/quicksettingsplugin/qmldir deleted file mode 100644 index 14490d59..00000000 --- a/components/quicksettingsplugin/qmldir +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-FileCopyrightText: 2021-2022 Devin Lin -# SPDX-License-Identifier: GPL-2.0-or-later - -module org.kde.plasma.private.mobileshell.quicksettingsplugin - -plugin quicksettingsplugin - - diff --git a/components/quicksettingsplugin/quicksetting.h b/components/quicksettingsplugin/quicksetting.h index 20c52551..187a7adf 100644 --- a/components/quicksettingsplugin/quicksetting.h +++ b/components/quicksettingsplugin/quicksetting.h @@ -13,6 +13,8 @@ class QuickSetting : public QObject { Q_OBJECT + QML_ELEMENT + Q_PROPERTY(QString text READ text WRITE setText REQUIRED NOTIFY textChanged) Q_PROPERTY(QString status READ status WRITE setStatus NOTIFY statusChanged) // if no status is explicitly set, On/Off is used by default Q_PROPERTY(QString icon READ iconName WRITE setIconName REQUIRED NOTIFY iconNameChanged) @@ -21,7 +23,7 @@ class QuickSetting : public QObject Q_PROPERTY(bool available READ isAvailable WRITE setAvailable NOTIFY availableChanged) Q_PROPERTY(QQmlListProperty children READ children CONSTANT) Q_CLASSINFO("DefaultProperty", "children") - QML_NAMED_ELEMENT("QuickSetting") + public: QuickSetting(QObject *parent = nullptr); diff --git a/components/quicksettingsplugin/quicksettingsconfig.cpp b/components/quicksettingsplugin/quicksettingsconfig.cpp index b1278692..6fe40c0a 100644 --- a/components/quicksettingsplugin/quicksettingsconfig.cpp +++ b/components/quicksettingsplugin/quicksettingsconfig.cpp @@ -11,12 +11,6 @@ const QString CONFIG_FILE = QStringLiteral("plasmamobilerc"); const QString QUICKSETTINGS_CONFIG_GROUP = QStringLiteral("QuickSettings"); -QuickSettingsConfig *QuickSettingsConfig::self() -{ - static QuickSettingsConfig *singleton = new QuickSettingsConfig(); - return singleton; -} - QuickSettingsConfig::QuickSettingsConfig(QObject *parent) : QObject{parent} , m_config{KSharedConfig::openConfig(CONFIG_FILE, KConfig::SimpleConfig)} diff --git a/components/quicksettingsplugin/quicksettingsconfig.h b/components/quicksettingsplugin/quicksettingsconfig.h index 1b008b04..7b31227f 100644 --- a/components/quicksettingsplugin/quicksettingsconfig.h +++ b/components/quicksettingsplugin/quicksettingsconfig.h @@ -22,8 +22,6 @@ class QuickSettingsConfig : public QObject Q_OBJECT public: - static QuickSettingsConfig *self(); - QuickSettingsConfig(QObject *parent = nullptr); /** diff --git a/components/quicksettingsplugin/quicksettingsplugin.cpp b/components/quicksettingsplugin/quicksettingsplugin.cpp deleted file mode 100644 index e3005b1e..00000000 --- a/components/quicksettingsplugin/quicksettingsplugin.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-FileCopyrightText: 2023 Devin Lin -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "quicksettingsplugin.h" -#include "paginatemodel.h" -#include "quicksetting.h" -#include "quicksettingsmodel.h" -#include "savedquicksettings.h" -#include "savedquicksettingsmodel.h" - -#include -#include - -void QuickSettingsPlugin::registerTypes(const char *uri) -{ - Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.plasma.private.mobileshell.quicksettingsplugin")); - - qmlRegisterType(uri, 1, 0, "QuickSetting"); - qmlRegisterType(uri, 1, 0, "QuickSettingsModel"); - qmlRegisterType(uri, 1, 0, "PaginateModel"); - qmlRegisterType(uri, 1, 0, "SavedQuickSettings"); - qmlRegisterType(uri, 1, 0, "SavedQuickSettingsModel"); -} diff --git a/components/quicksettingsplugin/quicksettingsplugin.h b/components/quicksettingsplugin/quicksettingsplugin.h deleted file mode 100644 index 6bc8f9e0..00000000 --- a/components/quicksettingsplugin/quicksettingsplugin.h +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-FileCopyrightText: 2023 Devin Lin -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include - -#include -#include - -class QuickSettingsPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") - -public: - void registerTypes(const char *uri) override; -}; diff --git a/components/quicksettingsplugin/savedquicksettings.h b/components/quicksettingsplugin/savedquicksettings.h index 7f638043..115af5fe 100644 --- a/components/quicksettingsplugin/savedquicksettings.h +++ b/components/quicksettingsplugin/savedquicksettings.h @@ -24,6 +24,8 @@ class SavedQuickSettings : public QObject { Q_OBJECT + QML_ELEMENT + Q_PROPERTY(SavedQuickSettingsModel *enabledModel READ enabledQuickSettingsModel CONSTANT) Q_PROPERTY(SavedQuickSettingsModel *disabledModel READ disabledQuickSettingsModel CONSTANT) diff --git a/components/quicksettingsplugin/savedquicksettingsmodel.h b/components/quicksettingsplugin/savedquicksettingsmodel.h index ad672913..f6e48a75 100644 --- a/components/quicksettingsplugin/savedquicksettingsmodel.h +++ b/components/quicksettingsplugin/savedquicksettingsmodel.h @@ -19,6 +19,7 @@ class SavedQuickSettingsModel : public QAbstractListModel { Q_OBJECT + QML_ELEMENT public: SavedQuickSettingsModel(QObject *parent = nullptr); diff --git a/components/shellsettingsplugin/CMakeLists.txt b/components/shellsettingsplugin/CMakeLists.txt index 5b7db759..9aff9c0a 100644 --- a/components/shellsettingsplugin/CMakeLists.txt +++ b/components/shellsettingsplugin/CMakeLists.txt @@ -1,13 +1,10 @@ # SPDX-FileCopyrightText: 2023 Devin Lin # SPDX-License-Identifier: GPL-2.0-or-later -add_library(shellsettingsplugin) -target_sources(shellsettingsplugin PRIVATE - mobileshellsettings.cpp - shellsettingsplugin.cpp -) +ecm_add_qml_module(shellsettingsplugin URI org.kde.plasma.private.mobileshell.shellsettingsplugin GENERATE_PLUGIN_SOURCE) +target_sources(shellsettingsplugin PRIVATE mobileshellsettings.cpp) -target_link_libraries(shellsettingsplugin +target_link_libraries(shellsettingsplugin PRIVATE Qt::Qml Qt::DBus Qt::Gui @@ -20,11 +17,4 @@ target_link_libraries(shellsettingsplugin KF6::JobWidgets ) -set_property(TARGET shellsettingsplugin PROPERTY LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/org/kde/plasma/private/mobileshell/shellsettingsplugin) -file(COPY qmldir DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/org/kde/plasma/private/mobileshell/shellsettingsplugin) - -install(TARGETS shellsettingsplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/mobileshell/shellsettingsplugin) -install(FILES qmldir ${qml_SRC} DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/mobileshell/shellsettingsplugin) - - - +ecm_finalize_qml_module(shellsettingsplugin) diff --git a/components/shellsettingsplugin/mobileshellsettings.cpp b/components/shellsettingsplugin/mobileshellsettings.cpp index ae6fffcb..110eac55 100644 --- a/components/shellsettingsplugin/mobileshellsettings.cpp +++ b/components/shellsettingsplugin/mobileshellsettings.cpp @@ -18,12 +18,6 @@ const QString CONFIG_FILE = QStringLiteral("plasmamobilerc"); const QString GENERAL_CONFIG_GROUP = QStringLiteral("General"); -MobileShellSettings *MobileShellSettings::self() -{ - static MobileShellSettings *singleton = new MobileShellSettings(); - return singleton; -} - MobileShellSettings::MobileShellSettings(QObject *parent) : QObject{parent} , m_config{KSharedConfig::openConfig(CONFIG_FILE, KConfig::SimpleConfig)} diff --git a/components/shellsettingsplugin/mobileshellsettings.h b/components/shellsettingsplugin/mobileshellsettings.h index 3f731c70..1a3c9e52 100644 --- a/components/shellsettingsplugin/mobileshellsettings.h +++ b/components/shellsettingsplugin/mobileshellsettings.h @@ -11,6 +11,7 @@ #include #include #include +#include /** * @short Wrapper class to access and control mobile shell specific settings. @@ -20,6 +21,8 @@ class MobileShellSettings : public QObject { Q_OBJECT + QML_NAMED_ELEMENT(Settings) + QML_SINGLETON // general Q_PROPERTY(bool vibrationsEnabled READ vibrationsEnabled WRITE setVibrationsEnabled NOTIFY vibrationsEnabledChanged) @@ -38,8 +41,6 @@ class MobileShellSettings : public QObject Q_PROPERTY(bool convergenceModeEnabled READ convergenceModeEnabled WRITE setConvergenceModeEnabled NOTIFY convergenceModeEnabledChanged) public: - static MobileShellSettings *self(); - MobileShellSettings(QObject *parent = nullptr); enum ActionDrawerMode { diff --git a/components/shellsettingsplugin/qmldir b/components/shellsettingsplugin/qmldir deleted file mode 100644 index aaaf2d87..00000000 --- a/components/shellsettingsplugin/qmldir +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-FileCopyrightText: 2023 Devin Lin -# SPDX-License-Identifier: GPL-2.0-or-later - -module org.kde.plasma.private.mobileshell.shellsettingsplugin - -plugin shellsettingsplugin - - - diff --git a/components/shellsettingsplugin/shellsettingsplugin.cpp b/components/shellsettingsplugin/shellsettingsplugin.cpp deleted file mode 100644 index 0da0d115..00000000 --- a/components/shellsettingsplugin/shellsettingsplugin.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-FileCopyrightText: 2023 Devin Lin -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "shellsettingsplugin.h" -#include "mobileshellsettings.h" - -#include -#include - -void ShellSettingsPlugin::registerTypes(const char *uri) -{ - Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.plasma.private.mobileshell.shellsettingsplugin")); - - qmlRegisterSingletonType(uri, 1, 0, "Settings", [](QQmlEngine *, QJSEngine *) -> QObject * { - return MobileShellSettings::self(); - }); -} diff --git a/components/shellsettingsplugin/shellsettingsplugin.h b/components/shellsettingsplugin/shellsettingsplugin.h deleted file mode 100644 index 4e625ba7..00000000 --- a/components/shellsettingsplugin/shellsettingsplugin.h +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-FileCopyrightText: 2023 Devin Lin -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include - -#include -#include - -class ShellSettingsPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") - -public: - void registerTypes(const char *uri) override; -}; diff --git a/components/windowplugin/CMakeLists.txt b/components/windowplugin/CMakeLists.txt index 5d72ef57..1d63183f 100644 --- a/components/windowplugin/CMakeLists.txt +++ b/components/windowplugin/CMakeLists.txt @@ -1,14 +1,14 @@ # SPDX-FileCopyrightText: 2023 Devin Lin # SPDX-License-Identifier: GPL-2.0-or-later -set(windowplugin_SRCS - windowplugin.cpp - windowutil.cpp -) -qt_add_resources(RESOURCES resources.qrc) -add_library(windowplugin SHARED ${windowplugin_SRCS} ${RESOURCES}) +ecm_add_qml_module(windowplugin URI org.kde.plasma.private.mobileshell.windowplugin GENERATE_PLUGIN_SOURCE) -target_link_libraries(windowplugin +target_sources(windowplugin PRIVATE windowutil.cpp) + +set_source_files_properties(qml/WindowMaximizedTracker.qml PROPERTIES QT_QML_SINGLETON_TYPE TRUE) +ecm_target_qml_sources(windowplugin SOURCES qml/WindowMaximizedTracker.qml) + +target_link_libraries(windowplugin PRIVATE Qt::Qml Qt::DBus Qt::Gui @@ -18,9 +18,4 @@ target_link_libraries(windowplugin KF6::ConfigWidgets ) -set_property(TARGET windowplugin PROPERTY LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/org/kde/plasma/private/mobileshell/windowplugin) -file(COPY qmldir DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/org/kde/plasma/private/mobileshell/windowplugin) - -install(TARGETS windowplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/mobileshell/windowplugin) -install(FILES qmldir ${qml_SRC} DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/mobileshell/windowplugin) - +ecm_finalize_qml_module(windowplugin) diff --git a/components/windowplugin/qmldir b/components/windowplugin/qmldir deleted file mode 100644 index 9dd6b4ed..00000000 --- a/components/windowplugin/qmldir +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-FileCopyrightText: 2021-2022 Devin Lin -# SPDX-License-Identifier: GPL-2.0-or-later - -module org.kde.plasma.private.mobileshell.windowplugin - -plugin windowplugin - diff --git a/components/windowplugin/resources.qrc b/components/windowplugin/resources.qrc deleted file mode 100644 index 374bd381..00000000 --- a/components/windowplugin/resources.qrc +++ /dev/null @@ -1,11 +0,0 @@ - - - - qml/WindowMaximizedTracker.qml - - - - diff --git a/components/windowplugin/windowplugin.cpp b/components/windowplugin/windowplugin.cpp deleted file mode 100644 index 1ff944b6..00000000 --- a/components/windowplugin/windowplugin.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-FileCopyrightText: 2023 Devin Lin -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "windowplugin.h" -#include "windowutil.h" - -#include -#include - -QUrl resolvePath(std::string str) -{ - return QUrl("qrc:/org/kde/plasma/private/mobileshell/windowplugin/qml/" + QString::fromStdString(str)); -} - -void WindowPlugin::registerTypes(const char *uri) -{ - Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.plasma.private.mobileshell.windowplugin")); - - qmlRegisterSingletonType(uri, 1, 0, "WindowUtil", [](QQmlEngine *, QJSEngine *) -> QObject * { - return WindowUtil::instance(); - }); - - qmlRegisterSingletonType(resolvePath("WindowMaximizedTracker.qml"), uri, 1, 0, "WindowMaximizedTracker"); -} diff --git a/components/windowplugin/windowplugin.h b/components/windowplugin/windowplugin.h deleted file mode 100644 index 225d4647..00000000 --- a/components/windowplugin/windowplugin.h +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-FileCopyrightText: 2023 Devin Lin -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include - -#include -#include - -class WindowPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") - -public: - void registerTypes(const char *uri) override; -}; diff --git a/components/windowplugin/windowutil.cpp b/components/windowplugin/windowutil.cpp index dc910a45..27458836 100644 --- a/components/windowplugin/windowutil.cpp +++ b/components/windowplugin/windowutil.cpp @@ -27,12 +27,6 @@ WindowUtil::WindowUtil(QObject *parent) initWayland(); } -WindowUtil *WindowUtil::instance() -{ - static WindowUtil *inst = new WindowUtil(); - return inst; -} - bool WindowUtil::isShowingDesktop() const { return m_showingDesktop; diff --git a/components/windowplugin/windowutil.h b/components/windowplugin/windowutil.h index b6384421..13ff7228 100644 --- a/components/windowplugin/windowutil.h +++ b/components/windowplugin/windowutil.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -29,13 +30,15 @@ class WindowUtil : public QObject { Q_OBJECT + QML_ELEMENT + QML_SINGLETON + Q_PROPERTY(bool isShowingDesktop READ isShowingDesktop WRITE requestShowingDesktop NOTIFY showingDesktopChanged) Q_PROPERTY(bool hasCloseableActiveWindow READ hasCloseableActiveWindow NOTIFY hasCloseableActiveWindowChanged) Q_PROPERTY(bool activeWindowIsShell READ activeWindowIsShell NOTIFY activeWindowIsShellChanged) public: WindowUtil(QObject *parent = nullptr); - static WindowUtil *instance(); /** * Whether the shell is in "desktop showing" mode, where all windows diff --git a/containments/homescreens/folio/package/contents/ui/AppDrawer.qml b/containments/homescreens/folio/package/contents/ui/AppDrawer.qml index 406722f7..382b5587 100644 --- a/containments/homescreens/folio/package/contents/ui/AppDrawer.qml +++ b/containments/homescreens/folio/package/contents/ui/AppDrawer.qml @@ -10,7 +10,7 @@ import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.components 3.0 as PC3 import org.kde.kirigami 2.10 as Kirigami -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell Item { id: root diff --git a/containments/homescreens/folio/package/contents/ui/AppDrawerGrid.qml b/containments/homescreens/folio/package/contents/ui/AppDrawerGrid.qml index a07b92f7..aa06f928 100644 --- a/containments/homescreens/folio/package/contents/ui/AppDrawerGrid.qml +++ b/containments/homescreens/folio/package/contents/ui/AppDrawerGrid.qml @@ -9,8 +9,8 @@ import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.components 3.0 as PC3 import org.kde.kirigami as Kirigami -import org.kde.plasma.private.mobileshell 1.0 as MobileShell -import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState +import org.kde.plasma.private.mobileshell as MobileShell +import org.kde.plasma.private.mobileshell.state as MobileShellState import org.kde.private.mobile.homescreen.folio 1.0 as Folio import "./delegate" diff --git a/containments/homescreens/folio/package/contents/ui/FavouritesBar.qml b/containments/homescreens/folio/package/contents/ui/FavouritesBar.qml index 6d460904..c175b36d 100644 --- a/containments/homescreens/folio/package/contents/ui/FavouritesBar.qml +++ b/containments/homescreens/folio/package/contents/ui/FavouritesBar.qml @@ -6,9 +6,9 @@ import QtQuick.Window 2.12 import QtQuick.Layouts 1.1 import org.kde.plasma.components 3.0 as PC3 -import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState +import org.kde.plasma.private.mobileshell.state as MobileShellState import org.kde.private.mobile.homescreen.folio 1.0 as Folio -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.kirigami 2.10 as Kirigami import "./delegate" diff --git a/containments/homescreens/folio/package/contents/ui/FolderView.qml b/containments/homescreens/folio/package/contents/ui/FolderView.qml index 1f0100ec..d21e1583 100644 --- a/containments/homescreens/folio/package/contents/ui/FolderView.qml +++ b/containments/homescreens/folio/package/contents/ui/FolderView.qml @@ -8,7 +8,7 @@ import QtQuick.Controls as QQC2 import org.kde.kirigami 2.20 as Kirigami -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.private.mobile.homescreen.folio 1.0 as Folio import "./delegate" diff --git a/containments/homescreens/folio/package/contents/ui/FolderViewTitle.qml b/containments/homescreens/folio/package/contents/ui/FolderViewTitle.qml index 7d3131c1..02d9aa58 100644 --- a/containments/homescreens/folio/package/contents/ui/FolderViewTitle.qml +++ b/containments/homescreens/folio/package/contents/ui/FolderViewTitle.qml @@ -8,7 +8,7 @@ import QtQuick.Controls as QQC2 import org.kde.kirigami 2.20 as Kirigami -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.private.mobile.homescreen.folio 1.0 as Folio MobileShell.BaseItem { diff --git a/containments/homescreens/folio/package/contents/ui/HomeScreen.qml b/containments/homescreens/folio/package/contents/ui/HomeScreen.qml index ab6b54e5..ee110ffc 100644 --- a/containments/homescreens/folio/package/contents/ui/HomeScreen.qml +++ b/containments/homescreens/folio/package/contents/ui/HomeScreen.qml @@ -11,7 +11,7 @@ import org.kde.kirigami 2.20 as Kirigami import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.components 3.0 as PC3 -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.private.mobile.homescreen.folio 1.0 as Folio import "./delegate" diff --git a/containments/homescreens/folio/package/contents/ui/HomeScreenPage.qml b/containments/homescreens/folio/package/contents/ui/HomeScreenPage.qml index ee0dd450..0c5c9de0 100644 --- a/containments/homescreens/folio/package/contents/ui/HomeScreenPage.qml +++ b/containments/homescreens/folio/package/contents/ui/HomeScreenPage.qml @@ -5,8 +5,8 @@ import QtQuick import QtQuick.Window import QtQuick.Layouts -import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell.state as MobileShellState +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.private.mobile.homescreen.folio 1.0 as Folio import org.kde.kirigami 2.10 as Kirigami diff --git a/containments/homescreens/folio/package/contents/ui/delegate/AbstractDelegate.qml b/containments/homescreens/folio/package/contents/ui/delegate/AbstractDelegate.qml index 6863139c..7accf78d 100644 --- a/containments/homescreens/folio/package/contents/ui/delegate/AbstractDelegate.qml +++ b/containments/homescreens/folio/package/contents/ui/delegate/AbstractDelegate.qml @@ -14,7 +14,7 @@ import org.kde.kquickcontrolsaddons 2.0 import org.kde.private.mobile.homescreen.folio 1.0 as Folio import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell Folio.DelegateTouchArea { id: delegate diff --git a/containments/homescreens/folio/package/contents/ui/delegate/AppDelegate.qml b/containments/homescreens/folio/package/contents/ui/delegate/AppDelegate.qml index 7495b2da..d02d5d94 100644 --- a/containments/homescreens/folio/package/contents/ui/delegate/AppDelegate.qml +++ b/containments/homescreens/folio/package/contents/ui/delegate/AppDelegate.qml @@ -9,8 +9,8 @@ import QtQuick.Effects import org.kde.kirigami 2.20 as Kirigami import org.kde.private.mobile.homescreen.folio 1.0 as Folio -import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell.state as MobileShellState +import org.kde.plasma.private.mobileshell as MobileShell AbstractDelegate { id: root diff --git a/containments/homescreens/folio/package/contents/ui/main.qml b/containments/homescreens/folio/package/contents/ui/main.qml index 46304903..dc777b2d 100644 --- a/containments/homescreens/folio/package/contents/ui/main.qml +++ b/containments/homescreens/folio/package/contents/ui/main.qml @@ -10,8 +10,8 @@ import org.kde.kirigami 2.20 as Kirigami import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.components 3.0 as PlasmaComponents -import org.kde.plasma.private.mobileshell 1.0 as MobileShell -import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState +import org.kde.plasma.private.mobileshell as MobileShell +import org.kde.plasma.private.mobileshell.state as MobileShellState import org.kde.private.mobile.homescreen.folio 1.0 as Folio import org.kde.plasma.private.mobileshell.windowplugin as WindowPlugin diff --git a/containments/homescreens/folio/package/contents/ui/settings/SettingsComponent.qml b/containments/homescreens/folio/package/contents/ui/settings/SettingsComponent.qml index 492b350b..4084c10e 100644 --- a/containments/homescreens/folio/package/contents/ui/settings/SettingsComponent.qml +++ b/containments/homescreens/folio/package/contents/ui/settings/SettingsComponent.qml @@ -9,7 +9,7 @@ import QtQuick.Controls as QQC2 import org.kde.kirigami 2.20 as Kirigami import org.kde.plasma.components 3.0 as PC3 -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.private.mobile.homescreen.folio 1.0 as Folio import '../delegate' diff --git a/containments/homescreens/halcyon/package/contents/ui/FavoritesAppDelegate.qml b/containments/homescreens/halcyon/package/contents/ui/FavoritesAppDelegate.qml index 3224e7c5..b3433344 100644 --- a/containments/homescreens/halcyon/package/contents/ui/FavoritesAppDelegate.qml +++ b/containments/homescreens/halcyon/package/contents/ui/FavoritesAppDelegate.qml @@ -11,9 +11,9 @@ import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.kquickcontrolsaddons 2.0 import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings -import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState +import org.kde.plasma.private.mobileshell.state as MobileShellState import org.kde.kirigami 2.19 as Kirigami diff --git a/containments/homescreens/halcyon/package/contents/ui/FavoritesView.qml b/containments/homescreens/halcyon/package/contents/ui/FavoritesView.qml index 2758326b..22256cff 100644 --- a/containments/homescreens/halcyon/package/contents/ui/FavoritesView.qml +++ b/containments/homescreens/halcyon/package/contents/ui/FavoritesView.qml @@ -10,7 +10,7 @@ import org.kde.plasma.components 3.0 as PC3 import org.kde.draganddrop 2.0 as DragDrop import org.kde.kirigami 2.19 as Kirigami -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings Item { diff --git a/containments/homescreens/halcyon/package/contents/ui/GridAppList.qml b/containments/homescreens/halcyon/package/contents/ui/GridAppList.qml index e99bd78c..651ff2bd 100644 --- a/containments/homescreens/halcyon/package/contents/ui/GridAppList.qml +++ b/containments/homescreens/halcyon/package/contents/ui/GridAppList.qml @@ -10,8 +10,8 @@ import QtQuick.Controls 2.15 as Controls import org.kde.plasma.components 3.0 as PC3 import org.kde.kirigami 2.10 as Kirigami -import org.kde.plasma.private.mobileshell 1.0 as MobileShell -import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState +import org.kde.plasma.private.mobileshell as MobileShell +import org.kde.plasma.private.mobileshell.state as MobileShellState import org.kde.private.mobile.homescreen.halcyon 1.0 as Halcyon MobileShell.GridView { diff --git a/initialstart/modules/cellular/package/contents/ui/EditProfileDialog.qml b/initialstart/modules/cellular/package/contents/ui/EditProfileDialog.qml index 4d920601..ae366bd4 100644 --- a/initialstart/modules/cellular/package/contents/ui/EditProfileDialog.qml +++ b/initialstart/modules/cellular/package/contents/ui/EditProfileDialog.qml @@ -7,7 +7,7 @@ import QtQuick.Controls 2.12 as Controls import org.kde.kirigami 2.19 as Kirigami -import org.kde.plasma.mm 1.0 as PlasmaMM +import org.kde.plasma.mm as PlasmaMM Kirigami.Dialog { id: dialog diff --git a/initialstart/modules/cellular/package/contents/ui/main.qml b/initialstart/modules/cellular/package/contents/ui/main.qml index ea174e61..29d1aca5 100644 --- a/initialstart/modules/cellular/package/contents/ui/main.qml +++ b/initialstart/modules/cellular/package/contents/ui/main.qml @@ -7,7 +7,7 @@ import QtQuick.Layouts import org.kde.kirigami as Kirigami import org.kde.kirigamiaddons.formcard 1 as FormCard -import org.kde.plasma.mm 1 as PlasmaMM +import org.kde.plasma.mm as PlasmaMM Item { id: root diff --git a/initialstart/qml/Wizard.qml b/initialstart/qml/Wizard.qml index 0b92d0f8..6ace5131 100644 --- a/initialstart/qml/Wizard.qml +++ b/initialstart/qml/Wizard.qml @@ -6,7 +6,7 @@ import QtQuick.Controls 2.15 import QtQuick.Layouts 1.15 import org.kde.kirigami 2.20 as Kirigami -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell import initialstart 1.0 as InitialStart diff --git a/lookandfeel/contents/lockscreen/Clock.qml b/lookandfeel/contents/lockscreen/Clock.qml index e93f6844..678424bb 100644 --- a/lookandfeel/contents/lockscreen/Clock.qml +++ b/lookandfeel/contents/lockscreen/Clock.qml @@ -11,7 +11,7 @@ import QtQuick.Controls 2.15 import org.kde.kirigami 2.20 as Kirigami import org.kde.plasma.plasma5support 2.0 as P5Support import org.kde.plasma.components 3.0 as PC3 -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell Item { id: root diff --git a/lookandfeel/contents/lockscreen/HeaderComponent.qml b/lookandfeel/contents/lockscreen/HeaderComponent.qml index 1ae742d7..5df3a79c 100644 --- a/lookandfeel/contents/lockscreen/HeaderComponent.qml +++ b/lookandfeel/contents/lockscreen/HeaderComponent.qml @@ -8,7 +8,7 @@ import QtQuick.Controls 2.15 import QtQuick.Layouts 1.1 import org.kde.kirigami as Kirigami -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.notificationmanager as NotificationManager diff --git a/lookandfeel/contents/lockscreen/Keypad.qml b/lookandfeel/contents/lockscreen/Keypad.qml index 3a3ac17b..893026c7 100644 --- a/lookandfeel/contents/lockscreen/Keypad.qml +++ b/lookandfeel/contents/lockscreen/Keypad.qml @@ -9,7 +9,7 @@ import QtQuick.Effects import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.core as PlasmaCore import org.kde.plasma.workspace.keyboardlayout 1.0 -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.kirigami 2.12 as Kirigami diff --git a/lookandfeel/contents/lockscreen/LockScreenNarrowContent.qml b/lookandfeel/contents/lockscreen/LockScreenNarrowContent.qml index 7274a90e..7d248cf7 100644 --- a/lookandfeel/contents/lockscreen/LockScreenNarrowContent.qml +++ b/lookandfeel/contents/lockscreen/LockScreenNarrowContent.qml @@ -8,7 +8,7 @@ import QtQuick.Effects import org.kde.kirigami 2.20 as Kirigami import org.kde.plasma.workspace.keyboardlayout 1.0 import org.kde.notificationmanager as Notifications -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell Loader { id: root diff --git a/lookandfeel/contents/lockscreen/LockScreenWideScreenContent.qml b/lookandfeel/contents/lockscreen/LockScreenWideScreenContent.qml index 61114250..df50d083 100644 --- a/lookandfeel/contents/lockscreen/LockScreenWideScreenContent.qml +++ b/lookandfeel/contents/lockscreen/LockScreenWideScreenContent.qml @@ -8,7 +8,7 @@ import QtQuick.Effects import org.kde.kirigami 2.20 as Kirigami import org.kde.plasma.workspace.keyboardlayout 1.0 import org.kde.notificationmanager as Notifications -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell Loader { id: root diff --git a/lookandfeel/contents/lockscreen/NotificationsComponent.qml b/lookandfeel/contents/lockscreen/NotificationsComponent.qml index 6dcd382f..7e900058 100644 --- a/lookandfeel/contents/lockscreen/NotificationsComponent.qml +++ b/lookandfeel/contents/lockscreen/NotificationsComponent.qml @@ -4,7 +4,7 @@ import QtQuick import QtQuick.Layouts -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.kirigami as Kirigami import org.kde.notificationmanager as NotificationManager diff --git a/quicksettings/battery/contents/ui/main.qml b/quicksettings/battery/contents/ui/main.qml index 533a41fa..66af8f03 100644 --- a/quicksettings/battery/contents/ui/main.qml +++ b/quicksettings/battery/contents/ui/main.qml @@ -4,7 +4,7 @@ import QtQuick 2.15 import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell QS.QuickSetting { text: i18n("Battery") diff --git a/quicksettings/keyboardtoggle/contents/ui/main.qml b/quicksettings/keyboardtoggle/contents/ui/main.qml index db752e4a..db80b332 100644 --- a/quicksettings/keyboardtoggle/contents/ui/main.qml +++ b/quicksettings/keyboardtoggle/contents/ui/main.qml @@ -5,7 +5,7 @@ */ import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.workspace.keyboardlayout 1.0 as Keyboards QS.QuickSetting { diff --git a/quicksettings/mobiledata/contents/ui/main.qml b/quicksettings/mobiledata/contents/ui/main.qml index 6bf443db..cc660a79 100644 --- a/quicksettings/mobiledata/contents/ui/main.qml +++ b/quicksettings/mobiledata/contents/ui/main.qml @@ -3,8 +3,8 @@ import QtQuick 2.15 -import org.kde.plasma.mm 1.0 as PlasmaMM -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.mm as PlasmaMM +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS QS.QuickSetting { diff --git a/quicksettings/record/package/contents/ui/main.qml b/quicksettings/record/package/contents/ui/main.qml index adec4ec4..f7a1e7bc 100644 --- a/quicksettings/record/package/contents/ui/main.qml +++ b/quicksettings/record/package/contents/ui/main.qml @@ -4,7 +4,7 @@ import QtQuick 2.15 import QtQuick.Window 2.15 -import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState +import org.kde.plasma.private.mobileshell.state as MobileShellState import org.kde.pipewire.record 0.1 as PWRec import org.kde.taskmanager 0.1 as TaskManager import org.kde.plasma.quicksetting.record 1.0 diff --git a/tests/ActionDrawerTest.qml b/tests/ActionDrawerTest.qml index aa61b4ce..6f7b8ed1 100644 --- a/tests/ActionDrawerTest.qml +++ b/tests/ActionDrawerTest.qml @@ -10,7 +10,7 @@ import QtQuick.Controls 2.15 import org.kde.kirigami 2.20 as Kirigami import org.kde.plasma.components 3.0 as PC3 -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell import org.kde.notificationmanager as NotificationManager diff --git a/tests/LockScreenTest.qml b/tests/LockScreenTest.qml index befe2327..d734f96d 100644 --- a/tests/LockScreenTest.qml +++ b/tests/LockScreenTest.qml @@ -5,7 +5,7 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import org.kde.plasma.components 3.0 as PC3 -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell as MobileShell import "../lookandfeel/contents/lockscreen" as LockScreen