[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:35 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=ab04b76
The following commit has been merged in the master branch:
commit ab04b7664a2b8fdd3e7c1760b47cdd028690c186
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date: Sun Feb 10 00:36:54 2013 +0100
Improve contacts removing by directly getting ids from Nepomuk
This ensures that contacts of offline accounts will be properly
removed from Nepomuk.
REVIEW: 108869
---
kpeople/nepomuk-feeder/nepomuk-storage.cpp | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/kpeople/nepomuk-feeder/nepomuk-storage.cpp b/kpeople/nepomuk-feeder/nepomuk-storage.cpp
index bc34010..224c778 100644
--- a/kpeople/nepomuk-feeder/nepomuk-storage.cpp
+++ b/kpeople/nepomuk-feeder/nepomuk-storage.cpp
@@ -549,15 +549,16 @@ void NepomukStorage::onAccountRemoved(const QString &path)
QList<QUrl> urisToDelete;
urisToDelete << accountUri;
- QList<ContactIdentifier> keys = m_contacts.keys(); // Splitting it so that the keys do not need to be reconstructed each time
-
- for (int i = 0; i < m_contacts.keys().size(); i++) {
- ContactIdentifier ci = keys.at(i);
- if (ci.accountId() == path) {
- ContactResources cr = m_contacts.value(ci);
- urisToDelete << cr.personContact();
- urisToDelete << cr.imAccount();
- }
+ QString query = QString::fromLatin1("select DISTINCT ?uri ?a "
+ "WHERE { "
+ "?uri a nco:PersonContact. "
+ "?uri nco:hasIMAccount ?a . "
+ "?a nco:isAccessedBy %1 . }").arg(Soprano::Node::resourceToN3(accountUri));
+
+ Soprano::Model *model = Nepomuk2::ResourceManager::instance()->mainModel();
+ Soprano::QueryResultIterator it = model->executeQuery(query, Soprano::Query::QueryLanguageSparql);
+ while (it.next()) {
+ urisToDelete << it["uri"].uri() << it["a"].uri();
}
KJob *removeJob = Nepomuk2::removeDataByApplication(urisToDelete);
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list