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


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

The following commit has been merged in the master branch:
commit 4d1c51ef4754b689be7e725d16150a22be02e0db
Author: Vishesh Handa <me at vhanda.in>
Date:   Wed Aug 29 02:42:53 2012 +0530

    Synchronous account creation
    
    This simplifying the code a lot, and the account creation is quite fast,
    so it is not a problem if it is blocking.
---
 kpeople/nepomuk-feeder/nepomuk-storage.cpp | 32 ++++++++++--------------------
 kpeople/nepomuk-feeder/nepomuk-storage.h   |  1 -
 2 files changed, 10 insertions(+), 23 deletions(-)

diff --git a/kpeople/nepomuk-feeder/nepomuk-storage.cpp b/kpeople/nepomuk-feeder/nepomuk-storage.cpp
index e4187e1..358633d 100644
--- a/kpeople/nepomuk-feeder/nepomuk-storage.cpp
+++ b/kpeople/nepomuk-feeder/nepomuk-storage.cpp
@@ -464,7 +464,6 @@ void NepomukStorage::createAccount(const QString &path, const QString &id, const
 
     kDebug() << "Could not find corresponding IMAccount in Nepomuk. Creating a new one.";
 
-    // Add/Update relevant resources
     Nepomuk2::SimpleResource imAccount;
     imAccount.addType(Nepomuk2::Vocabulary::NCO::IMAccount());
     imAccount.addProperty(Nepomuk2::Vocabulary::Telepathy::accountIdentifier(), path);
@@ -474,12 +473,18 @@ void NepomukStorage::createAccount(const QString &path, const QString &id, const
     Nepomuk2::SimpleResource mePersonContact(m_mePersonContact);
     mePersonContact.addProperty(Nepomuk2::Vocabulary::NCO::hasIMAccount(), imAccount);
 
-    m_graph << imAccount << mePersonContact;
-    m_accounts.insert(path, AccountResources(imAccount.uri(), protocol));
+    Nepomuk2::SimpleResourceGraph graph;
+    graph << imAccount << mePersonContact;
 
-    m_unresolvedAccounts << path;
+    Nepomuk2::StoreResourcesJob* job = graph.save();
+    job->exec();
+    if( job->error() ) {
+        kError() << job->error();
+        Q_ASSERT( job->error() );
+    }
 
-    fireGraphTimer();
+    const QUrl imAccountUri = job->mappings().value( imAccount.uri() );
+    m_accounts.insert(path, AccountResources(imAccountUri, protocol));
 }
 
 void NepomukStorage::destroyAccount(const QString &path)
@@ -975,23 +980,6 @@ void NepomukStorage::onContactGraphJob(KJob* job)
 
     m_unresolvedContacts = unresolvedContacts;
 
-    //
-    // Resolve all the accounts
-    //
-    QList<QString> unresolvedAccounts;
-    foreach( const QString& path, m_unresolvedAccounts ) {
-        const AccountResources& res = m_accounts[path];
-        const QUrl accountUri = mappings.value( res.account() );
-
-        if( accountUri.isEmpty() ) {
-            unresolvedAccounts << path;
-            continue;
-        }
-
-        m_accounts[path] = AccountResources(accountUri, res.protocol());
-    }
-    m_unresolvedAccounts = unresolvedAccounts;
-
     emit graphSaved();
 }
 
diff --git a/kpeople/nepomuk-feeder/nepomuk-storage.h b/kpeople/nepomuk-feeder/nepomuk-storage.h
index 78379aa..b14d116 100644
--- a/kpeople/nepomuk-feeder/nepomuk-storage.h
+++ b/kpeople/nepomuk-feeder/nepomuk-storage.h
@@ -161,7 +161,6 @@ private:
     QHash<ContactIdentifier, ContactResources> m_contacts;
 
     QList<ContactIdentifier> m_unresolvedContacts;
-    QList<QString> m_unresolvedAccounts;
 
     Nepomuk2::SimpleResourceGraph m_graph;
     QTimer m_graphTimer;

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list