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


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

The following commit has been merged in the master branch:
commit ac33ed1afe6919cc1514fb748d36db42af8fc006
Author: George Goldberg <grundleborg at googlemail.com>
Date:   Sun Jul 5 17:46:21 2009 +0000

    Launch the job to create an akonadi agent instance for any telepathy account that doesn't have one.
    
    svn path=/trunk/playground/network/telepathy-integration-daemon/; revision=991805
---
 kpeople/nepomuk-feeder/telepathyaccount.cpp | 20 ++++++++++++++++++++
 kpeople/nepomuk-feeder/telepathyaccount.h   |  3 +++
 2 files changed, 23 insertions(+)

diff --git a/kpeople/nepomuk-feeder/telepathyaccount.cpp b/kpeople/nepomuk-feeder/telepathyaccount.cpp
index 055291f..80626a3 100644
--- a/kpeople/nepomuk-feeder/telepathyaccount.cpp
+++ b/kpeople/nepomuk-feeder/telepathyaccount.cpp
@@ -30,6 +30,7 @@
 // Full Ontologies
 #include "personcontact.h"
 
+#include <Akonadi/AgentInstanceCreateJob>
 #include <Akonadi/AgentManager>
 
 #include <kdebug.h>
@@ -128,6 +129,25 @@ void TelepathyAccount::doAkonadiSetup()
 
     // If we reach here, the agent doesn't exist for this account, so create an instance of it.
     kDebug() << "This telepathy account doesn't already have an Akonadi Resource for it. Create one.";
+
+    Akonadi::AgentType type = Akonadi::AgentManager::self()->type("telepathy_contacts_resource");
+    Akonadi::AgentInstanceCreateJob *job = new Akonadi::AgentInstanceCreateJob(type);
+
+    connect(job, SIGNAL(result(KJob*)), SLOT(onAgentInstanceCreateJobComplete(KJob*)));
+}
+
+void TelepathyAccount::onAgentInstanceCreateJobComplete(KJob *job)
+{
+    Akonadi::AgentInstanceCreateJob *createJob = static_cast<Akonadi::AgentInstanceCreateJob*>(job);
+
+    Q_ASSERT(createJob);
+    if (!createJob) {
+        kWarning() << "createJob is null. This method should only be called as the result of an"
+                   << "Akonadi::AgentInstanceCreateJob.";
+        return;
+    }
+
+    // Check if the job completed successfully.
     // TODO: Implement me!
 }
 
diff --git a/kpeople/nepomuk-feeder/telepathyaccount.h b/kpeople/nepomuk-feeder/telepathyaccount.h
index fe0633c..79b776a 100644
--- a/kpeople/nepomuk-feeder/telepathyaccount.h
+++ b/kpeople/nepomuk-feeder/telepathyaccount.h
@@ -30,6 +30,8 @@ namespace Tp {
     class PendingOperation;
 }
 
+class KJob;
+
 class TelepathyAccountMonitor;
 
 class TelepathyAccount : public QObject
@@ -42,6 +44,7 @@ public:
 
 private Q_SLOTS:
     void onAccountReady(Tp::PendingOperation *op);
+    void onAgentInstanceCreateJobComplete(KJob *job);
 
 private:
     void doNepomukSetup();

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list