Hello community, here is the log from the commit of package knotifications for openSUSE:Factory checked in at 2015-09-02 07:47:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/knotifications (Old) and /work/SRC/openSUSE:Factory/.knotifications.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "knotifications" Changes: -------- --- /work/SRC/openSUSE:Factory/knotifications/knotifications.changes 2015-07-14 17:28:42.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.knotifications.new/knotifications.changes 2015-09-02 07:47:24.000000000 +0200 @@ -1,0 +2,15 @@ +Tue Aug 4 19:20:36 UTC 2015 - [email protected] + +- Update to 5.13.0 + * The Qt version requirement has been bumped from 5.2 to 5.3 + * Debug output has been ported to categorized output, for less + noise by default + * Docbook documentation has been reviewed and updated + * Fix the starting Y position for fallback popups + * Reduce dependencies and move to Tier 2 + * Catch unknown notification entries (nullptr deref) (kde#348414) + * Remove pretty much useless warning + * For more details please see: + https://www.kde.org/announcements/kde-frameworks-5.13.0.php + +------------------------------------------------------------------- Old: ---- knotifications-5.12.0.tar.xz New: ---- knotifications-5.13.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ knotifications.spec ++++++ --- /var/tmp/diff_new_pack.hWUzbq/_old 2015-09-02 07:47:25.000000000 +0200 +++ /var/tmp/diff_new_pack.hWUzbq/_new 2015-09-02 07:47:25.000000000 +0200 @@ -18,9 +18,9 @@ %bcond_without lang %define lname libKF5Notifications5 -%define _tar_path 5.12 +%define _tar_path 5.13 Name: knotifications -Version: 5.12.0 +Version: 5.13.0 Release: 0 %define kf5_version %{version} BuildRequires: cmake >= 2.8.12 @@ -30,17 +30,15 @@ BuildRequires: kconfig-devel >= %{_tar_path} BuildRequires: kcoreaddons-devel >= %{_tar_path} BuildRequires: kf5-filesystem -BuildRequires: kiconthemes-devel >= %{_tar_path} -BuildRequires: kservice-devel >= %{_tar_path} BuildRequires: kwindowsystem-devel >= %{_tar_path} %if %{with lang} -BuildRequires: libqt5-linguist-devel >= 5.2.0 +BuildRequires: cmake(Qt5LinguistTools) >= 5.3.0 %endif BuildRequires: phonon4qt5-devel -BuildRequires: pkgconfig(Qt5DBus) >= 5.2.0 -BuildRequires: pkgconfig(Qt5Test) >= 5.2.0 -BuildRequires: pkgconfig(Qt5Widgets) >= 5.2.0 -BuildRequires: pkgconfig(Qt5X11Extras) >= 5.2.0 +BuildRequires: cmake(Qt5DBus) >= 5.3.0 +BuildRequires: cmake(Qt5Test) >= 5.3.0 +BuildRequires: cmake(Qt5Widgets) >= 5.3.0 +BuildRequires: cmake(Qt5X11Extras) >= 5.3.0 BuildRequires: pkgconfig(dbusmenu-qt5) BuildRequires: pkgconfig(x11) Summary: KDE Desktop notifications @@ -71,7 +69,7 @@ Group: Development/Libraries/KDE Requires: %lname = %{version} Requires: extra-cmake-modules -Requires: pkgconfig(Qt5Widgets) >= 5.2.0 +Requires: cmake(Qt5Widgets) >= 5.3.0 %description devel KNotification is used to notify the user of an event. It covers feedback and ++++++ knotifications-5.12.0.tar.xz -> knotifications-5.13.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/CMakeLists.txt new/knotifications-5.13.0/CMakeLists.txt --- old/knotifications-5.12.0/CMakeLists.txt 2015-07-05 11:09:35.000000000 +0200 +++ new/knotifications-5.13.0/CMakeLists.txt 2015-08-04 13:08:33.000000000 +0200 @@ -4,7 +4,7 @@ # ECM setup include(FeatureSummary) -find_package(ECM 5.12.0 NO_MODULE) +find_package(ECM 5.13.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) @@ -17,8 +17,8 @@ include(ECMPoQmTools) -set(KF5_VERSION "5.12.0") # handled by release scripts -set(KF5_DEP_VERSION "5.12.0") # handled by release scripts +set(KF5_VERSION "5.13.0") # handled by release scripts +set(KF5_DEP_VERSION "5.13.0") # handled by release scripts ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KNOTIFICATIONS @@ -28,7 +28,7 @@ SOVERSION 5) # Dependencies -set(REQUIRED_QT_VERSION "5.2.0") +set(REQUIRED_QT_VERSION "5.3.0") find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Widgets DBus) find_package(Qt5 ${REQUIRED_QT_VERSION} QUIET OPTIONAL_COMPONENTS TextToSpeech) @@ -49,13 +49,11 @@ set(HAVE_X11 ${X11_FOUND}) set(HAVE_XTEST ${X11_XTest_FOUND}) if(X11_FOUND) - find_package(Qt5X11Extras 5.2.0 REQUIRED NO_MODULE) + find_package(Qt5X11Extras ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE) endif() find_package(KF5WindowSystem ${KF5_DEP_VERSION} REQUIRED) -find_package(KF5Service ${KF5_DEP_VERSION} REQUIRED) find_package(KF5Config ${KF5_DEP_VERSION} REQUIRED) -find_package(KF5IconThemes ${KF5_DEP_VERSION} REQUIRED) find_package(KF5Codecs ${KF5_DEP_VERSION} REQUIRED) find_package(KF5CoreAddons ${KF5_DEP_VERSION} REQUIRED) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/metainfo.yaml new/knotifications-5.13.0/metainfo.yaml --- old/knotifications-5.12.0/metainfo.yaml 2015-07-05 11:09:35.000000000 +0200 +++ new/knotifications-5.13.0/metainfo.yaml 2015-08-04 13:08:33.000000000 +0200 @@ -1,6 +1,6 @@ maintainer: mklapetek description: Abstraction for system notifications -tier: 3 +tier: 2 type: solution platforms: portingAid: false diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/po/nb/knotifications5_qt.po new/knotifications-5.13.0/po/nb/knotifications5_qt.po --- old/knotifications-5.12.0/po/nb/knotifications5_qt.po 2015-07-05 11:09:35.000000000 +0200 +++ new/knotifications-5.13.0/po/nb/knotifications5_qt.po 2015-08-04 13:08:33.000000000 +0200 @@ -31,28 +31,28 @@ msgid "Unknown Application" msgstr "Ukjent program" -#: kstatusnotifieritem.cpp:439 kstatusnotifieritem.cpp:879 +#: kstatusnotifieritem.cpp:439 kstatusnotifieritem.cpp:884 msgctxt "KStatusNotifierItem|" msgid "&Minimize" msgstr "&Minimer" -#: kstatusnotifieritem.cpp:704 +#: kstatusnotifieritem.cpp:709 msgctxt "KStatusNotifierItem|" msgid "Quit" msgstr "Avslutt" -#: kstatusnotifieritem.cpp:877 +#: kstatusnotifieritem.cpp:882 msgctxt "KStatusNotifierItem|" msgid "&Restore" msgstr "&Gjenopprett" -#: kstatusnotifieritem.cpp:891 +#: kstatusnotifieritem.cpp:896 #, qt-format msgctxt "KStatusNotifierItem|" msgid "<qt>Are you sure you want to quit <b>%1</b>?</qt>" msgstr "<qt>Vil du avslutte <b>%1</b>?</qt>" -#: kstatusnotifieritem.cpp:894 +#: kstatusnotifieritem.cpp:899 msgctxt "KStatusNotifierItem|" msgid "Confirm Quit From System Tray" msgstr "Bekreft «Avslutt» fra systemkurven" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/po/nn/knotifications5_qt.po new/knotifications-5.13.0/po/nn/knotifications5_qt.po --- old/knotifications-5.12.0/po/nn/knotifications5_qt.po 2015-07-05 11:09:35.000000000 +0200 +++ new/knotifications-5.13.0/po/nn/knotifications5_qt.po 2015-08-04 13:08:33.000000000 +0200 @@ -28,28 +28,28 @@ msgid "Unknown Application" msgstr "Ukjent program" -#: kstatusnotifieritem.cpp:439 kstatusnotifieritem.cpp:879 +#: kstatusnotifieritem.cpp:439 kstatusnotifieritem.cpp:884 msgctxt "KStatusNotifierItem|" msgid "&Minimize" msgstr "&Minimer" -#: kstatusnotifieritem.cpp:704 +#: kstatusnotifieritem.cpp:709 msgctxt "KStatusNotifierItem|" msgid "Quit" msgstr "Avslutt" -#: kstatusnotifieritem.cpp:877 +#: kstatusnotifieritem.cpp:882 msgctxt "KStatusNotifierItem|" msgid "&Restore" msgstr "Gj&enopprett" -#: kstatusnotifieritem.cpp:891 +#: kstatusnotifieritem.cpp:896 #, qt-format msgctxt "KStatusNotifierItem|" msgid "<qt>Are you sure you want to quit <b>%1</b>?</qt>" msgstr "<qt>Vil du avslutta <b>%1</b>?</qt>" -#: kstatusnotifieritem.cpp:894 +#: kstatusnotifieritem.cpp:899 msgctxt "KStatusNotifierItem|" msgid "Confirm Quit From System Tray" msgstr "Stadfest avslutting frå systemfeltet" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/po/se/knotifications5_qt.po new/knotifications-5.13.0/po/se/knotifications5_qt.po --- old/knotifications-5.12.0/po/se/knotifications5_qt.po 2015-07-05 11:09:35.000000000 +0200 +++ new/knotifications-5.13.0/po/se/knotifications5_qt.po 2015-08-04 13:08:33.000000000 +0200 @@ -26,31 +26,31 @@ msgid "Unknown Application" msgstr "Amas prográmma" -#: kstatusnotifieritem.cpp:439 kstatusnotifieritem.cpp:879 +#: kstatusnotifieritem.cpp:439 kstatusnotifieritem.cpp:884 #, fuzzy msgctxt "KStatusNotifierItem|" msgid "&Minimize" msgstr "&Minimere" -#: kstatusnotifieritem.cpp:704 +#: kstatusnotifieritem.cpp:709 #, fuzzy msgctxt "KStatusNotifierItem|" msgid "Quit" msgstr "Heaittit" -#: kstatusnotifieritem.cpp:877 +#: kstatusnotifieritem.cpp:882 #, fuzzy msgctxt "KStatusNotifierItem|" msgid "&Restore" msgstr "&Máhcat" -#: kstatusnotifieritem.cpp:891 +#: kstatusnotifieritem.cpp:896 #, fuzzy, qt-format msgctxt "KStatusNotifierItem|" msgid "<qt>Are you sure you want to quit <b>%1</b>?</qt>" msgstr "<qt>Háliidatgo duođaid heaittihit <b>%1</b>?</qt>" -#: kstatusnotifieritem.cpp:894 +#: kstatusnotifieritem.cpp:899 #, fuzzy msgctxt "KStatusNotifierItem|" msgid "Confirm Quit From System Tray" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/src/CMakeLists.txt new/knotifications-5.13.0/src/CMakeLists.txt --- old/knotifications-5.12.0/src/CMakeLists.txt 2015-07-05 11:09:35.000000000 +0200 +++ new/knotifications-5.13.0/src/CMakeLists.txt 2015-08-04 13:08:33.000000000 +0200 @@ -3,6 +3,8 @@ ecm_create_qm_loader(knotifications_QM_LOADER knotifications5_qt) set(knotifications_SRCS + debug_p.cpp + knotification.cpp knotificationmanager.cpp kpassivepopup.cpp @@ -62,8 +64,6 @@ target_link_libraries(KF5Notifications PRIVATE ${PHONON_LIBRARIES} KF5::CoreAddons - KF5::IconThemes - KF5::Service KF5::ConfigCore KF5::WindowSystem KF5::Codecs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/src/debug_p.cpp new/knotifications-5.13.0/src/debug_p.cpp --- old/knotifications-5.12.0/src/debug_p.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/knotifications-5.13.0/src/debug_p.cpp 2015-08-04 13:08:33.000000000 +0200 @@ -0,0 +1,29 @@ +/* + Copyright (C) 2015 Christoph Cullmann <[email protected]> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) version 3, or any + later version accepted by the membership of KDE e.V. (or its + successor approved by the membership of KDE e.V.), which shall + act as a proxy defined in Section 6 of version 3 of the license. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. If not, see <http://www.gnu.org/licenses/>. + + */ + +#include "debug_p.h" + +#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) +// logging category for this framework, default: log stuff >= warning +Q_LOGGING_CATEGORY(LOG_KNOTIFICATIONS, "org.kde.knotifications", QtWarningMsg) +#else +Q_LOGGING_CATEGORY(LOG_KNOTIFICATIONS, "org.kde.knotifications") +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/src/debug_p.h new/knotifications-5.13.0/src/debug_p.h --- old/knotifications-5.12.0/src/debug_p.h 1970-01-01 01:00:00.000000000 +0100 +++ new/knotifications-5.13.0/src/debug_p.h 2015-08-04 13:08:33.000000000 +0200 @@ -0,0 +1,30 @@ +/* + Copyright (C) 2015 Christoph Cullmann <[email protected]> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) version 3, or any + later version accepted by the membership of KDE e.V. (or its + successor approved by the membership of KDE e.V.), which shall + act as a proxy defined in Section 6 of version 3 of the license. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. If not, see <http://www.gnu.org/licenses/>. + + */ + +#ifndef NOTIFCATION_DEBUG_P_H +#define NOTIFCATION_DEBUG_P_H + +#include <QDebug> +#include <QLoggingCategory> + +Q_DECLARE_LOGGING_CATEGORY(LOG_KNOTIFICATIONS) + +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/src/knotificationmanager.cpp new/knotifications-5.13.0/src/knotificationmanager.cpp --- old/knotifications-5.12.0/src/knotificationmanager.cpp 2015-07-05 11:09:35.000000000 +0200 +++ new/knotifications-5.13.0/src/knotificationmanager.cpp 2015-08-04 13:08:33.000000000 +0200 @@ -19,14 +19,12 @@ #include "knotificationmanager_p.h" #include "knotification.h" -#include <QDebug> #include <QHash> #include <QWidget> #include <QDBusConnection> #include <QPointer> #include <QBuffer> - -#include <kservicetypetrader.h> +#include <KPluginLoader> #include "knotifyconfig.h" #include "knotificationplugin.h" @@ -35,6 +33,7 @@ #include "notifybylogfile.h" #include "notifybytaskbar.h" #include "notifybyexecute.h" +#include "debug_p.h" #ifdef HAVE_SPEECH #include "notifybytts.h" @@ -83,17 +82,17 @@ addPlugin(new NotifyByTTS(this)); #endif - KService::List offers = KServiceTypeTrader::self()->query("KNotification/NotifyPlugin"); - - QVariantList args; - QString error; - - Q_FOREACH (const KService::Ptr service, offers) { - KNotificationPlugin *plugin = service->createInstance<KNotificationPlugin>(this, args, &error); - if (plugin) { - addPlugin(plugin); + QList<QObject*> plugins = KPluginLoader::instantiatePlugins(QStringLiteral("knotification/notifyplugins"), + std::function<bool(const KPluginMetaData &)>(), + this); + + Q_FOREACH (QObject *plugin, plugins) { + KNotificationPlugin *notifyPlugin = qobject_cast<KNotificationPlugin*>(plugin); + if (notifyPlugin) { + addPlugin(notifyPlugin); } else { - qDebug() << "Could not load plugin" << service->name() << "due to:" << error; + // not our/valid plugin, so delete the created object + plugin->deleteLater(); } } } @@ -122,7 +121,7 @@ void KNotificationManager::notificationActivated(int id, int action) { if (d->notifications.contains(id)) { - qDebug() << id << " " << action; + qCDebug(LOG_KNOTIFICATIONS) << id << " " << action; KNotification *n = d->notifications[id]; n->activate(action); close(id); @@ -149,7 +148,7 @@ { if (force || d->notifications.contains(id)) { KNotification *n = d->notifications.take(id); - qDebug() << "Closing notification" << id; + qCDebug(LOG_KNOTIFICATIONS) << "Closing notification" << id; Q_FOREACH (KNotificationPlugin *plugin, d->notifyPlugins) { plugin->close(n); @@ -173,13 +172,13 @@ Q_FOREACH (const QString &action, notifyActions.split('|')) { if (!d->notifyPlugins.contains(action)) { - qDebug() << "No plugin for action" << action; + qCDebug(LOG_KNOTIFICATIONS) << "No plugin for action" << action; continue; } KNotificationPlugin *notifyPlugin = d->notifyPlugins[action]; n->ref(); - qDebug() << "Calling notify on" << notifyPlugin->optionName(); + qCDebug(LOG_KNOTIFICATIONS) << "Calling notify on" << notifyPlugin->optionName(); notifyPlugin->notify(n, ¬ifyConfig); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/src/knotificationplugin.cpp new/knotifications-5.13.0/src/knotificationplugin.cpp --- old/knotifications-5.12.0/src/knotificationplugin.cpp 2015-07-05 11:09:35.000000000 +0200 +++ new/knotifications-5.13.0/src/knotificationplugin.cpp 2015-08-04 13:08:33.000000000 +0200 @@ -19,8 +19,6 @@ */ -#include <KPluginFactory> - #include "knotificationplugin.h" KNotificationPlugin::KNotificationPlugin(QObject *parent, const QVariantList &args) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/src/knotificationrestrictions.cpp new/knotifications-5.13.0/src/knotificationrestrictions.cpp --- old/knotifications-5.12.0/src/knotificationrestrictions.cpp 2015-07-05 11:09:35.000000000 +0200 +++ new/knotifications-5.13.0/src/knotificationrestrictions.cpp 2015-08-04 13:08:33.000000000 +0200 @@ -20,12 +20,12 @@ #include "knotificationrestrictions.h" #include <QApplication> -#include <QDebug> #include <QtDBus/QDBusConnection> #include <QtDBus/QDBusMessage> #include <QtDBus/QDBusReply> #include <config-knotifications.h> +#include "debug_p.h" #if HAVE_XTEST #include <QTimer> @@ -90,12 +90,12 @@ void KNotificationRestrictions::Private::screensaverFakeKeyEvent() { - qDebug(); + qCDebug(LOG_KNOTIFICATIONS); #if HAVE_XTEST if (!isX11) { return; } - qDebug() << "---- using XTestFakeKeyEvent"; + qCDebug(LOG_KNOTIFICATIONS) << "---- using XTestFakeKeyEvent"; Display *display = QX11Info::display(); XTestFakeKeyEvent(display, XTestKeyCode, true, CurrentTime); XTestFakeKeyEvent(display, XTestKeyCode, false, CurrentTime); @@ -105,7 +105,7 @@ void KNotificationRestrictions::Private::startScreenSaverPrevention() { - qDebug(); + qCDebug(LOG_KNOTIFICATIONS); QDBusMessage message = QDBusMessage::createMethodCall( "org.freedesktop.ScreenSaver", "/ScreenSaver", "org.freedesktop.ScreenSaver", "Inhibit"); @@ -125,7 +125,7 @@ haveXTest = XTestQueryExtension(QX11Info::display(), &a, &b, &c, &e); if (!haveXTest) { - qDebug() << "--- No XTEST!"; + qCDebug(LOG_KNOTIFICATIONS) << "--- No XTEST!"; return; } } @@ -134,7 +134,7 @@ XTestKeyCode = XKeysymToKeycode(QX11Info::display(), XK_Shift_L); if (!XTestKeyCode) { - qDebug() << "--- No XKeyCode for XK_Shift_L!"; + qCDebug(LOG_KNOTIFICATIONS) << "--- No XKeyCode for XK_Shift_L!"; return; } } @@ -145,7 +145,7 @@ q, SLOT(screensaverFakeKeyEvent())); } - qDebug() << "---- using XTest"; + qCDebug(LOG_KNOTIFICATIONS) << "---- using XTest"; // send a fake event right away in case this got started after a period of // innactivity leading to the screensaver set to activate in <55s screensaverFakeKeyEvent(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/src/knotifyconfig.cpp new/knotifications-5.13.0/src/knotifyconfig.cpp --- old/knotifications-5.12.0/src/knotifyconfig.cpp 2015-07-05 11:09:35.000000000 +0200 +++ new/knotifications-5.13.0/src/knotifyconfig.cpp 2015-08-04 13:08:33.000000000 +0200 @@ -28,7 +28,6 @@ #include <QCache> #include <QDataStream> #include <QStandardPaths> -#include <QDebug> typedef QCache<QString, KSharedConfig::Ptr> ConfigCache; Q_GLOBAL_STATIC_WITH_ARGS(ConfigCache , static_cache, (15)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/src/kpassivepopup.cpp new/knotifications-5.13.0/src/kpassivepopup.cpp --- old/knotifications-5.12.0/src/kpassivepopup.cpp 2015-07-05 11:09:35.000000000 +0200 +++ new/knotifications-5.13.0/src/kpassivepopup.cpp 2015-08-04 13:08:33.000000000 +0200 @@ -20,11 +20,11 @@ #include "kpassivepopup.h" #include <config-knotifications.h> +#include "debug_p.h" // Qt #include <QGuiApplication> #include <QBitmap> -#include <QDebug> #include <QScreen> #include <QLabel> #include <QLayout> @@ -293,7 +293,7 @@ void KPassivePopup::setView(const QString &caption, const QString &text, const QPixmap &icon) { - // qDebug() << "KPassivePopup::setView " << caption << ", " << text; + // qCDebug(LOG_KNOTIFICATIONS) << "KPassivePopup::setView " << caption << ", " << text; setView(standardView(caption, text, icon, this)); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/src/kstatusnotifieritem.cpp new/knotifications-5.13.0/src/kstatusnotifieritem.cpp --- old/knotifications-5.12.0/src/kstatusnotifieritem.cpp 2015-07-05 11:09:35.000000000 +0200 +++ new/knotifications-5.13.0/src/kstatusnotifieritem.cpp 2015-08-04 13:08:33.000000000 +0200 @@ -21,11 +21,11 @@ #include "kstatusnotifieritem.h" #include "kstatusnotifieritemprivate_p.h" #include "kstatusnotifieritemdbus_p.h" +#include "debug_p.h" #include <QDBusConnection> #include <QtEndian> #include <QMessageBox> -#include <QDebug> #include <QPixmap> #include <QImage> #include <QApplication> @@ -75,7 +75,7 @@ QString KStatusNotifierItem::id() const { - //qDebug() << "id requested" << d->id; + //qCDebug(LOG_KNOTIFICATIONS) << "id requested" << d->id; return d->id; } @@ -724,7 +724,7 @@ void KStatusNotifierItemPrivate::registerToDaemon() { - qDebug() << "Registering a client interface to the KStatusNotifierWatcher"; + qCDebug(LOG_KNOTIFICATIONS) << "Registering a client interface to the KStatusNotifierWatcher"; if (!statusNotifierWatcher) { statusNotifierWatcher = new org::kde::StatusNotifierWatcher(s_statusNotifierWatcherServiceName, "/StatusNotifierWatcher", QDBusConnection::sessionBus()); @@ -740,7 +740,7 @@ statusNotifierWatcher->RegisterStatusNotifierItem(statusNotifierItemDBus->service()); setLegacySystemTrayEnabled(false); } else { - qDebug() << "KStatusNotifierWatcher not reachable"; + qCDebug(LOG_KNOTIFICATIONS) << "KStatusNotifierWatcher not reachable"; setLegacySystemTrayEnabled(true); } } @@ -750,7 +750,7 @@ Q_UNUSED(name) if (newOwner.isEmpty()) { //unregistered - qDebug() << "Connection to the KStatusNotifierWatcher lost"; + qCDebug(LOG_KNOTIFICATIONS) << "Connection to the KStatusNotifierWatcher lost"; setLegacyMode(true); delete statusNotifierWatcher; statusNotifierWatcher = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/src/kstatusnotifieritemdbus_p.cpp new/knotifications-5.13.0/src/kstatusnotifieritemdbus_p.cpp --- old/knotifications-5.12.0/src/kstatusnotifieritemdbus_p.cpp 2015-07-05 11:09:35.000000000 +0200 +++ new/knotifications-5.13.0/src/kstatusnotifieritemdbus_p.cpp 2015-08-04 13:08:33.000000000 +0200 @@ -21,12 +21,12 @@ #include "kstatusnotifieritemdbus_p.h" #include "kstatusnotifieritemprivate_p.h" #include "kstatusnotifieritem.h" +#include "debug_p.h" #include <QDBusConnection> #include <QPixmap> #include <QImage> #include <QApplication> -#include <QDebug> #include <QMenu> #include <QMovie> @@ -155,7 +155,7 @@ m_dbus(QDBusConnection::connectToBus(QDBusConnection::SessionBus, m_service)) { new StatusNotifierItemAdaptor(this); - qDebug() << "service is" << m_service; + qCDebug(LOG_KNOTIFICATIONS) << "service is" << m_service; m_dbus.registerService(m_service); m_dbus.registerObject("/StatusNotifierItem", this); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/src/notifybyaudio.cpp new/knotifications-5.13.0/src/notifybyaudio.cpp --- old/knotifications-5.12.0/src/notifybyaudio.cpp 2015-07-05 11:09:35.000000000 +0200 +++ new/knotifications-5.13.0/src/notifybyaudio.cpp 2015-08-04 13:08:33.000000000 +0200 @@ -20,8 +20,8 @@ */ #include "notifybyaudio.h" +#include "debug_p.h" -#include <QDebug> #include <QDateTime> #include <QFile> #include <QTextStream> @@ -54,7 +54,7 @@ } QString soundFilename = config->readEntry("Sound"); if (soundFilename.isEmpty()) { - qWarning() << "Audio notification requested, but no sound file provided in notifyrc file, aborting audio notification"; + qCWarning(LOG_KNOTIFICATIONS) << "Audio notification requested, but no sound file provided in notifyrc file, aborting audio notification"; finish(notification); return; @@ -65,7 +65,7 @@ soundURL = QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("sounds/") + soundFilename)); if (soundURL.isEmpty()) { - qWarning() << "Audio notification requested, but sound file from notifyrc file was not found, aborting audio notification"; + qCWarning(LOG_KNOTIFICATIONS) << "Audio notification requested, but sound file from notifyrc file was not found, aborting audio notification"; finish(notification); return; @@ -109,7 +109,7 @@ void NotifyByAudio::stateChanged(Phonon::State newState, Phonon::State oldState) { - qDebug() << "Changing audio state from" << oldState << "to" << newState; + qCDebug(LOG_KNOTIFICATIONS) << "Changing audio state from" << oldState << "to" << newState; } void NotifyByAudio::close(KNotification *notification) @@ -133,18 +133,18 @@ return; } - KNotification *notification = m_notifications.value(m); + if (KNotification *notification = m_notifications.value(m, nullptr)) { + //if the sound is short enough, we can't guarantee new sounds are + //enqueued before finished is emitted. + //so to make sure we are looping restart it when the sound finished + if (notification->flags() & KNotification::LoopSound) { + m->play(); + return; + } - //if the sound is short enough, we can't guarantee new sounds are - //enqueued before finished is emitted. - //so to make sure we are looping restart it when the sound finished - if (notification->flags() & KNotification::LoopSound) { - m->play(); - return; + finish(notification); } - finish(notification); - disconnect(m, SIGNAL(currentSourceChanged(Phonon::MediaSource)), this, SLOT(onAudioSourceChanged(Phonon::MediaSource))); m_notifications.remove(m); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/src/notifybyexecute.cpp new/knotifications-5.13.0/src/notifybyexecute.cpp --- old/knotifications-5.12.0/src/notifybyexecute.cpp 2015-07-05 11:09:35.000000000 +0200 +++ new/knotifications-5.13.0/src/notifybyexecute.cpp 2015-08-04 13:08:33.000000000 +0200 @@ -22,12 +22,12 @@ #include "notifybyexecute.h" #include <QHash> -#include <QDebug> #include <QWidget> #include <KProcess> #include <knotifyconfig.h> #include "knotification.h" +#include "debug_p.h" #include <kmacroexpander.h> @@ -65,7 +65,7 @@ KProcess proc; proc.setShellCommand(execLine.trimmed()); if (!proc.startDetached()) { - qDebug() << "KProcess returned an error while trying to execute this command:" << execLine; + qCDebug(LOG_KNOTIFICATIONS) << "KProcess returned an error while trying to execute this command:" << execLine; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/src/notifybylogfile.cpp new/knotifications-5.13.0/src/notifybylogfile.cpp --- old/knotifications-5.12.0/src/notifybylogfile.cpp 2015-07-05 11:09:35.000000000 +0200 +++ new/knotifications-5.13.0/src/notifybylogfile.cpp 2015-08-04 13:08:33.000000000 +0200 @@ -22,7 +22,6 @@ #include "notifybylogfile.h" -#include <QDebug> #include <QDateTime> #include <QFile> #include <QTextStream> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/src/notifybypopup.cpp new/knotifications-5.13.0/src/notifybypopup.cpp --- old/knotifications-5.12.0/src/notifybypopup.cpp 2015-07-05 11:09:35.000000000 +0200 +++ new/knotifications-5.13.0/src/notifybypopup.cpp 2015-08-04 13:08:33.000000000 +0200 @@ -28,12 +28,13 @@ #include "kpassivepopup.h" #include "knotifyconfig.h" #include "knotification.h" +#include "debug_p.h" #include <QBuffer> #include <QImage> #include <QLabel> #include <QTextDocument> -#include <QApplication> +#include <QGuiApplication> #include <QBoxLayout> #include <QLayout> #include <QDBusConnection> @@ -42,7 +43,6 @@ #include <QDBusError> #include <QDBusMessage> #include <QXmlStreamReader> -#include <QDebug> #include <QMap> #include <QHash> #include <QXmlStreamEntityResolver> @@ -50,9 +50,10 @@ #include <QMutableListIterator> #include <QThread> #include <QScreen> +#include <QFontMetrics> +#include <QIcon> #include <kconfiggroup.h> -#include <KIconThemes/KIconLoader> #include <KCodecs/KCharsets> static const char dbusServiceName[] = "org.freedesktop.Notifications"; @@ -262,15 +263,14 @@ iconName = notification->iconName(); } - KIconLoader iconLoader(iconName); - QPixmap appIcon = iconLoader.loadIcon(iconName, KIconLoader::Small); - // Our growl implementation does not support html stuff // so strip it off right away QString text = notification->text(); text = d->stripHtml(text); - NotifyByPopupGrowl::popup(&appIcon, timeout, appCaption, text); + // The first arg is QPixmap*, however that pixmap is not used + // at all (it has Q_UNUSED) so just set it to 0 + NotifyByPopupGrowl::popup(Q_NULLPTR, timeout, appCaption, text); // Finish immediately, because current NotifyByPopupGrowl can't callback finish(notification); @@ -280,7 +280,7 @@ // Check if this object lives in the GUI thread and return if it doesn't // as Qt cannot create/handle widgets in non-GUI threads if (QThread::currentThread() != qApp->thread()) { - qWarning() << "KNotification did not detect any running org.freedesktop.Notifications server and fallback notifications cannot be used from non-GUI thread!"; + qCWarning(LOG_KNOTIFICATIONS) << "KNotification did not detect any running org.freedesktop.Notifications server and fallback notifications cannot be used from non-GUI thread!"; return; } @@ -291,7 +291,7 @@ QRect screen = QGuiApplication::primaryScreen()->availableGeometry(); if (d->nextPosition == -1) { - d->nextPosition = screen.y() + screen.height() - 32; + d->nextPosition = screen.top(); } pop->setAutoDelete(true); connect(pop, SIGNAL(destroyed()), this, SLOT(onPassivePopupDestroyed())); @@ -446,7 +446,7 @@ this, SLOT(onGalagoNotificationActionInvoked(uint,QString))); if (!connected) { - qWarning() << "warning: failed to connect to ActionInvoked dbus signal"; + qCWarning(LOG_KNOTIFICATIONS) << "warning: failed to connect to ActionInvoked dbus signal"; } connected = QDBusConnection::sessionBus().connect(QString(), // from any service @@ -456,7 +456,7 @@ this, SLOT(onGalagoNotificationClosed(uint,uint))); if (!connected) { - qWarning() << "warning: failed to connect to NotificationClosed dbus signal"; + qCWarning(LOG_KNOTIFICATIONS) << "warning: failed to connect to NotificationClosed dbus signal"; } } } @@ -465,7 +465,6 @@ { auto iter = d->galagoNotifications.find(notificationId); if (iter == d->galagoNotifications.end()) { - qWarning() << "Failed to find KNotification id for dbus_id" << notificationId << "- action not triggered"; return; } @@ -484,7 +483,6 @@ { auto iter = d->galagoNotifications.find(dbus_id); if (iter == d->galagoNotifications.end()) { - qWarning() << "Failed to find KNotification for dbus_id" << dbus_id; return; } KNotification *n = *iter; @@ -509,7 +507,7 @@ watcher->deleteLater(); KNotification *notification = watcher->property("notificationObject").value<KNotification*>(); if (!notification) { - qWarning() << "Invalid notification object passed in DBus reply watcher; notification will probably break"; + qCWarning(LOG_KNOTIFICATIONS) << "Invalid notification object passed in DBus reply watcher; notification will probably break"; return; } @@ -557,8 +555,8 @@ // of galago notifications queryPopupServerCapabilities(); - KIconLoader iconLoader(iconName); - QPixmap appIcon = iconLoader.loadIcon(iconName, KIconLoader::Small); + int iconDimension = QFontMetrics(QFont()).height(); + QPixmap appIcon = QIcon::fromTheme(iconName).pixmap(iconDimension, iconDimension); QWidget *vb = popup->standardView(notification->title().isEmpty() ? appCaption : notification->title(), notification->pixmap().isNull() ? notification->text() : QString(), @@ -721,7 +719,7 @@ uint galagoId = galagoNotifications.key(notification, 0); if (galagoId == 0) { - qDebug() << "not found dbus id to close" << notification->id(); + qCDebug(LOG_KNOTIFICATIONS) << "not found dbus id to close" << notification->id(); return; } @@ -735,7 +733,7 @@ bool queued = QDBusConnection::sessionBus().send(m); if (!queued) { - qWarning() << "Failed to queue dbus message for closing a notification"; + qCWarning(LOG_KNOTIFICATIONS) << "Failed to queue dbus message for closing a notification"; } } @@ -783,7 +781,7 @@ if (r.hasError()) { // XML error in the given text, just return the original string - qWarning() << "Notification to send to backend which does " + qCWarning(LOG_KNOTIFICATIONS) << "Notification to send to backend which does " "not support HTML, contains invalid XML:" << r.errorString() << "line" << r.lineNumber() << "col" << r.columnNumber(); @@ -804,7 +802,7 @@ QChar ent = KCharsets::fromEntity('&' + name); if (ent.isNull()) { - qWarning() << "Notification to send to backend which does " + qCWarning(LOG_KNOTIFICATIONS) << "Notification to send to backend which does " "not support HTML, contains invalid entity: " << name; ent = ' '; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/src/notifybytaskbar.cpp new/knotifications-5.13.0/src/notifybytaskbar.cpp --- old/knotifications-5.12.0/src/notifybytaskbar.cpp 2015-07-05 11:09:35.000000000 +0200 +++ new/knotifications-5.13.0/src/notifybytaskbar.cpp 2015-08-04 13:08:33.000000000 +0200 @@ -23,8 +23,8 @@ #include "notifybytaskbar.h" #include "knotifyconfig.h" #include "knotification.h" +#include "debug_p.h" -#include <QDebug> #include <QWidget> #include <KWindowSystem> @@ -42,12 +42,12 @@ { Q_UNUSED(config); if (!notification->widget()) { - qWarning() << "Could not notify " << notification->eventId() << "by taskbar, notification has no associated widget"; + qCWarning(LOG_KNOTIFICATIONS) << "Could not notify " << notification->eventId() << "by taskbar, notification has no associated widget"; finish(notification); return; } - qDebug() << notification->id() << notification->widget()->topLevelWidget()->winId(); + qCDebug(LOG_KNOTIFICATIONS) << notification->id() << notification->widget()->topLevelWidget()->winId(); WId win = notification->widget()->topLevelWidget()->winId(); if (win != 0) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/src/notifybytts.cpp new/knotifications-5.13.0/src/notifybytts.cpp --- old/knotifications-5.12.0/src/notifybytts.cpp 2015-07-05 11:09:35.000000000 +0200 +++ new/knotifications-5.13.0/src/notifybytts.cpp 2015-08-04 13:08:33.000000000 +0200 @@ -26,6 +26,7 @@ #include <KMacroExpander> #include "knotifyconfig.h" #include "knotification.h" +#include "debug_p.h" #include <QtDebug> @@ -67,6 +68,6 @@ finished(notification); } else { - qDebug() << "Speech backend has an error, not speaking"; + qCDebug(LOG_KNOTIFICATIONS) << "Speech backend has an error, not speaking"; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/tests/CMakeLists.txt new/knotifications-5.13.0/tests/CMakeLists.txt --- old/knotifications-5.12.0/tests/CMakeLists.txt 2015-07-05 11:09:35.000000000 +0200 +++ new/knotifications-5.13.0/tests/CMakeLists.txt 2015-08-04 13:08:33.000000000 +0200 @@ -6,7 +6,7 @@ feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) -find_package(Qt5 5.2.0 CONFIG REQUIRED Test) +find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Test) macro(knotifications_executable_tests) foreach(_testname ${ARGN}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/tests/kpassivepopuptest.cpp new/knotifications-5.13.0/tests/kpassivepopuptest.cpp --- old/knotifications-5.12.0/tests/kpassivepopuptest.cpp 2015-07-05 11:09:35.000000000 +0200 +++ new/knotifications-5.13.0/tests/kpassivepopuptest.cpp 2015-08-04 13:08:33.000000000 +0200 @@ -13,6 +13,7 @@ QPushButton *pb4; QPushButton *pb5; QPushButton *pb6; +QPushButton *pb7; QSystemTrayIcon *icon; void Test::showIt() @@ -47,6 +48,12 @@ KPassivePopup::message(KPassivePopup::Boxed, QLatin1String("The caption is..."), QLatin1String("Hello World"), pb6); } +void Test::showIt7() +{ + int iconDimension = QApplication::fontMetrics().height(); + KPassivePopup::message(QLatin1String("The caption is..."), QLatin1String("Hello World"), QIcon::fromTheme("dialog-ok").pixmap(iconDimension, iconDimension), pb2); +} + void Test::showItIcon(QSystemTrayIcon::ActivationReason reason) { if (reason == QSystemTrayIcon::Trigger) { @@ -58,6 +65,7 @@ { QApplication::setApplicationName(QLatin1String("test")); QApplication app(argc, argv); + QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); Test *t = new Test(); @@ -93,6 +101,11 @@ pb6->show(); KWindowSystem::setState(pb6->effectiveWinId(), NET::SkipTaskbar); + pb7 = new QPushButton(); + pb7->setText(QLatin1String("By taskbar entry (with caption and icon, default style)")); + pb7->connect(pb7, SIGNAL(clicked()), t, SLOT(showIt7())); + pb7->show(); + icon = new QSystemTrayIcon(); // TODO icon->setIcon(icon->loadIcon("xorg")); icon->connect(icon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), t, SLOT(showItIcon(QSystemTrayIcon::ActivationReason))); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/knotifications-5.12.0/tests/kpassivepopuptest.h new/knotifications-5.13.0/tests/kpassivepopuptest.h --- old/knotifications-5.12.0/tests/kpassivepopuptest.h 2015-07-05 11:09:35.000000000 +0200 +++ new/knotifications-5.13.0/tests/kpassivepopuptest.h 2015-08-04 13:08:33.000000000 +0200 @@ -19,6 +19,7 @@ void showIt4(); void showIt5(); void showIt6(); + void showIt7(); void showItIcon(QSystemTrayIcon::ActivationReason); };
