[SCM] Kingston update notifier (update-notifier-kde) branch, master, updated. bcf726b0decd5ca99e6003a65263ea8cceaef225

Sune Vuorela pusling-guest at alioth.debian.org
Thu Jun 10 12:21:00 UTC 2010


The following commit has been merged in the master branch:
commit ceed0a75d0d22ffe3f6bf214e2132b074a00c8c7
Author: Sune Vuorela <sune at vuorela.dk>
Date:   Thu Jun 10 01:28:30 2010 +0200

    keep a pointer around to the upgrade notification, so that we can close it when spawning a new.
---
 src/notifier.cpp |    5 ++++-
 src/notifier.h   |    3 +++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/notifier.cpp b/src/notifier.cpp
index f719a7a..92404e1 100644
--- a/src/notifier.cpp
+++ b/src/notifier.cpp
@@ -63,14 +63,17 @@ void notifier_t::notify_new_updates(int updates, int security_updates) {
 }
 
 void notifier_t::show_update_notification(const QString& title, const QString& message, const QString& iconname) {
+  if(m_upgrade_notification) {
+    m_upgrade_notification.data()->close();
+  }
   KNotification* note = new KNotification("updatesavailable",0L, KNotification::Persistent);
   note->setTitle(title);
   note->setText(message);
   note->setPixmap(KIcon(iconname).pixmap(QSize(32,32)));
   note->setComponentData(m_component_data);
   note->setActions(QStringList() << i18nc("Do the proposed action (upgrade, reboot, etc) later", "Later"));
-  connect(note,SIGNAL(activated()),note,SLOT(close()));
   note->sendEvent();
+  m_upgrade_notification=note;
   return;
 }
 
diff --git a/src/notifier.h b/src/notifier.h
index f3aad97..5de09c3 100644
--- a/src/notifier.h
+++ b/src/notifier.h
@@ -30,7 +30,9 @@
 #include <QObject>
 
 #include <KComponentData>
+#include <QWeakPointer>
 
+class KNotification;
 class QTimer;
 class notifier_t : public QObject{
   Q_OBJECT
@@ -43,6 +45,7 @@ class notifier_t : public QObject{
     void show_update_notification(const QString& title, const QString& message, const QString& iconname);
     const KComponentData& m_component_data;
     QTimer* m_reboot_nagger;
+    QWeakPointer<KNotification> m_upgrade_notification;
 };
 
 #endif // NOTIFIER_H

-- 
Kingston update notifier (update-notifier-kde)



More information about the pkg-kde-commits mailing list