Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package knotifications for openSUSE:Factory checked in at 2021-03-16 15:40:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/knotifications (Old) and /work/SRC/openSUSE:Factory/.knotifications.new.2401 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "knotifications" Tue Mar 16 15:40:57 2021 rev:90 rq:878825 version:5.80.0 Changes: -------- --- /work/SRC/openSUSE:Factory/knotifications/knotifications.changes 2021-02-17 18:12:25.477984027 +0100 +++ /work/SRC/openSUSE:Factory/.knotifications.new.2401/knotifications.changes 2021-03-16 15:42:13.008827124 +0100 @@ -1,0 +2,11 @@ +Sun Mar 7 09:27:04 UTC 2021 - Christophe Giboudeaux <[email protected]> + +- Update to 5.80.0 + * New feature release + * For more details please see: + * https://kde.org/announcements/frameworks/5/5.80.0 +- Changes since 5.79.0: + * Remove d-ptr from notifybypopup + * Don't attempt to strip markup from a KNotification's title + +------------------------------------------------------------------- Old: ---- knotifications-5.79.0.tar.xz knotifications-5.79.0.tar.xz.sig New: ---- knotifications-5.80.0.tar.xz knotifications-5.80.0.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ knotifications.spec ++++++ --- /var/tmp/diff_new_pack.3JwZXk/_old 2021-03-16 15:42:13.748828308 +0100 +++ /var/tmp/diff_new_pack.3JwZXk/_new 2021-03-16 15:42:13.748828308 +0100 @@ -17,14 +17,14 @@ %define lname libKF5Notifications5 -%define _tar_path 5.79 +%define _tar_path 5.80 # Full KF5 version (e.g. 5.33.0) %{!?_kf5_version: %global _kf5_version %{version}} # Last major and minor KF5 version (e.g. 5.33) %{!?_kf5_bugfix_version: %define _kf5_bugfix_version %(echo %{_kf5_version} | awk -F. '{print $1"."$2}')} %bcond_without lang Name: knotifications -Version: 5.79.0 +Version: 5.80.0 Release: 0 Summary: KDE Desktop notifications License: LGPL-2.1-or-later ++++++ knotifications-5.79.0.tar.xz -> knotifications-5.80.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.79.0/.gitignore new/knotifications-5.80.0/.gitignore --- old/knotifications-5.79.0/.gitignore 2021-02-06 19:21:40.000000000 +0100 +++ new/knotifications-5.80.0/.gitignore 2021-03-06 17:28:22.000000000 +0100 @@ -22,3 +22,4 @@ .vscode .cmake/ /.clang-format +/compile_commands.json diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.79.0/CMakeLists.txt new/knotifications-5.80.0/CMakeLists.txt --- old/knotifications-5.79.0/CMakeLists.txt 2021-02-06 19:21:40.000000000 +0100 +++ new/knotifications-5.80.0/CMakeLists.txt 2021-03-06 17:28:22.000000000 +0100 @@ -1,12 +1,12 @@ cmake_minimum_required(VERSION 3.5) -set(KF_VERSION "5.79.0") # handled by release scripts -set(KF_DEP_VERSION "5.79.0") # handled by release scripts +set(KF_VERSION "5.80.0") # handled by release scripts +set(KF_DEP_VERSION "5.80.0") # handled by release scripts project(KNotifications VERSION ${KF_VERSION}) # ECM setup include(FeatureSummary) -find_package(ECM 5.79.0 NO_MODULE) +find_package(ECM 5.80.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) @@ -126,7 +126,7 @@ if (NOT APPLE) # QtMac::setBadgeLabelText is deprecated add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050e00) endif() -add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054B00) +add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054F00) add_subdirectory(src) if (BUILD_TESTING) add_subdirectory(tests) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.79.0/po/id/knotifications5_qt.po new/knotifications-5.80.0/po/id/knotifications5_qt.po --- old/knotifications-5.79.0/po/id/knotifications5_qt.po 2021-02-06 19:21:40.000000000 +0100 +++ new/knotifications-5.80.0/po/id/knotifications5_qt.po 2021-03-06 17:28:22.000000000 +0100 @@ -2,14 +2,14 @@ # Copyright (C) 2010 This_file_is_part_of_KDE # This file is distributed under the same license as the kdelibs4 package. # Andhika Padmawan <[email protected]>, 2010-2014. -# Wantoyo <[email protected]>, 2018, 2019, 2020. +# Wantoyo <[email protected]>, 2018, 2019, 2020, 2021. # msgid "" msgstr "" "Project-Id-Version: kdelibs4\n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2014-03-23 01:50+0000\n" -"PO-Revision-Date: 2020-04-29 20:12+0700\n" +"PO-Revision-Date: 2021-02-10 10:52+0700\n" "Last-Translator: Wantoyo <[email protected]>\n" "Language-Team: Indonesian <[email protected]>\n" "Language: id\n" @@ -17,7 +17,7 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Lokalize 19.12.1\n" +"X-Generator: Lokalize 20.12.1\n" "X-Qt-Contexts: true\n" #. Job name, e.g. Copying has failed @@ -33,25 +33,16 @@ msgstr "Aplikasi Tak Diketahui" #: kstatusnotifieritem.cpp:532 kstatusnotifieritem.cpp:1111 -#, fuzzy -#| msgctxt "KStatusNotifierItem|" -#| msgid "&Minimize" msgctxt "KStatusNotifierItem|@action:inmenu" msgid "&Minimize" msgstr "&Minimalkan" #: kstatusnotifieritem.cpp:850 -#, fuzzy -#| msgctxt "KStatusNotifierItem|" -#| msgid "Quit" msgctxt "KStatusNotifierItem|@action:inmenu" msgid "Quit" msgstr "Berhenti" #: kstatusnotifieritem.cpp:1109 -#, fuzzy -#| msgctxt "KStatusNotifierItem|" -#| msgid "&Restore" msgctxt "KStatusNotifierItem|@action:inmenu" msgid "&Restore" msgstr "&Kembalikan" @@ -63,9 +54,6 @@ msgstr "<qt>Apakah kamu yakin ingin memberhentikan <b>%1</b>?</qt>" #: kstatusnotifieritem.cpp:1126 -#, fuzzy -#| msgctxt "KStatusNotifierItem|" -#| msgid "Confirm Quit From System Tray" msgctxt "KStatusNotifierItem|@title:window" msgid "Confirm Quit From System Tray" -msgstr "Konfirmasi Berhenti Dari Baki Sistem" +msgstr "Konfirmasi Berhenti Dari System Tray" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.79.0/po/sq/knotifications5_qt.po new/knotifications-5.80.0/po/sq/knotifications5_qt.po --- old/knotifications-5.79.0/po/sq/knotifications5_qt.po 2021-02-06 19:21:40.000000000 +0100 +++ new/knotifications-5.80.0/po/sq/knotifications5_qt.po 2021-03-06 17:28:22.000000000 +0100 @@ -1,67 +1,55 @@ -# Agron Selimaj <[email protected]>, 2012. +# Agron Selimaj <[email protected]>, 2012, 2021. msgid "" msgstr "" "Project-Id-Version: kde4libs\n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2014-03-23 01:50+0000\n" -"PO-Revision-Date: 2012-01-19 00:20-0500\n" +"PO-Revision-Date: 2021-02-26 22:41-0500\n" "Last-Translator: Agron Selimaj <[email protected]>\n" -"Language-Team: Albanian <[email protected]>\n" +"Language-Team: kdeshqip\n" "Language: sq\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Launchpad-Export-Date: 2010-11-24 03:19+0000\n" -"X-Generator: Lokalize 1.2\n" +"X-Generator: Lokalize 20.12.2\n" "X-Qt-Contexts: true\n" #. Job name, e.g. Copying has failed #: knotificationjobuidelegate.cpp:28 -#, fuzzy, qt-format -#| msgid "%1 (Link)" +#, qt-format msgctxt "KNotificationJobUiDelegate|" msgid "%1 (Failed)" -msgstr "%1 (Lidhje)" +msgstr "%1 (D??shtoi)" #: knotificationrestrictions.cpp:180 -#, fuzzy -#| msgid "Unknown Application" msgctxt "KNotificationRestrictions|" msgid "Unknown Application" msgstr "Program i Panjohur" #: kstatusnotifieritem.cpp:532 kstatusnotifieritem.cpp:1111 -#, fuzzy -#| msgid "&Minimize" msgctxt "KStatusNotifierItem|@action:inmenu" msgid "&Minimize" msgstr "&Minimizo" #: kstatusnotifieritem.cpp:850 -#, fuzzy -#| msgid "Quit" msgctxt "KStatusNotifierItem|@action:inmenu" msgid "Quit" msgstr "Dil" #: kstatusnotifieritem.cpp:1109 -#, fuzzy -#| msgid "&Restore" msgctxt "KStatusNotifierItem|@action:inmenu" msgid "&Restore" -msgstr "&Kthe" +msgstr "&Rivendose" #: kstatusnotifieritem.cpp:1123 -#, fuzzy, qt-format -#| msgid "<qt>Are you sure you want to quit <b>%1</b>?</qt>" +#, qt-format msgctxt "KStatusNotifierItem|" msgid "<qt>Are you sure you want to quit <b>%1</b>?</qt>" -msgstr "<qt>Jeni i sigurt?? q?? d??shironi t?? dilni <b>%1</b>?</qt>" +msgstr "<qt>Jeni t?? sigurt?? q?? d??shironi t?? dilni nga<b>%1</b>?</qt>" #: kstatusnotifieritem.cpp:1126 -#, fuzzy -#| msgid "Confirm Quit From System Tray" msgctxt "KStatusNotifierItem|@title:window" msgid "Confirm Quit From System Tray" msgstr "Konfirmo Daljen nga Shiriti i Sistemit" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.79.0/po/zh_CN/knotifications5_qt.po new/knotifications-5.80.0/po/zh_CN/knotifications5_qt.po --- old/knotifications-5.79.0/po/zh_CN/knotifications5_qt.po 2021-02-06 19:21:40.000000000 +0100 +++ new/knotifications-5.80.0/po/zh_CN/knotifications5_qt.po 2021-03-06 17:28:22.000000000 +0100 @@ -13,7 +13,7 @@ msgid "" msgstr "" "Project-Id-Version: kdeorg\n" -"PO-Revision-Date: 2021-02-04 11:58\n" +"PO-Revision-Date: 2021-03-02 16:17\n" "Language-Team: Chinese Simplified\n" "Language: zh_CN\n" "MIME-Version: 1.0\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.79.0/src/notifybyandroid.cpp new/knotifications-5.80.0/src/notifybyandroid.cpp --- old/knotifications-5.79.0/src/notifybyandroid.cpp 2021-02-06 19:21:40.000000000 +0100 +++ new/knotifications-5.80.0/src/notifybyandroid.cpp 2021-03-06 17:28:22.000000000 +0100 @@ -94,7 +94,7 @@ n.setField("id", notification->id()); n.setField("text", QAndroidJniObject::fromString(stripRichText(notification->text())).object<jstring>()); n.setField("richText", QAndroidJniObject::fromString(notification->text()).object<jstring>()); - n.setField("title", QAndroidJniObject::fromString(stripRichText(notification->title())).object<jstring>()); + n.setField("title", QAndroidJniObject::fromString(notification->title()).object<jstring>()); n.setField("urgency", (jint)(notification->urgency() == KNotification::DefaultUrgency ? KNotification::HighUrgency : notification->urgency())); n.setField("visibility", QAndroidJniObject::fromString(notification->hints().value(QLatin1String("x-kde-visibility")).toString().toLower()).object<jstring>()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.79.0/src/notifybypopup.cpp new/knotifications-5.80.0/src/notifybypopup.cpp --- old/knotifications-5.79.0/src/notifybypopup.cpp 2021-02-06 19:21:40.000000000 +0100 +++ new/knotifications-5.80.0/src/notifybypopup.cpp 2021-03-06 17:28:22.000000000 +0100 @@ -9,9 +9,7 @@ #include "notifybypopup.h" #include "imageconverter.h" -#include "knotifyconfig.h" #include "knotification.h" -#include "notifications_interface.h" #include "debug_p.h" #include <QBuffer> @@ -24,82 +22,15 @@ #include <KConfigGroup> -class NotifyByPopupPrivate { -public: - NotifyByPopupPrivate(NotifyByPopup *parent) - : dbusInterface(QStringLiteral("org.freedesktop.Notifications"), - QStringLiteral("/org/freedesktop/Notifications"), - QDBusConnection::sessionBus()) - , q(parent) {} - - /** - * Sends notification to DBus "org.freedesktop.notifications" interface. - * @param id knotify-sid identifier of notification - * @param config notification data - * @param update If true, will request the DBus service to update - the notification with new data from \c notification - * Otherwise will put new notification on screen - * @return true for success or false if there was an error. - */ - bool sendNotificationToServer(KNotification *notification, const KNotifyConfig &config, bool update = false); - - /** - * Find the caption and the icon name of the application - */ - void getAppCaptionAndIconName(const KNotifyConfig &config, QString *appCaption, QString *iconName); - /* - * Query the dbus server for notification capabilities - * If no DBus server is present, use fallback capabilities for KPassivePopup - */ - void queryPopupServerCapabilities(); - - /** - * DBus notification daemon capabilities cache. - * Do not use this variable. Use #popupServerCapabilities() instead. - * @see popupServerCapabilities - */ - QStringList popupServerCapabilities; - - /** - * In case we still don't know notification server capabilities, - * we need to query those first. That's done in an async way - * so we queue all notifications while waiting for the capabilities - * to return, then process them from this queue - */ - QList<QPair<KNotification*, KNotifyConfig> > notificationQueue; - /** - * Whether the DBus notification daemon capability cache is up-to-date. - */ - bool dbusServiceCapCacheDirty; - - /* - * As we communicate with the notification server over dbus - * we use only ids, this is for fast KNotifications lookup - */ - QHash<uint, QPointer<KNotification>> notifications; - - org::freedesktop::Notifications dbusInterface; - - NotifyByPopup * const q; -}; - -//--------------------------------------------------------------------------------------- - NotifyByPopup::NotifyByPopup(QObject *parent) - : KNotificationPlugin(parent), - d(new NotifyByPopupPrivate(this)) + : KNotificationPlugin(parent) + , m_dbusInterface(QStringLiteral("org.freedesktop.Notifications"), QStringLiteral("/org/freedesktop/Notifications"), QDBusConnection::sessionBus()) { - d->dbusServiceCapCacheDirty = true; + m_dbusServiceCapCacheDirty = true; - connect(&d->dbusInterface, &org::freedesktop::Notifications::ActionInvoked, this, &NotifyByPopup::onNotificationActionInvoked); + connect(&m_dbusInterface, &org::freedesktop::Notifications::ActionInvoked, this, &NotifyByPopup::onNotificationActionInvoked); - connect(&d->dbusInterface, &org::freedesktop::Notifications::NotificationClosed, this, &NotifyByPopup::onNotificationClosed); -} - - -NotifyByPopup::~NotifyByPopup() -{ - delete d; + connect(&m_dbusInterface, &org::freedesktop::Notifications::NotificationClosed, this, &NotifyByPopup::onNotificationClosed); } void NotifyByPopup::notify(KNotification *notification, KNotifyConfig *notifyConfig) @@ -109,14 +40,14 @@ void NotifyByPopup::notify(KNotification *notification, const KNotifyConfig ¬ifyConfig) { - if (d->dbusServiceCapCacheDirty) { + if (m_dbusServiceCapCacheDirty) { // if we don't have the server capabilities yet, we need to query for them first; // as that is an async dbus operation, we enqueue the notification and process them // when we receive dbus reply with the server capabilities - d->notificationQueue.append(qMakePair(notification, notifyConfig)); - d->queryPopupServerCapabilities(); + m_notificationQueue.append(qMakePair(notification, notifyConfig)); + queryPopupServerCapabilities(); } else { - if (!d->sendNotificationToServer(notification, notifyConfig)) { + if (!sendNotificationToServer(notification, notifyConfig)) { finish(notification); //an error occurred. } } @@ -129,12 +60,12 @@ void NotifyByPopup::update(KNotification *notification, const KNotifyConfig ¬ifyConfig) { - d->sendNotificationToServer(notification, notifyConfig, true); + sendNotificationToServer(notification, notifyConfig, true); } void NotifyByPopup::close(KNotification *notification) { - QMutableListIterator<QPair<KNotification*, KNotifyConfig> > iter(d->notificationQueue); + QMutableListIterator<QPair<KNotification*, KNotifyConfig> > iter(m_notificationQueue); while (iter.hasNext()) { auto &item = iter.next(); if (item.first == notification) { @@ -142,20 +73,20 @@ } } - uint id = d->notifications.key(notification, 0); + uint id = m_notifications.key(notification, 0); if (id == 0) { qCDebug(LOG_KNOTIFICATIONS) << "not found dbus id to close" << notification->id(); return; } - d->dbusInterface.CloseNotification(id); + m_dbusInterface.CloseNotification(id); } void NotifyByPopup::onNotificationActionInvoked(uint notificationId, const QString &actionKey) { - auto iter = d->notifications.find(notificationId); - if (iter == d->notifications.end()) { + auto iter = m_notifications.find(notificationId); + if (iter == m_notifications.end()) { return; } @@ -174,18 +105,18 @@ } } } else { - d->notifications.erase(iter); + m_notifications.erase(iter); } } void NotifyByPopup::onNotificationClosed(uint dbus_id, uint reason) { - auto iter = d->notifications.find(dbus_id); - if (iter == d->notifications.end()) { + auto iter = m_notifications.find(dbus_id); + if (iter == m_notifications.end()) { return; } KNotification *n = *iter; - d->notifications.remove(dbus_id); + m_notifications.remove(dbus_id); if (n) { Q_EMIT finished(n); @@ -200,7 +131,7 @@ } } -void NotifyByPopupPrivate::getAppCaptionAndIconName(const KNotifyConfig ¬ifyConfig, QString *appCaption, QString *iconName) +void NotifyByPopup::getAppCaptionAndIconName(const KNotifyConfig ¬ifyConfig, QString *appCaption, QString *iconName) { KConfigGroup globalgroup(&(*notifyConfig.eventsfile), QStringLiteral("Global")); *appCaption = globalgroup.readEntry("Name", globalgroup.readEntry("Comment", notifyConfig.appname)); @@ -213,9 +144,9 @@ } } -bool NotifyByPopupPrivate::sendNotificationToServer(KNotification *notification, const KNotifyConfig ¬ifyConfig_nocheck, bool update) +bool NotifyByPopup::sendNotificationToServer(KNotification *notification, const KNotifyConfig ¬ifyConfig_nocheck, bool update) { - uint updateId = notifications.key(notification, 0); + uint updateId = m_notifications.key(notification, 0); if (update) { if (updateId == 0) { @@ -237,9 +168,8 @@ QString title = notification->title().isEmpty() ? appCaption : notification->title(); QString text = notification->text(); - if (!popupServerCapabilities.contains(QLatin1String("body-markup"))) { - title = q->stripRichText(title); - text = q->stripRichText(text); + if (!m_popupServerCapabilities.contains(QLatin1String("body-markup"))) { + text = stripRichText(text); } // freedesktop.org spec defines action list to be list like @@ -248,7 +178,7 @@ // assign id's to actions like it's done in fillPopup() method // (i.e. starting from 1) QStringList actionList; - if (popupServerCapabilities.contains(QLatin1String("actions"))) { + if (m_popupServerCapabilities.contains(QLatin1String("actions"))) { QString defaultAction = notification->defaultAction(); if (!defaultAction.isEmpty()) { actionList.append(QStringLiteral("default")); @@ -298,7 +228,7 @@ break; case KNotification::NormalUrgency: Q_FALLTHROUGH(); - // freedesktop.org notifications only know low, normal, critical + // freedesktop.org m_notifications only know low, normal, critical case KNotification::HighUrgency: urgency = 1; break; @@ -331,42 +261,42 @@ // CloseOnTimeout => -1 == let the server decide int timeout = (notification->flags() & KNotification::Persistent) ? 0 : -1; - const QDBusPendingReply<uint> reply = dbusInterface.Notify(appCaption, updateId, iconName, title, text, actionList, hintsMap, timeout); + const QDBusPendingReply<uint> reply = m_dbusInterface.Notify(appCaption, updateId, iconName, title, text, actionList, hintsMap, timeout); //parent is set to the notification so that no-one ever accesses a dangling pointer on the notificationObject property QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, notification); - QObject::connect(watcher, &QDBusPendingCallWatcher::finished, q, [this, notification](QDBusPendingCallWatcher *watcher){ + QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, notification](QDBusPendingCallWatcher *watcher){ watcher->deleteLater(); QDBusPendingReply<uint> reply = *watcher; - notifications.insert(reply.argumentAt<0>(), notification); + m_notifications.insert(reply.argumentAt<0>(), notification); }); return true; } -void NotifyByPopupPrivate::queryPopupServerCapabilities() +void NotifyByPopup::queryPopupServerCapabilities() { - if (!dbusServiceCapCacheDirty) { + if (!m_dbusServiceCapCacheDirty) { return; } - QDBusPendingReply<QStringList> call = dbusInterface.GetCapabilities(); + QDBusPendingReply<QStringList> call = m_dbusInterface.GetCapabilities(); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(call); - QObject::connect(watcher, &QDBusPendingCallWatcher::finished, q, [this](QDBusPendingCallWatcher *watcher) { + QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [this](QDBusPendingCallWatcher *watcher) { watcher->deleteLater(); const QDBusPendingReply<QStringList> reply = *watcher; const QStringList capabilities = reply.argumentAt<0>(); - popupServerCapabilities = capabilities; - dbusServiceCapCacheDirty = false; + m_popupServerCapabilities = capabilities; + m_dbusServiceCapCacheDirty = false; - // re-run notify() on all enqueued notifications - for (const QPair<KNotification*, KNotifyConfig> ¬i : qAsConst(notificationQueue)) { - q->notify(noti.first, noti.second); + // re-run notify() on all enqueued m_notifications + for (const QPair<KNotification*, KNotifyConfig> ¬i : qAsConst(m_notificationQueue)) { + notify(noti.first, noti.second); } - notificationQueue.clear(); + m_notificationQueue.clear(); }); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.79.0/src/notifybypopup.h new/knotifications-5.80.0/src/notifybypopup.h --- old/knotifications-5.79.0/src/notifybypopup.h 2021-02-06 19:21:40.000000000 +0100 +++ new/knotifications-5.80.0/src/notifybypopup.h 2021-03-06 17:28:22.000000000 +0100 @@ -12,17 +12,18 @@ #include "knotificationplugin.h" #include <QStringList> +#include "knotifyconfig.h" + +#include "notifications_interface.h" class KNotification; class QDBusPendingCallWatcher; -class NotifyByPopupPrivate; class NotifyByPopup : public KNotificationPlugin { Q_OBJECT public: explicit NotifyByPopup(QObject *parent = nullptr); - ~NotifyByPopup() override; QString optionName() override { return QStringLiteral("Popup"); } void notify(KNotification *notification, KNotifyConfig *notifyConfig) override; @@ -40,8 +41,53 @@ void notify(KNotification *notification, const KNotifyConfig ¬ifyConfig); void update(KNotification *notification, const KNotifyConfig ¬ifyConfig); - NotifyByPopupPrivate * const d; - friend class NotifyByPopupPrivate; + /** + * Sends notification to DBus "org.freedesktop.notifications" interface. + * @param id knotify-sid identifier of notification + * @param config notification data + * @param update If true, will request the DBus service to update + the notification with new data from \c notification + * Otherwise will put new notification on screen + * @return true for success or false if there was an error. + */ + bool sendNotificationToServer(KNotification *notification, const KNotifyConfig &config, bool update = false); + + /** + * Find the caption and the icon name of the application + */ + void getAppCaptionAndIconName(const KNotifyConfig &config, QString *appCaption, QString *iconName); + /* + * Query the dbus server for notification capabilities + * If no DBus server is present, use fallback capabilities for KPassivePopup + */ + void queryPopupServerCapabilities(); + + /** + * DBus notification daemon capabilities cache. + * Do not use this variable. Use #popupServerCapabilities() instead. + * @see popupServerCapabilities + */ + QStringList m_popupServerCapabilities; + + /** + * In case we still don't know notification server capabilities, + * we need to query those first. That's done in an async way + * so we queue all notifications while waiting for the capabilities + * to return, then process them from this queue + */ + QList<QPair<KNotification*, KNotifyConfig> > m_notificationQueue; + /** + * Whether the DBus notification daemon capability cache is up-to-date. + */ + bool m_dbusServiceCapCacheDirty; + + /* + * As we communicate with the notification server over dbus + * we use only ids, this is for fast KNotifications lookup + */ + QHash<uint, QPointer<KNotification>> m_notifications; + + org::freedesktop::Notifications m_dbusInterface; }; #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.79.0/src/notifybysnore.cpp new/knotifications-5.80.0/src/notifybysnore.cpp --- old/knotifications-5.79.0/src/notifybysnore.cpp 2021-02-06 19:21:40.000000000 +0100 +++ new/knotifications-5.80.0/src/notifybysnore.cpp 2021-03-06 17:28:22.000000000 +0100 @@ -146,7 +146,7 @@ { m_notifications.insert(notification->id(), notification); - const QString notificationTitle = ((!notification->title().isEmpty()) ? stripRichText(notification->title()) + const QString notificationTitle = ((!notification->title().isEmpty()) ? notification->title() : qApp->applicationDisplayName()); QStringList snoretoastArgsList { QStringLiteral("-id"), QString::number(notification->id()),
