← Back to team overview

ayatana-commits team mailing list archive

[Branch ~agateau/plasma-indicatordisplay/trunk] Rev 93: Added support for server count

 

------------------------------------------------------------
revno: 93
committer: Aurelien Gateau <aurelien.gateau@xxxxxxxxxxxxx>
branch nick: plasma-indicatordisplay
timestamp: Thu 2009-09-17 15:46:42 +0200
message:
  Added support for server count
modified:
  CMakeLists.txt
  src/listenermodel.cpp
  src/listenermodel.h


--
lp:plasma-indicatordisplay
https://code.launchpad.net/~agateau/plasma-indicatordisplay/trunk

Your team ayatana-commits is subscribed to branch lp:plasma-indicatordisplay.
To unsubscribe from this branch go to https://code.launchpad.net/~agateau/plasma-indicatordisplay/trunk/+edit-subscription.
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt	2009-09-11 15:10:09 +0000
+++ CMakeLists.txt	2009-09-17 13:46:42 +0000
@@ -15,7 +15,7 @@
 find_package(PkgConfig REQUIRED)
 
 # Find libindicate-qt
-pkg_check_modules(INDICATEQT REQUIRED indicate-qt>=0.2.1)
+pkg_check_modules(INDICATEQT REQUIRED indicate-qt>=0.2.2)
 
 include_directories(
     ${KDE4_INCLUDES}

=== modified file 'src/listenermodel.cpp'
--- src/listenermodel.cpp	2009-09-17 12:48:25 +0000
+++ src/listenermodel.cpp	2009-09-17 13:46:42 +0000
@@ -91,6 +91,10 @@
             SIGNAL(serverRemoved(QIndicate::Listener::Server*, const QString&)),
             SLOT(slotServerRemoved(QIndicate::Listener::Server*))
             );
+    connect(d->mListener,
+            SIGNAL(serverCountChanged(QIndicate::Listener::Server*, int)),
+            SLOT(slotServerCountChanged(QIndicate::Listener::Server*, int))
+            );
 
     connect(d->mListener,
             SIGNAL(indicatorAdded(QIndicate::Listener::Server*,
@@ -204,6 +208,17 @@
     removeRow(item->row());
 }
 
+void ListenerModel::slotServerCountChanged(QIndicate::Listener::Server* server, int count)
+{
+    QStandardItem* item = d->mItemForServer.value(server);
+    if (!item) {
+        kWarning() << "No item found for server" << server;
+        return;
+    }
+
+    item->setData(QVariant(count), IndicatorCountRole);
+}
+
 void ListenerModel::slotIndicatorAdded(QIndicate::Listener::Server* server,
                                        QIndicate::Listener::Indicator* indicator)
 {

=== modified file 'src/listenermodel.h'
--- src/listenermodel.h	2009-09-17 12:48:25 +0000
+++ src/listenermodel.h	2009-09-17 13:46:42 +0000
@@ -47,6 +47,7 @@
 
 private Q_SLOTS:
     void slotServerAdded(QIndicate::Listener::Server* server, const QString& type);
+    void slotServerCountChanged(QIndicate::Listener::Server* server, int count);
     void slotServerRemoved(QIndicate::Listener::Server* server);
     void slotDesktopFileReceived(QIndicate::Listener::Server* server, const QByteArray&);