[SCM] ktp-contact-list packaging branch, master, updated. debian/15.12.1-2-1070-g6c56f91

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:07:54 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=f26b493

The following commit has been merged in the master branch:
commit f26b493b1cbd2a20647a31e33fc696e5e3d459ae
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date:   Sun Oct 23 22:01:54 2011 +0200

    Use special presence in the contact list global-presence-chooser for 'Now playing...' plugin
    
    Reviewed-by: David Edmundson
    REVIEW: 102950
    BUG: 284078
---
 global-presence-chooser.cpp | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/global-presence-chooser.cpp b/global-presence-chooser.cpp
index 439aeb0..b721594 100644
--- a/global-presence-chooser.cpp
+++ b/global-presence-chooser.cpp
@@ -65,7 +65,7 @@ int PresenceModelPlusConfig::rowCount(const QModelIndex &parent) const
     if (parent.isValid()) {
         return 0;
     }
-    return m_model->rowCount(parent) + 1;
+    return m_model->rowCount(parent) + 2;
 }
 
 QVariant PresenceModelPlusConfig::data(const QModelIndex &index, int role) const
@@ -77,6 +77,13 @@ QVariant PresenceModelPlusConfig::data(const QModelIndex &index, int role) const
         case Qt::DecorationRole:
             return KIcon("configure");
         }
+    } else if (index.row() == rowCount(index.parent())-2) {
+        switch(role) {
+            case Qt::DisplayRole:
+                return i18n("Now listening to...");
+            case Qt::DecorationRole:
+                return KIcon("speaker");
+        }
     } else {
         return m_model->data(m_model->index(index.row()), role);
     }
@@ -130,7 +137,16 @@ void GlobalPresenceChooser::onCurrentIndexChanged(int index)
         CustomPresenceDialog dialog(m_model, this);
         dialog.exec();
         onPresenceChanged(m_globalPresence->currentPresence());
+    } else if (index == count()-2) {
+        QDBusMessage message = QDBusMessage::createSignal(QLatin1String("/Telepathy"),
+                                                          QLatin1String( "org.kde.Telepathy"),
+                                                          QLatin1String("activateNowPlaying"));
+        QDBusConnection::sessionBus().send(message);
     } else {
+        QDBusMessage message = QDBusMessage::createSignal(QLatin1String("/Telepathy"),
+                                                          QLatin1String( "org.kde.Telepathy"),
+                                                          QLatin1String("deactivateNowPlaying"));
+        QDBusConnection::sessionBus().send(message);
         Tp::Presence presence = itemData(index, PresenceModel::PresenceRole).value<Tp::Presence>();
         m_globalPresence->setPresence(presence);
     }

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list