From a681593edaa9c2a4afd8387b5464b0866eb295cc Mon Sep 17 00:00:00 2001 From: purian23 Date: Sat, 26 Jul 2025 22:13:09 -0400 Subject: [PATCH] Address active warnings --- Modals/ClipboardHistoryModal.qml | 2 +- Modules/Notifications/Center/NotificationCard.qml | 4 ++-- Modules/Notifications/Popup/NotificationPopup.qml | 2 +- Modules/Notifications/Popup/NotificationPopupManager.qml | 2 +- Services/NotificationService.qml | 7 +++++-- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Modals/ClipboardHistoryModal.qml b/Modals/ClipboardHistoryModal.qml index 1d3f8c68..d50006b5 100644 --- a/Modals/ClipboardHistoryModal.qml +++ b/Modals/ClipboardHistoryModal.qml @@ -341,7 +341,7 @@ DankModal { anchors.margins: Theme.spacingL spacing: Theme.spacingL - Row { + Item { width: parent.width height: 40 diff --git a/Modules/Notifications/Center/NotificationCard.qml b/Modules/Notifications/Center/NotificationCard.qml index 546e7b2f..3724c294 100644 --- a/Modules/Notifications/Center/NotificationCard.qml +++ b/Modules/Notifications/Center/NotificationCard.qml @@ -191,7 +191,7 @@ Rectangle { wrapMode: Text.WordWrap visible: text.length > 0 linkColor: Theme.primary - onLinkActivated: Qt.openUrlExternally(link) + onLinkActivated: (link) => Qt.openUrlExternally(link) MouseArea { anchors.fill: parent @@ -412,7 +412,7 @@ Rectangle { wrapMode: Text.WordWrap visible: text.length > 0 linkColor: Theme.primary - onLinkActivated: Qt.openUrlExternally(link) + onLinkActivated: (link) => Qt.openUrlExternally(link) MouseArea { anchors.fill: parent cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : diff --git a/Modules/Notifications/Popup/NotificationPopup.qml b/Modules/Notifications/Popup/NotificationPopup.qml index 770b59b4..73b605df 100644 --- a/Modules/Notifications/Popup/NotificationPopup.qml +++ b/Modules/Notifications/Popup/NotificationPopup.qml @@ -255,7 +255,7 @@ PanelWindow { wrapMode: Text.WordWrap visible: text.length > 0 linkColor: Theme.primary - onLinkActivated: Qt.openUrlExternally(link) + onLinkActivated: (link) => Qt.openUrlExternally(link) MouseArea { anchors.fill: parent acceptedButtons: Qt.NoButton diff --git a/Modules/Notifications/Popup/NotificationPopupManager.qml b/Modules/Notifications/Popup/NotificationPopupManager.qml index b168e766..65afb604 100644 --- a/Modules/Notifications/Popup/NotificationPopupManager.qml +++ b/Modules/Notifications/Popup/NotificationPopupManager.qml @@ -51,7 +51,7 @@ QtObject { function _sync(newWrappers) { // Add new notifications for (let w of newWrappers) { - if (!_hasWindowFor(w)) { + if (w && !_hasWindowFor(w)) { insertNewestAtTop(w); } } diff --git a/Services/NotificationService.qml b/Services/NotificationService.qml index 07efe899..184ce1d9 100644 --- a/Services/NotificationService.qml +++ b/Services/NotificationService.qml @@ -204,6 +204,7 @@ Singleton { } function dismissNotification(wrapper) { + if (!wrapper || !wrapper.notification) return; wrapper.popup = false; wrapper.notification.dismiss(); } @@ -369,11 +370,13 @@ Singleton { const group = groupedNotifications.find(g => g.key === groupKey); if (group) { for (const notif of group.notifications) { - notif.notification.dismiss(); + if (notif && notif.notification) { + notif.notification.dismiss(); + } } } else { for (const notif of allWrappers) { - if (getGroupKey(notif) === groupKey) { + if (notif && notif.notification && getGroupKey(notif) === groupKey) { notif.notification.dismiss(); } }