[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:06:20 UTC 2016


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

The following commit has been merged in the master branch:
commit be28fa3db185265a3db7ebffe90fc056f76a5e82
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Wed May 4 16:59:13 2011 +0100

    Check for connection being valid rather than looking at the connection status before calling monitor presence.
    
    There are times when connectionStatus is Connected, but account->connection() returns 0.
    Converted code to call monitorPresence when connectionChanges() not connectionStatusChanges.
    
    Also updated monitorPresence to take a connectionPtr rather than accountPtr as it makes the code easier with this new change.
    
    REVIEW: 101288
    BUG: 271943
---
 main-widget.cpp | 21 +++++++++++----------
 main-widget.h   |  2 +-
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/main-widget.cpp b/main-widget.cpp
index 2a00fab..dae798c 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -301,7 +301,6 @@ void MainWidget::onAccountConnectionStatusChanged(Tp::ConnectionStatus status)
     switch (status) {
     case Tp::ConnectionStatusConnected:
         m_contactsListView->setExpanded(index, true);
-        monitorPresence(account);
         break;
     case Tp::ConnectionStatusDisconnected:
         //Fall through
@@ -358,21 +357,22 @@ void MainWidget::onAccountReady(Tp::PendingOperation *operation)
 {
     Tp::AccountPtr account = Tp::AccountPtr::dynamicCast(operation->object());
 
-    if (account->connectionStatus() == Tp::ConnectionStatusConnected) {
-        monitorPresence(account);
+    if (account->connection()) {
+        monitorPresence(account->connection());
     }
 }
 
-void MainWidget::monitorPresence(const Tp::AccountPtr &account)
+void MainWidget::monitorPresence(const Tp::ConnectionPtr &connection)
 {
-    connect(account->connection()->contactManager().data(), SIGNAL(presencePublicationRequested(Tp::Contacts)),
+    kDebug();
+    connect(connection->contactManager().data(), SIGNAL(presencePublicationRequested(Tp::Contacts)),
             this, SLOT(onPresencePublicationRequested(Tp::Contacts)));
 
-    connect(account->connection()->contactManager().data(),
+    connect(connection->contactManager().data(),
             SIGNAL(stateChanged(Tp::ContactListState)),
             this, SLOT(onContactManagerStateChanged(Tp::ContactListState)));
-    onContactManagerStateChanged(account->connection()->contactManager(),
-                                 account->connection()->contactManager()->state());
+    onContactManagerStateChanged(connection->contactManager(),
+                                 connection->contactManager()->state());
 }
 
 void MainWidget::onContactManagerStateChanged(Tp::ContactListState state)
@@ -416,8 +416,9 @@ void MainWidget::onAccountRemoved()
 
 void MainWidget::onConnectionChanged(const Tp::ConnectionPtr& connection)
 {
-    Q_UNUSED(connection);
-    kDebug();
+    if(! connection.isNull()) {
+        monitorPresence(connection);
+    }
 }
 
 void MainWidget::onContactListDoubleClick(const QModelIndex& index)
diff --git a/main-widget.h b/main-widget.h
index 396c08b..7008590 100644
--- a/main-widget.h
+++ b/main-widget.h
@@ -102,7 +102,7 @@ private Q_SLOTS:
     void onAccountReady(Tp::PendingOperation *operation);
     void onAccountsPresenceStatusFiltered();
     void onPresencePublicationRequested(const Tp::Contacts &contacts);
-    void monitorPresence(const Tp::AccountPtr &account);
+    void monitorPresence(const Tp::ConnectionPtr &connection);
     void onContactManagerStateChanged(Tp::ContactListState state);
     void onContactManagerStateChanged(const Tp::ContactManagerPtr &contactManager, Tp::ContactListState state);
 

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list