[SCM] ktp-accounts-kcm packaging branch, master, updated. debian/15.12.1-1-1157-gc4589c5

Maximiliano Curia maxy at moszumanska.debian.org
Fri May 27 23:57:06 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-accounts-kcm.git;a=commitdiff;h=f394ae9

The following commit has been merged in the master branch:
commit f394ae9c6a3226ff1661369682e6effc0e9e72dc
Author: George Goldberg <grundleborg at googlemail.com>
Date:   Mon Jan 26 20:39:29 2009 +0000

    Once the accountmanager is ready, load up all the accounts and get them ready too.
    
    svn path=/trunk/playground/network/telepathy-accounts-kcm/; revision=917084
---
 src/kcm-telepathy-accounts.cpp | 34 +++++++++++++++++++++++++++++++---
 src/kcm-telepathy-accounts.h   |  1 +
 2 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/src/kcm-telepathy-accounts.cpp b/src/kcm-telepathy-accounts.cpp
index a7e4177..596e5fb 100644
--- a/src/kcm-telepathy-accounts.cpp
+++ b/src/kcm-telepathy-accounts.cpp
@@ -23,6 +23,7 @@
 #include <kcategorizedsortfilterproxymodel.h>
 #include <kgenericfactory.h>
 
+#include <TelepathyQt4/Client/Account>
 #include <TelepathyQt4/Client/AccountManager>
 #include <TelepathyQt4/Client/PendingOperation>
 
@@ -67,18 +68,45 @@ void KCMTelepathyAccounts::startAccountManager()
 
 void KCMTelepathyAccounts::startAccountManagerFinished(Telepathy::Client::PendingOperation *op)
 {
+    disconnect(op, SIGNAL(finished(Telepathy::Client::PendingOperation*)),
+            this, SLOT(startAccountManagerFinished(Telepathy::Client::PendingOperation*)));
+
     Q_ASSERT(op->isFinished());
     if(op->isError())
     {
-        kDebug() << "An error occurred setting up the AccountManager.";
+        kDebug() << "An error occurred making the AccountManager ready.";
         return;
     }
     else
     {
-        kDebug() << "AccountManager set up successfully.";
+        kDebug() << "AccountManager became ready successfully.";
+    }
+
+    QList<Telepathy::Client::Account*> accounts = m_accountManager->allAccounts();
+    foreach(Telepathy::Client::Account* account, accounts)
+    {
+        connect(account->becomeReady(), SIGNAL(finished(Telepathy::Client::PendingOperation*)),
+                this, SLOT(onAccountReady(Telepathy::Client::PendingOperation*)));
+    }
+}
+
+void KCMTelepathyAccounts::onAccountReady(Telepathy::Client::PendingOperation *op)
+{
+    disconnect(op, SIGNAL(finished(Telepathy::Client::PendingOperation*)),
+            this, SLOT(onAccountReady(Telepathy::Client::PendingOperation*)));
+
+    Q_ASSERT(op->isFinished());
+    if(op->isError())
+    {
+        kDebug() << "An error occurred in making and Account ready.";
+    }
+    else
+    {
+        kDebug() << "An Account became ready successfully.";
     }
 
-    // TODO: Load the model up with Accounts from the Account Manager.
+    // TODO: Add the account to the model.
+    // FIXME: Need to get the AccountManager::allAccounts() API fixed before can continue easily.
 }
 
 
diff --git a/src/kcm-telepathy-accounts.h b/src/kcm-telepathy-accounts.h
index faba8d5..295a2a8 100644
--- a/src/kcm-telepathy-accounts.h
+++ b/src/kcm-telepathy-accounts.h
@@ -50,6 +50,7 @@ public Q_SLOTS:
 private Q_SLOTS:
     void startAccountManager();
     void startAccountManagerFinished(Telepathy::Client::PendingOperation *op);
+    void onAccountReady(Telepathy::Client::PendingOperation *op);
 
 private:
     KCategorizedSortFilterProxyModel *m_accountsListProxyModel;

-- 
ktp-accounts-kcm packaging



More information about the pkg-kde-commits mailing list