[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=a99ccf7
The following commit has been merged in the master branch:
commit a99ccf719c22d2f904ea8a6520a0b058fb7719b5
Author: Vishesh Handa <handa.vish at gmail.com>
Date: Sat Dec 24 23:54:31 2011 +0530
Use setContactPresence in destroyContact
No point duplicating code.
---
kpeople/nepomuk-feeder/nepomuk-storage.cpp | 30 ++++--------------------------
1 file changed, 4 insertions(+), 26 deletions(-)
diff --git a/kpeople/nepomuk-feeder/nepomuk-storage.cpp b/kpeople/nepomuk-feeder/nepomuk-storage.cpp
index 5987833..296ee53 100644
--- a/kpeople/nepomuk-feeder/nepomuk-storage.cpp
+++ b/kpeople/nepomuk-feeder/nepomuk-storage.cpp
@@ -787,33 +787,11 @@ void NepomukStorage::createContact(const QString &path, const QString &id)
void NepomukStorage::destroyContact(const QString &path, const QString &id)
{
- //vHanda: we could probably just call setContactPresence with a custom "unknown" presense.
- kDebug() << path << id;
- ContactIdentifier identifier(path, id);
-
- // Check if the Contact exists.
- QHash<ContactIdentifier, ContactResources>::const_iterator it = m_contacts.find(identifier);
- const bool found = (it != m_contacts.constEnd());
- Q_ASSERT(found);
- if (!found) {
- kWarning() << "Contact not found.";
- return;
- }
-
- ContactResources resources = it.value();
-
- Nepomuk::SimpleResource imAccount(resources.imAccount());
- imAccount.setProperty(Nepomuk::Vocabulary::NCO::imStatus(), QString::fromLatin1("unknown"));
- imAccount.setProperty(Nepomuk::Vocabulary::Telepathy::statusType(), Tp::ConnectionPresenceTypeUnknown);
+ Tp::SimplePresence presence;
+ presence.status = QLatin1String("unknown");
+ presence.type = Tp::ConnectionPresenceTypeUnknown;
- // We're using 'OverwriteProperties' cause the above properties can already have existing
- // values which we don't care about
- KJob *job = Nepomuk::storeResources( Nepomuk::SimpleResourceGraph() << imAccount,
- Nepomuk::IdentifyNew, Nepomuk::OverwriteProperties );
- job->exec();
- if( job->error() ) {
- kWarning() << job->errorString();
- }
+ setContactPresence(path, id, presence);
}
void NepomukStorage::setContactAlias(const QString &path, const QString &id, const QString &alias)
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list