[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9

Maximiliano Curia maxy at moszumanska.debian.org
Mon May 9 09:04:23 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=135ceab

The following commit has been merged in the master branch:
commit 135ceabb2621967f63b50e80547a35cac1c971ad
Author: George Goldberg <grundleborg at googlemail.com>
Date:   Sun Jun 21 09:30:51 2009 +0000

    We should get the Telepathy Account ready before starting to check it's in Nepomuk.
    
    svn path=/trunk/playground/network/telepathy-integration-daemon/; revision=984615
---
 kpeople/nepomuk-feeder/telepathyaccount.cpp        | 33 +++++++++++++++++++---
 kpeople/nepomuk-feeder/telepathyaccount.h          | 13 ++++++++-
 kpeople/nepomuk-feeder/telepathyaccountmonitor.cpp |  5 ++++
 kpeople/nepomuk-feeder/telepathyaccountmonitor.h   |  2 ++
 4 files changed, 48 insertions(+), 5 deletions(-)

diff --git a/kpeople/nepomuk-feeder/telepathyaccount.cpp b/kpeople/nepomuk-feeder/telepathyaccount.cpp
index ee07960..b7c1781 100644
--- a/kpeople/nepomuk-feeder/telepathyaccount.cpp
+++ b/kpeople/nepomuk-feeder/telepathyaccount.cpp
@@ -22,25 +22,50 @@
 
 #include "nco.h"
 #include "pimo.h"
+#include "telepathyaccountmonitor.h"
 #include "tpaccount.h"
 
+#include <kdebug.h>
+
 #include <Nepomuk/Thing>
 #include <Nepomuk/Variant>
 
-TelepathyAccount::TelepathyAccount(const QString &path, QObject *parent)
+#include <TelepathyQt4/PendingOperation>
+#include <TelepathyQt4/PendingReady>
+
+TelepathyAccount::TelepathyAccount(const QString &path, TelepathyAccountMonitor *parent)
  : QObject(parent),
+   m_parent(parent),
    m_path(path)
 {
-    // FIXME: Check there is an akonadi resource for this account, and create one if not.
+    // We need to get the Tp::Account ready before we do any other stuff.
+    m_account = m_parent->accountManager()->accountForPath(path);
 
-    // Check that this Account is set up in nepomuk.
-    doNepomukSetup();
+    Tp::Features features;
+    features << Tp::Account::FeatureCore
+             << Tp::Account::FeatureProtocolInfo;
+
+    connect(m_account->becomeReady(features),
+            SIGNAL(finished(Tp::PendingOperation*)),
+            SLOT(onAccountReady(Tp::PendingOperation*)));
 }
 
 TelepathyAccount::~TelepathyAccount()
 {
 }
 
+void TelepathyAccount::onAccountReady(Tp::PendingOperation *op)
+{
+   if (op->isError()) {
+        kWarning() << "Account" << m_path << "cannot become ready:"
+                   << op->errorName() << "-" << op->errorMessage();
+        return;
+    }
+
+    // Check that this Account is set up in nepomuk.
+    doNepomukSetup();
+}
+
 void TelepathyAccount::doNepomukSetup()
 {
     // Get the PIMO:Person for "me" from nepomuk
diff --git a/kpeople/nepomuk-feeder/telepathyaccount.h b/kpeople/nepomuk-feeder/telepathyaccount.h
index 4681a1d..d6203af 100644
--- a/kpeople/nepomuk-feeder/telepathyaccount.h
+++ b/kpeople/nepomuk-feeder/telepathyaccount.h
@@ -24,20 +24,31 @@
 #include <QtCore/QObject>
 #include <QtCore/QString>
 
+#include <TelepathyQt4/Account>
+
+namespace Tp {
+    class PendingOperation;
+}
+
+class TelepathyAccountMonitor;
+
 class TelepathyAccount : public QObject
 {
     Q_OBJECT
 
 public:
-    TelepathyAccount(const QString &path, QObject *parent = 0);
+    TelepathyAccount(const QString &path, TelepathyAccountMonitor *parent = 0);
     ~TelepathyAccount();
 
 private Q_SLOTS:
+    void onAccountReady(Tp::PendingOperation *op);
 
 private:
     void doNepomukSetup();
 
+    TelepathyAccountMonitor *m_parent;
     QString m_path;
+    Tp::AccountPtr m_account;
 };
 
 
diff --git a/kpeople/nepomuk-feeder/telepathyaccountmonitor.cpp b/kpeople/nepomuk-feeder/telepathyaccountmonitor.cpp
index d07bc33..921a6b3 100644
--- a/kpeople/nepomuk-feeder/telepathyaccountmonitor.cpp
+++ b/kpeople/nepomuk-feeder/telepathyaccountmonitor.cpp
@@ -39,6 +39,11 @@ TelepathyAccountMonitor::~TelepathyAccountMonitor()
 {
 }
 
+Tp::AccountManagerPtr TelepathyAccountMonitor::accountManager()
+{
+    return m_accountManager;
+}
+
 void TelepathyAccountMonitor::onAccountManagerReady(Tp::PendingOperation *op)
 {
     if (op->isError()) {
diff --git a/kpeople/nepomuk-feeder/telepathyaccountmonitor.h b/kpeople/nepomuk-feeder/telepathyaccountmonitor.h
index c0e1639..169d34f 100644
--- a/kpeople/nepomuk-feeder/telepathyaccountmonitor.h
+++ b/kpeople/nepomuk-feeder/telepathyaccountmonitor.h
@@ -41,6 +41,8 @@ public:
     explicit TelepathyAccountMonitor(QObject *parent = 0);
     ~TelepathyAccountMonitor();
 
+    Tp::AccountManagerPtr accountManager();
+
 private Q_SLOTS:
     void onAccountManagerReady(Tp::PendingOperation *op);
     void onAccountCreated(const QString &path);

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list