Hello community,

here is the log from the commit of package knotifications for openSUSE:Factory 
checked in at 2016-11-17 12:34:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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    
2016-10-28 12:22:10.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.knotifications.new/knotifications.changes       
2016-11-17 12:34:39.000000000 +0100
@@ -1,0 +2,13 @@
+Sat Nov  5 22:08:49 UTC 2016 - [email protected]
+
+- Update to 5.28.0
+  * Don't deref an object we haven't referenced when notification
+    has no action
+  * KNotification will no longer crash when using it in a
+    QGuiApplication and no notification service is running
+    (kde#370667)
+  * Fix crashes in NotifyByAudio
+  * For more details please see:
+    https://www.kde.org/announcements/kde-frameworks-5.28.0.php
+
+-------------------------------------------------------------------

Old:
----
  knotifications-5.27.0.tar.xz

New:
----
  knotifications-5.28.0.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ knotifications.spec ++++++
--- /var/tmp/diff_new_pack.5UhmQ6/_old  2016-11-17 12:34:40.000000000 +0100
+++ /var/tmp/diff_new_pack.5UhmQ6/_new  2016-11-17 12:34:40.000000000 +0100
@@ -18,9 +18,9 @@
 
 %bcond_without lang
 %define lname   libKF5Notifications5
-%define _tar_path 5.27
+%define _tar_path 5.28
 Name:           knotifications
-Version:        5.27.0
+Version:        5.28.0
 Release:        0
 %define kf5_version %{version}
 BuildRequires:  cmake >= 2.8.12

++++++ knotifications-5.27.0.tar.xz -> knotifications-5.28.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/knotifications-5.27.0/CMakeLists.txt 
new/knotifications-5.28.0/CMakeLists.txt
--- old/knotifications-5.27.0/CMakeLists.txt    2016-10-02 11:56:10.000000000 
+0200
+++ new/knotifications-5.28.0/CMakeLists.txt    2016-11-05 15:54:29.000000000 
+0100
@@ -4,7 +4,7 @@
 
 # ECM setup
 include(FeatureSummary)
-find_package(ECM 5.27.0  NO_MODULE)
+find_package(ECM 5.28.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(ECMQtDeclareLoggingCategory)
 include(ECMPoQmTools)
 
-set(KF5_VERSION "5.27.0") # handled by release scripts
-set(KF5_DEP_VERSION "5.27.0") # handled by release scripts
+set(KF5_VERSION "5.28.0") # handled by release scripts
+set(KF5_DEP_VERSION "5.28.0") # handled by release scripts
 
 ecm_setup_version(${KF5_VERSION}
   VARIABLE_PREFIX KNOTIFICATIONS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/knotifications-5.27.0/autotests/knotification_test.cpp 
new/knotifications-5.28.0/autotests/knotification_test.cpp
--- old/knotifications-5.27.0/autotests/knotification_test.cpp  2016-10-02 
11:56:10.000000000 +0200
+++ new/knotifications-5.28.0/autotests/knotification_test.cpp  2016-11-05 
15:54:29.000000000 +0100
@@ -38,6 +38,7 @@
     void serverCallTest();
     void serverCloseTest();
     void serverActionsTest();
+    void noActionsTest();
 
 private:
     NotificationsServer *m_server;
@@ -240,5 +241,17 @@
     QCOMPARE(nClosedSpy.size(), 1);
 }
 
+void KNotificationTest::noActionsTest()
+{
+    //event doesn't exist in config, meaning it has no actions
+    QPointer<KNotification> n(new 
KNotification(QStringLiteral("noActionsEvent")));
+    QSignalSpy nClosedSpy(n, SIGNAL(closed()));
+    n->sendEvent();
+
+    nClosedSpy.wait(100);
+    QCOMPARE(nClosedSpy.size(), 1);
+    QVERIFY(n.isNull());
+}
+
 QTEST_GUILESS_MAIN_SYSTEM_DBUS(KNotificationTest)
 #include "knotification_test.moc"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/knotifications-5.27.0/src/knotification.cpp 
new/knotifications-5.28.0/src/knotification.cpp
--- old/knotifications-5.27.0/src/knotification.cpp     2016-10-02 
11:56:10.000000000 +0200
+++ new/knotifications-5.28.0/src/knotification.cpp     2016-11-05 
15:54:29.000000000 +0100
@@ -375,6 +375,7 @@
 }
 void KNotification::deref()
 {
+    Q_ASSERT(d->ref > 0);
     d->ref--;
     if (d->ref == 0) {
         d->id = -1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/knotifications-5.27.0/src/knotificationmanager.cpp 
new/knotifications-5.28.0/src/knotificationmanager.cpp
--- old/knotifications-5.27.0/src/knotificationmanager.cpp      2016-10-02 
11:56:10.000000000 +0200
+++ new/knotifications-5.28.0/src/knotificationmanager.cpp      2016-11-05 
15:54:29.000000000 +0100
@@ -199,6 +199,7 @@
 
     if (notifyActions.isEmpty() || notifyActions == QLatin1String("None")) {
         // this will cause KNotification closing itself fast
+        n->ref();
         n->deref();
         return -1;
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/knotifications-5.27.0/src/notifybyaudio.cpp 
new/knotifications-5.28.0/src/notifybyaudio.cpp
--- old/knotifications-5.27.0/src/notifybyaudio.cpp     2016-10-02 
11:56:10.000000000 +0200
+++ new/knotifications-5.28.0/src/notifybyaudio.cpp     2016-11-05 
15:54:29.000000000 +0100
@@ -111,6 +111,7 @@
         connect(m, SIGNAL(currentSourceChanged(Phonon::MediaSource)), 
SLOT(onAudioSourceChanged(Phonon::MediaSource)));
     }
 
+    Q_ASSERT(!m_notifications.value(m));
     m_notifications.insert(m, notification);
 }
 
@@ -127,9 +128,8 @@
         return;
     }
 
-    // this should call onAudioFinished() which also does finish() on the 
notification
     m->stop();
-    m_reusablePhonons.append(m);
+    finishNotification(notification, m);
 }
 
 void NotifyByAudio::onAudioFinished()
