diff --git a/components/mobileshell/qml/actiondrawer/private/NotificationDrawer.qml b/components/mobileshell/qml/actiondrawer/private/NotificationDrawer.qml index 3ef7da83..6407a618 100644 --- a/components/mobileshell/qml/actiondrawer/private/NotificationDrawer.qml +++ b/components/mobileshell/qml/actiondrawer/private/NotificationDrawer.qml @@ -8,7 +8,7 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.1 -import org.kde.plasma.plasma5support 2.0 as P5Support +import org.kde.plasma.clock import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.private.mobileshell as MobileShell import org.kde.kirigami 2.20 as Kirigami @@ -34,11 +34,8 @@ Item { height: Math.min(actionDrawer.height - toolButtons.height, notificationWidget.listView.contentHeight + 10 + topMargin) // time source for the time and date whenin landscape mode - P5Support.DataSource { - id: timeSource - engine: "time" - connectedSources: ["Local"] - interval: 60 * 1000 + Clock { + id: clockSource } MobileShell.VelocityCalculator { @@ -167,7 +164,7 @@ Item { PlasmaComponents.Label { id: clock - text: Qt.formatTime(timeSource.data.Local.DateTime, MobileShell.ShellUtil.isSystem24HourFormat ? "h:mm" : "h:mm ap") + text: Qt.formatTime(clockSource.dateTime, MobileShell.ShellUtil.isSystem24HourFormat ? "h:mm" : "h:mm ap") verticalAlignment: Qt.AlignVCenter anchors { @@ -183,7 +180,7 @@ Item { PlasmaComponents.Label { id: date - text: Qt.formatDate(timeSource.data.Local.DateTime, "ddd MMMM d") + text: Qt.formatDate(clockSource.dateTime, "ddd MMMM d") verticalAlignment: Qt.AlignTop color: Kirigami.Theme.disabledTextColor diff --git a/components/mobileshell/qml/popups/notifications/NotificationPopup.qml b/components/mobileshell/qml/popups/notifications/NotificationPopup.qml index 0eb8c58c..fe0fd6e7 100644 --- a/components/mobileshell/qml/popups/notifications/NotificationPopup.qml +++ b/components/mobileshell/qml/popups/notifications/NotificationPopup.qml @@ -16,7 +16,7 @@ import org.kde.plasma.private.mobileshell.state as MobileShellState import org.kde.layershell 1.0 as LayerShell import org.kde.notificationmanager as NotificationManager -import org.kde.plasma.plasma5support 2.0 as P5Support +import org.kde.plasma.clock Item { id: notificationPopup @@ -323,7 +323,7 @@ Item { modelIndex: notificationPopup.popupIndex notificationsModel: notificationPopup.notificationsModel notificationsModelType: notificationPopup.notificationsModelType - timeSource: notificationPopup.timeDataSource + clockSource: notificationPopup.timeDataSource panelType: notificationPopup.popupDrawerOpened ? MobileShell.PanelBackground.PanelType.Drawer : MobileShell.PanelBackground.PanelType.Popup diff --git a/components/mobileshell/qml/popups/notifications/NotificationPopupManager.qml b/components/mobileshell/qml/popups/notifications/NotificationPopupManager.qml index 52f25524..99a9e3c3 100644 --- a/components/mobileshell/qml/popups/notifications/NotificationPopupManager.qml +++ b/components/mobileshell/qml/popups/notifications/NotificationPopupManager.qml @@ -15,7 +15,7 @@ import org.kde.plasma.private.mobileshell.state as MobileShellState import org.kde.layershell 1.0 as LayerShell import org.kde.notificationmanager as NotificationManager -import org.kde.plasma.plasma5support 2.0 as P5Support +import org.kde.plasma.clock import QtQuick.Controls as Controls import org.kde.plasma.components 3.0 as PlasmaComponents @@ -46,7 +46,7 @@ Window { property QtObject notificationSettings property QtObject popupNotificationsModel property QtObject tasksModel - property QtObject timeSource + property Clock clockSource property bool inhibited Kirigami.Theme.colorSet: Kirigami.Theme.Complementary @@ -209,7 +209,7 @@ Window { popupModel: model notificationsModel: popupNotificationsModel notificationsModelType: notificationModelType - timeDataSource: timeSource + timeDataSource: clockSource timeout: model.timeout diff --git a/components/mobileshell/qml/popups/notifications/NotificationPopupProvider.qml b/components/mobileshell/qml/popups/notifications/NotificationPopupProvider.qml index e033550f..1c32757a 100644 --- a/components/mobileshell/qml/popups/notifications/NotificationPopupProvider.qml +++ b/components/mobileshell/qml/popups/notifications/NotificationPopupProvider.qml @@ -12,7 +12,7 @@ import org.kde.plasma.private.mobileshell.state as MobileShellState import org.kde.plasma.private.mobileshell as MobileShell import org.kde.notificationmanager as NotificationManager -import org.kde.plasma.plasma5support 2.0 as P5Support +import org.kde.plasma.clock import org.kde.taskmanager 0.1 as TaskManager @@ -126,13 +126,9 @@ QtObject { groupInline: false } - - property QtObject timeSource: P5Support.DataSource { - engine: "time" - connectedSources: ["Local"] - interval: 60000 // 1 min - intervalAlignment: P5Support.Types.AlignToMinute - onDataChanged: { + property Clock clockSource: Clock { + id: clockSource + onTimeChanged: { checkInhibition(); npm.timeChanged(); } @@ -142,7 +138,7 @@ QtObject { notificationModelType: notificationProvider.notificationModelType notificationSettings: notificationProvider.notificationSettings popupNotificationsModel: notificationProvider.popupNotificationsModel - timeSource: notificationProvider.timeSource + clockSource: notificationProvider.clockSource inhibited: notificationProvider.inhibited tasksModel: notificationProvider.tasksModel } diff --git a/components/mobileshell/qml/statusbar/ClockText.qml b/components/mobileshell/qml/statusbar/ClockText.qml index 11f3cc7a..45ca3dcd 100644 --- a/components/mobileshell/qml/statusbar/ClockText.qml +++ b/components/mobileshell/qml/statusbar/ClockText.qml @@ -8,7 +8,7 @@ import QtQuick 2.12 import QtQuick.Layouts 1.15 -import org.kde.plasma.plasma5support 2.0 as P5Support +import org.kde.plasma.clock import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings @@ -19,14 +19,14 @@ RowLayout { id: clockText required property int fontPixelSize - required property P5Support.DataSource source + required property Clock clockSource PlasmaComponents.Label { id: clock property bool is24HourTime: MobileShell.ShellUtil.isSystem24HourFormat - text: Qt.formatTime(source.data.Local.DateTime, is24HourTime ? "h:mm" : "h:mm ap") + text: Qt.formatTime(clockSource.dateTime, is24HourTime ? "h:mm" : "h:mm ap") color: Kirigami.Theme.textColor verticalAlignment: Qt.AlignVCenter font.pixelSize: fontPixelSize @@ -36,7 +36,7 @@ RowLayout { id: date visible: ShellSettings.Settings.dateInStatusBar && !root.showSecondRow - text: Qt.formatDate(source.data.Local.DateTime, "ddd. MMMM d") + text: Qt.formatDate(clockSource.dateTime, "ddd. MMMM d") color: Kirigami.Theme.textColor verticalAlignment: Qt.AlignVCenter font.pixelSize: fontPixelSize diff --git a/components/mobileshell/qml/statusbar/StatusBar.qml b/components/mobileshell/qml/statusbar/StatusBar.qml index 0d6d1fae..0162fc5b 100644 --- a/components/mobileshell/qml/statusbar/StatusBar.qml +++ b/components/mobileshell/qml/statusbar/StatusBar.qml @@ -15,7 +15,7 @@ import QtQml.Models import org.kde.kirigami as Kirigami import org.kde.plasma.core as PlasmaCore -import org.kde.plasma.plasma5support 2.0 as P5Support +import org.kde.plasma.clock import org.kde.plasma.private.systemtray as SystemTray import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.kitemmodels as KItemModels @@ -55,12 +55,8 @@ Item { readonly property real smallerTextPixelSize: Math.round(9 * ShellSettings.Settings.statusBarScaleFactor) readonly property real elementSpacing: Math.round(Kirigami.Units.smallSpacing * 1.5) - P5Support.DataSource { - id: timeSource - engine: "time" - connectedSources: ["Local"] - interval: 1000 - intervalAlignment: P5Support.Types.AlignToMinute + Clock { + id: clockSource } property alias statusNotifierSource: statusNotifierSourceLoader.item @@ -120,7 +116,7 @@ Item { visible: root.showTime Layout.fillHeight: true fontPixelSize: textPixelSize - source: timeSource + clockSource: clockSource } MobileShell.SignalStrengthIndicator { @@ -190,7 +186,7 @@ Item { Layout.fillWidth: true PlasmaComponents.Label { - text: Qt.formatDate(timeSource.data.Local.DateTime, "ddd. MMMM d") + text: Qt.formatDate(clockSource.dateTime, "ddd. MMMM d") color: Kirigami.Theme.disabledTextColor font.pixelSize: root.smallerTextPixelSize } diff --git a/components/mobileshell/qml/widgets/notifications/BaseNotificationItem.qml b/components/mobileshell/qml/widgets/notifications/BaseNotificationItem.qml index bfc99eb2..13b68138 100644 --- a/components/mobileshell/qml/widgets/notifications/BaseNotificationItem.qml +++ b/components/mobileshell/qml/widgets/notifications/BaseNotificationItem.qml @@ -9,7 +9,7 @@ import QtQuick import QtQuick.Layouts import QtQuick.Window -import org.kde.plasma.plasma5support 2.0 as P5Support +import org.kde.plasma.clock import org.kde.plasma.components 3.0 as PlasmaComponents3 import org.kde.notificationmanager as NotificationManager @@ -35,7 +35,7 @@ Item { property var model property int modelIndex - property P5Support.DataSource timeSource + property Clock clockSource readonly property int notificationType: model.type diff --git a/components/mobileshell/qml/widgets/notifications/NotificationGroupHeader.qml b/components/mobileshell/qml/widgets/notifications/NotificationGroupHeader.qml index 4ba45faf..895e654e 100644 --- a/components/mobileshell/qml/widgets/notifications/NotificationGroupHeader.qml +++ b/components/mobileshell/qml/widgets/notifications/NotificationGroupHeader.qml @@ -12,7 +12,6 @@ import QtQuick.Window 2.2 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 diff --git a/components/mobileshell/qml/widgets/notifications/NotificationItem.qml b/components/mobileshell/qml/widgets/notifications/NotificationItem.qml index 6ee722c7..09ef1677 100644 --- a/components/mobileshell/qml/widgets/notifications/NotificationItem.qml +++ b/components/mobileshell/qml/widgets/notifications/NotificationItem.qml @@ -101,7 +101,7 @@ BaseNotificationItem { jobDetails: notificationItem.jobDetails time: notificationItem.time - timeSource: notificationItem.timeSource + clockSource: notificationItem.clockSource } } diff --git a/components/mobileshell/qml/widgets/notifications/NotificationPopupItem.qml b/components/mobileshell/qml/widgets/notifications/NotificationPopupItem.qml index 64fe94c3..af8e194a 100644 --- a/components/mobileshell/qml/widgets/notifications/NotificationPopupItem.qml +++ b/components/mobileshell/qml/widgets/notifications/NotificationPopupItem.qml @@ -113,7 +113,7 @@ BaseNotificationItem { jobDetails: notificationItem.jobDetails time: notificationItem.time - timeSource: notificationItem.timeSource + clockSource: notificationItem.clockSource } } diff --git a/components/mobileshell/qml/widgets/notifications/NotificationTimeText.qml b/components/mobileshell/qml/widgets/notifications/NotificationTimeText.qml index 4d8bf269..3a655ae0 100644 --- a/components/mobileshell/qml/widgets/notifications/NotificationTimeText.qml +++ b/components/mobileshell/qml/widgets/notifications/NotificationTimeText.qml @@ -10,7 +10,7 @@ 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.clock import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.kirigami as Kirigami @@ -26,15 +26,15 @@ PlasmaComponents.Label { property QtObject jobDetails property var time - property P5Support.DataSource timeSource + property Clock clockSource // notification created/updated time changed onTimeChanged: updateAgoText() Connections { - target: timeSource + target: clockSource // clock time changed - function onDataChanged() { + function timeChanged() { ageLabel.updateAgoText() } } diff --git a/components/mobileshell/qml/widgets/notifications/NotificationsWidget.qml b/components/mobileshell/qml/widgets/notifications/NotificationsWidget.qml index 80407e98..a58919ab 100644 --- a/components/mobileshell/qml/widgets/notifications/NotificationsWidget.qml +++ b/components/mobileshell/qml/widgets/notifications/NotificationsWidget.qml @@ -12,7 +12,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.clock 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 @@ -176,12 +176,8 @@ Item { } } - P5Support.DataSource { - id: timeDataSource - engine: "time" - connectedSources: ["Local"] - interval: 60000 // 1 min - intervalAlignment: P5Support.Types.AlignToMinute + Clock { + id: clockSource } ListView { @@ -386,7 +382,7 @@ Item { modelIndex: delegateLoader.index notificationsModel: root.historyModel notificationsModelType: root.historyModelType - timeSource: timeDataSource + clockSource: clockSource requestToInvoke: root.actionsRequireUnlock onRunActionRequested: {