[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:18:33 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=c196051

The following commit has been merged in the master branch:
commit c196051b61261a96f9e9beafc286835b8e4e3e34
Author: George Kiagiadakis <george.kiagiadakis at collabora.co.uk>
Date:   Sun Jan 30 19:50:40 2011 +0200

    Fix the contactPresenceChanged signal to actually notify us about presence changes.
---
 lib/channelcontactlist.cpp | 13 ++++++-------
 lib/channelcontactlist.h   |  7 ++++---
 lib/chatwindow.cpp         | 13 ++++++-------
 lib/chatwindow.h           |  4 ++--
 4 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/lib/channelcontactlist.cpp b/lib/channelcontactlist.cpp
index 3112890..4657c27 100644
--- a/lib/channelcontactlist.cpp
+++ b/lib/channelcontactlist.cpp
@@ -40,15 +40,14 @@ ChannelContactListContact::ChannelContactListContact(const Tp::ContactPtr & cont
     : QObject(parent)
 {
     m_contact = contact;
-    connect(m_contact.data(), SIGNAL(simplePresenceChanged(QString,uint,QString)),
-            SLOT(onSimplePresenceChanged(QString,uint)));
+    connect(m_contact.data(), SIGNAL(presenceChanged(Tp::Presence)),
+            SLOT(onPresenceChanged(Tp::Presence)));
     connect(m_contact.data(), SIGNAL(aliasChanged(QString)), SLOT(onAliasChanged(QString)));
 }
 
-void ChannelContactListContact::onSimplePresenceChanged(const QString &status, uint type)
+void ChannelContactListContact::onPresenceChanged(const Tp::Presence & presence)
 {
-    Q_UNUSED(status);
-    Q_EMIT contactPresenceChanged(m_contact, type);
+    Q_EMIT contactPresenceChanged(m_contact, presence);
 }
 
 void ChannelContactListContact::onAliasChanged(const QString &alias)
@@ -62,8 +61,8 @@ ChannelContactList::ChannelContactList(const Tp::TextChannelPtr & channel, QObje
     foreach(Tp::ContactPtr contact, channel->groupContacts()) {
         //FIXME move this to a slot called "addContact" - also call this when chat gains a person.
         ChannelContactListContact*  contactProxy = new ChannelContactListContact(contact, this);
-        connect(contactProxy, SIGNAL(contactPresenceChanged(Tp::ContactPtr,uint)),
-                SIGNAL(contactPresenceChanged(Tp::ContactPtr,uint)));
+        connect(contactProxy, SIGNAL(contactPresenceChanged(Tp::ContactPtr,Tp::Presence)),
+                SIGNAL(contactPresenceChanged(Tp::ContactPtr,Tp::Presence)));
         connect(contactProxy, SIGNAL(contactAliasChanged(Tp::ContactPtr,QString)),
                 SIGNAL(contactAliasChanged(Tp::ContactPtr,QString)));
     }
diff --git a/lib/channelcontactlist.h b/lib/channelcontactlist.h
index a990ba1..37f29e6 100644
--- a/lib/channelcontactlist.h
+++ b/lib/channelcontactlist.h
@@ -25,6 +25,7 @@
 #include <TelepathyQt4/Contact>
 #include <TelepathyQt4/Types>
 #include <TelepathyQt4/Channel>
+#include <TelepathyQt4/Presence>
 
 class ChannelContactListContact: public QObject
 {
@@ -33,11 +34,11 @@ public:
     explicit ChannelContactListContact(const Tp::ContactPtr & contact, QObject *parent);
 
 signals:
-    void contactPresenceChanged(const Tp::ContactPtr & contact, uint type);
+    void contactPresenceChanged(const Tp::ContactPtr & contact, const Tp::Presence & presence);
     void contactAliasChanged(const Tp::ContactPtr & contact, const QString & alias);
 
 private slots:
-    void onSimplePresenceChanged(const QString &status, uint type);
+    void onPresenceChanged(const Tp::Presence & newPresence);
     void onAliasChanged(const QString &alias);
 
 private:
@@ -52,7 +53,7 @@ public:
     explicit ChannelContactList(const Tp::TextChannelPtr & channel, QObject *parent = 0);
 
 signals:
-    void contactPresenceChanged(const Tp::ContactPtr & contact, uint type);
+    void contactPresenceChanged(const Tp::ContactPtr & contact, const Tp::Presence & presence);
     void contactAliasChanged(const Tp::ContactPtr & contact, const QString & alias);
 
 public slots:
diff --git a/lib/chatwindow.cpp b/lib/chatwindow.cpp
index c16bac8..2f6a093 100644
--- a/lib/chatwindow.cpp
+++ b/lib/chatwindow.cpp
@@ -125,8 +125,8 @@ void ChatWindow::init()
 
     //channel is now valid, start keeping track of contacts.
     ChannelContactList* contactList = new ChannelContactList(d->channel, this);
-    connect(contactList, SIGNAL(contactPresenceChanged(Tp::ContactPtr,uint)),
-            SLOT(onContactPresenceChange(Tp::ContactPtr,uint)));
+    connect(contactList, SIGNAL(contactPresenceChanged(Tp::ContactPtr,Tp::Presence)),
+            SLOT(onContactPresenceChange(Tp::ContactPtr,Tp::Presence)));
 
     AdiumThemeHeaderInfo info;
     Tp::Contacts allContacts = d->channel->groupContacts();
@@ -380,12 +380,12 @@ void ChatWindow::onChatStatusChanged(const Tp::ContactPtr & contact, Tp::Channel
 
 
 
-void ChatWindow::onContactPresenceChange(const Tp::ContactPtr & contact, uint type)
+void ChatWindow::onContactPresenceChange(const Tp::ContactPtr & contact, const Tp::Presence & presence)
 {
     QString message;
     bool isYou = (contact == d->channel->groupSelfContact());
 
-    switch (type) {
+    switch (presence.type()) {
     case Tp::ConnectionPresenceTypeOffline:
         if (!isYou) {
             message = i18n("%1 is offline", contact->alias());
@@ -421,10 +421,9 @@ void ChatWindow::onContactPresenceChange(const Tp::ContactPtr & contact, uint ty
         d->ui.chatArea->addStatusMessage(statusMessage);
     }
 
-
     //if in a non-group chat situation, and the other contact has changed state...
     if (!d->isGroupChat && !isYou) {
-        KIcon icon = iconForPresence(type);
+        KIcon icon = iconForPresence(presence.type());
         Q_EMIT iconChanged(icon);
     }
 }
@@ -450,7 +449,7 @@ void ChatWindow::onFormatColorReleased()
     d->ui.sendMessageBox->setTextColor(color);
 }
 
-KIcon ChatWindow::iconForPresence(uint presence)
+KIcon ChatWindow::iconForPresence(Tp::ConnectionPresenceType presence)
 {
     QString iconName;
 
diff --git a/lib/chatwindow.h b/lib/chatwindow.h
index 522e611..4925a98 100644
--- a/lib/chatwindow.h
+++ b/lib/chatwindow.h
@@ -56,7 +56,7 @@ protected slots:
 
     void onChatStatusChanged(const Tp::ContactPtr & contact, Tp::ChannelChatState state);
 
-    void onContactPresenceChange(const Tp::ContactPtr & contact, uint type);
+    void onContactPresenceChange(const Tp::ContactPtr & contact, const Tp::Presence & presence);
 
     void onInputBoxChanged();
 
@@ -81,7 +81,7 @@ private slots:
 private:
     void init();
     //FIXME this should be in the ktelepathy lib
-    static KIcon iconForPresence(uint presence);
+    static KIcon iconForPresence(Tp::ConnectionPresenceType presence);
 
     ChatWindowPrivate * const d;
 };

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list