@@ -140,21 +140,29 @@
         return;
     }
 
-    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;
-        }
+    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 && (notification->flags() & KNotification::LoopSound)) {
+        m->play();
+        return;
+    }
+
+    finishNotification(notification, m);
+}
 
+void NotifyByAudio::finishNotification(KNotification *notification, 
Phonon::MediaObject *m)
+{
+    m_notifications.remove(m);
+
+    if (notification) {
         finish(notification);
     }
 
     disconnect(m, SIGNAL(currentSourceChanged(Phonon::MediaSource)), this, 
SLOT(onAudioSourceChanged(Phonon::MediaSource)));
 
-    m_notifications.remove(m);
     m_reusablePhonons.append(m);
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/knotifications-5.27.0/src/notifybyaudio.h 
new/knotifications-5.28.0/src/notifybyaudio.h
--- old/knotifications-5.27.0/src/notifybyaudio.h       2016-10-02 
11:56:10.000000000 +0200
+++ new/knotifications-5.28.0/src/notifybyaudio.h       2016-11-05 
15:54:29.000000000 +0100
@@ -54,6 +54,8 @@
 
 
 private:
+    void finishNotification(KNotification *notification, Phonon::MediaObject 
*m);
+
     QList<Phonon::MediaObject*> m_reusablePhonons;
     QHash<Phonon::MediaObject*, KNotification*> m_notifications;
     Phonon::AudioOutput *m_audioOutput;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/knotifications-5.27.0/src/notifybypopup.cpp 
new/knotifications-5.28.0/src/notifybypopup.cpp
--- old/knotifications-5.27.0/src/notifybypopup.cpp     2016-10-02 
11:56:10.000000000 +0200
+++ new/knotifications-5.28.0/src/notifybypopup.cpp     2016-11-05 
15:54:29.000000000 +0100
@@ -30,6 +30,7 @@
 #include "knotification.h"
 #include "debug_p.h"
 
+#include <QApplication>
 #include <QBuffer>
 #include <QImage>
 #include <QLabel>
@@ -284,6 +285,11 @@
         return;
     }
 
+    if (!qobject_cast<QApplication *>(QCoreApplication::instance())) {
+        qCWarning(LOG_KNOTIFICATIONS) << "KNotification did not detect any 
running org.freedesktop.Notifications server and fallback notifications cannot 
be used without a QApplication!";
+        return;
+    }
+
     // last fallback - display the popup using KPassivePopup
     KPassivePopup *pop = new KPassivePopup(notification->widget());
     d->passivePopups.insert(notification, pop);


Reply via email to