diff --git a/dataengines/notifications/notificationsengine.cpp b/dataengines/notifications/notificationsengine.cpp index 6c7e286fa..2bc4dc25e 100644 --- a/dataengines/notifications/notificationsengine.cpp +++ b/dataengines/notifications/notificationsengine.cpp @@ -193,10 +193,9 @@ uint NotificationsEngine::Notify(const QString &app_name, uint replaces_id, // group notifications that have the same title coming from the same app // or if they are on the "blacklist", honor the skipGrouping hint sent - if (m_activeNotifications.values().contains(app_name + summary) && !skipGrouping && !m_alwaysReplaceAppsList.contains(app_name)) { + if (!replaces_id && m_activeNotifications.values().contains(app_name + summary) && !skipGrouping && !m_alwaysReplaceAppsList.contains(app_name)) { // cut off the "notification " from the source name partOf = m_activeNotifications.key(app_name + summary).midRef(13).toUInt(); - } qDebug() << "Currrent active notifications:" << m_activeNotifications; diff --git a/klipper/CMakeLists.txt b/klipper/CMakeLists.txt index d152d0f80..d9538fd25 100644 --- a/klipper/CMakeLists.txt +++ b/klipper/CMakeLists.txt @@ -82,6 +82,7 @@ target_link_libraries(plasma_engine_clipboard KF5::IconThemes KF5::KIOWidgets # PreviewJob KF5::Plasma + KF5::Notifications KF5::Service KF5::TextWidgets # KTextEdit KF5::WidgetsAddons # KMessageBox diff --git a/klipper/klipper.cpp b/klipper/klipper.cpp index 79060d81f..8de19fb0f 100644 --- a/klipper/klipper.cpp +++ b/klipper/klipper.cpp @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -227,6 +228,17 @@ Klipper::Klipper(QObject* parent, const KSharedConfigPtr& config, KlipperMode mo if (m_mode == KlipperMode::Standalone) { connect(qApp, &QGuiApplication::commitDataRequest, this, &Klipper::saveSession); } + + connect(this, &Klipper::passivePopup, this, + [this] (const QString &caption, const QString &text) { + if (m_notification) { + m_notification->setTitle(caption); + m_notification->setText(text); + } else { + m_notification = KNotification::event(KNotification::Notification, caption, text, QStringLiteral("klipper")); + } + } + ); } Klipper::~Klipper() diff --git a/klipper/klipper.h b/klipper/klipper.h index f6e5da6b5..99c71f339 100644 --- a/klipper/klipper.h +++ b/klipper/klipper.h @@ -26,6 +26,7 @@ #include #include #include +#include #include "urlgrabber.h" @@ -39,6 +40,7 @@ class QAction; class QMenu; class QMimeData; class HistoryItem; +class KNotification; enum class KlipperMode { Standalone, @@ -207,6 +209,7 @@ private: KActionCollection* m_collection; KlipperMode m_mode; QTimer *m_saveFileTimer = nullptr; + QPointer m_notification; }; #endif diff --git a/klipper/tray.cpp b/klipper/tray.cpp index 48a96616d..75fbe7fc0 100644 --- a/klipper/tray.cpp +++ b/klipper/tray.cpp @@ -23,7 +23,6 @@ #include "tray.h" #include -#include #include "klipper.h" #include "history.h" @@ -46,7 +45,6 @@ KlipperTray::KlipperTray() setAssociatedWidget( m_klipper->popup() ); connect( m_klipper->history(), &History::changed, this, &KlipperTray::slotSetToolTipFromHistory); slotSetToolTipFromHistory(); - connect(m_klipper, &Klipper::passivePopup, this, &KlipperTray::slotPassivePopup); } void KlipperTray::slotSetToolTipFromHistory() @@ -64,15 +62,4 @@ void KlipperTray::slotSetToolTipFromHistory() } } -void KlipperTray::slotPassivePopup(const QString& caption, const QString& text) -{ - if (m_notification) { - m_notification->setTitle(caption); - m_notification->setText(text); - } else { - m_notification = KNotification::event(KNotification::Notification, caption, text, - QIcon::fromTheme(QStringLiteral("klipper")).pixmap(QSize(16, 16))); - } -} - diff --git a/klipper/tray.h b/klipper/tray.h index 388674c87..d4b071625 100644 --- a/klipper/tray.h +++ b/klipper/tray.h @@ -20,11 +20,8 @@ #ifndef TRAY_H #define TRAY_H -#include - #include -class KNotification; class Klipper; class KlipperTray : public KStatusNotifierItem @@ -36,11 +33,9 @@ public: public Q_SLOTS: void slotSetToolTipFromHistory(); - void slotPassivePopup(const QString& caption, const QString& text); private: Klipper* m_klipper; - QPointer m_notification; }; #endif diff --git a/templates/ion-dataengine/ion-dataengine.kdevtemplate b/templates/ion-dataengine/ion-dataengine.kdevtemplate index 3485a8f52..739bb21d3 100644 --- a/templates/ion-dataengine/ion-dataengine.kdevtemplate +++ b/templates/ion-dataengine/ion-dataengine.kdevtemplate @@ -13,6 +13,7 @@ Name[sv]=Plasma-datagränssnitt för väderjon Name[uk]=Рушій даних прогнозу погоди Плазми Ion Name[x-test]=xxPlasma Weather Ion Dataenginexx Name[zh_CN]=Plasma 天气离子数据引擎 +Name[zh_TW]=Plasma 天氣 Ion 資料引擎 Comment=A special Plasma sub-dataengine for the Plasma Weather dataengine, providing access to one weather data service provider Comment[ca]=Un submotor de dades especial del Plasma pel motor de dades meteorològiques del Plasma Weather, que proporciona accés a un proveïdor del servei de dades meteorològiques Comment[ca@valencia]=Un submotor de dades especial del Plasma pel motor de dades meteorològiques del Plasma Weather, que proporciona accés a un proveïdor del servei de dades meteorològiques @@ -26,5 +27,6 @@ Comment[sv]=Ett särskilt undergränssnitt för Plasmas datagränssnitt för vä Comment[uk]=Спеціалізований допоміжний рушій даних Плазми для рушія даних прогнозу погоди, який надає доступ до даних одного з надавачів даних прогнозу погоди Comment[x-test]=xxA special Plasma sub-dataengine for the Plasma Weather dataengine, providing access to one weather data service providerxx Comment[zh_CN]=一个特殊的 Plasma 子数据引擎,用于辅助 Plasma 天气数据引擎,提供了对一个天气数据服务提供商的访问功能 +Comment[zh_TW]=一個專為 Plasma 天氣資料引擎所設計的 Plasma 子資料引擎,提供存取一個天氣資料服務提供者的能力 ShowFilesAfterGeneration=%{PROJECTDIR}/src/ion-%{APPNAMELC}.cpp Category=Plasma/Dataengine