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


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

The following commit has been merged in the master branch:
commit 13c51b3705d9cbd421994e24acc14a59fd3a26ac
Author: Vishesh Handa <handa.vish at gmail.com>
Date:   Sat Dec 24 22:43:37 2011 +0530

    Delete all the accounts which no longer exist
    
    Also delete all the sub resources. If someone else is using any of
    those sub-resources then the DMS will handle the deletions. The
    only thing one should do is add the contacts as sub-resources
    of the account.
---
 kpeople/nepomuk-feeder/nepomuk-storage.cpp | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/kpeople/nepomuk-feeder/nepomuk-storage.cpp b/kpeople/nepomuk-feeder/nepomuk-storage.cpp
index 178558b..5987833 100644
--- a/kpeople/nepomuk-feeder/nepomuk-storage.cpp
+++ b/kpeople/nepomuk-feeder/nepomuk-storage.cpp
@@ -556,16 +556,25 @@ void NepomukStorage::cleanupAccounts(const QList<QString> &paths)
 
     // Go through all our accounts and remove all the ones that are not there in the path
     // list given by the controller
-    foreach (const QString &aid, m_accounts.keys()) {
-        if (!pathSet.contains(aid)) {
-
-            kWarning() << "Should remove : " << aid << m_accounts.value(aid).account();
-            // TODO: Do this properly once the ontology supports this
-            // TODO: Do this as a batch job to reduce the number of nepomuk queries that result.
-            // TODO: What do we do with an account in nepomuk which the use has removed?
+    QList<QUrl> removedAccounts;
+    QMutableHashIterator<QString, AccountResources> it( m_accounts );
+    while( it.hasNext() ) {
+        it.next();
+        if (!pathSet.contains(it.key())) {
+            removedAccounts << it.value().account();
+            it.remove();
         }
     }
 
+    // TODO: Do this properly once the ontology supports this
+    // TODO: What do we do with an account in nepomuk which the use has removed?
+    //       For now we're just deleting them
+    KJob *job = Nepomuk::removeResources( removedAccounts, Nepomuk::RemoveSubResoures );
+    job->exec();
+    if( job->error() ) {
+        kWarning() << job->errorString();
+    }
+
     // Go through all the accounts that we have received from the controller and create any
     // new ones in neponmuk. Do this as a batch job to improve performance.
     foreach (const QString &path, paths) {
@@ -746,6 +755,7 @@ void NepomukStorage::createContact(const QString &path, const QString &id)
     newPimoPerson.addType(Nepomuk::Vocabulary::PIMO::Person());
 
     Nepomuk::SimpleResource newImAccount;
+    //TODO: Somehow add this imAccount as a sub resource the account, maybe.
     newImAccount.addType(Nepomuk::Vocabulary::NCO::IMAccount());
     newImAccount.setProperty(Nepomuk::Vocabulary::NCO::imStatus(), QString::fromLatin1("unknown"));
     newImAccount.setProperty(Nepomuk::Vocabulary::NCO::imID(), id);

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list