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


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

The following commit has been merged in the master branch:
commit e2655a82460dcdae82772fb393bf472a0164dc06
Author: George Goldberg <grundleborg at googlemail.com>
Date:   Sat Feb 13 16:35:28 2010 +0000

    Fix bug with properties on the AccountResource getting set before we have determined if it already is in Nepomuk or not.
    
    svn path=/trunk/playground/network/telepathy-integration-daemon/; revision=1089650
---
 kpeople/nepomuk-feeder/telepathyaccount.cpp | 35 ++++++++++++++++++-----------
 1 file changed, 22 insertions(+), 13 deletions(-)

diff --git a/kpeople/nepomuk-feeder/telepathyaccount.cpp b/kpeople/nepomuk-feeder/telepathyaccount.cpp
index 1209882..a133ffc 100644
--- a/kpeople/nepomuk-feeder/telepathyaccount.cpp
+++ b/kpeople/nepomuk-feeder/telepathyaccount.cpp
@@ -88,6 +88,8 @@ void TelepathyAccount::onAccountReady(Tp::PendingOperation *op)
         return;
     }
 
+    kDebug() << this;
+
     // Check that this Account is set up in nepomuk.
     doNepomukSetup();
 
@@ -99,6 +101,7 @@ void TelepathyAccount::onAccountReady(Tp::PendingOperation *op)
 
 void TelepathyAccount::doNepomukSetup()
 {
+    kDebug() << this;
     // Get a copy of the "me" PersonContact.
     Nepomuk::PersonContact mePersonContact = m_parent->mePersonContact();
 
@@ -115,7 +118,7 @@ void TelepathyAccount::doNepomukSetup()
     // Iterate over all the IMAccounts found.
     while(it.next()) {
         Nepomuk::IMAccount foundImAccount(it.binding("a").uri());
-        kDebug() << "Found IM Account: " << foundImAccount.uri();
+        kDebug() << this << ": Found IM Account: " << foundImAccount.uri();
 
         // See if the Account has the same Telepathy Account Identifier as the account this
         // TelepathyAccount instance has been created to look after.
@@ -130,10 +133,10 @@ void TelepathyAccount::doNepomukSetup()
 
         // Exactly one identifier found. Check if it matches the one we are looking for.
         QString accountIdentifier = accountIdentifiers.first();
-        kDebug() << "Account Identifier:" << accountIdentifier;
+        kDebug() << this << ": Account Identifier:" << accountIdentifier;
 
         if (accountIdentifier == m_path) {
-            kDebug() << "Found the corresponding IMAccount in Nepomuk.";
+            kDebug() << this << ": Found the corresponding IMAccount in Nepomuk.";
                 // It matches, so set our member variable to it and stop looping.
                 m_accountResource = foundImAccount;
 
@@ -149,8 +152,8 @@ void TelepathyAccount::doNepomukSetup()
     }
 
     // If the accountResource is still empty, create a new IMAccount.
-    if (m_accountResource == Nepomuk::IMAccount()) {
-        kDebug() << "Could not find corresponding IMAccount in Nepomuk. Creating a new one.";
+    if (m_accountResource.uri().isEmpty()) {
+        kDebug() << this << ": Could not find corresponding IMAccount in Nepomuk. Creating a new one.";
 
         m_accountResource.addProperty(Nepomuk::Vocabulary::NCO::imAccountType(),
                                       m_account->protocol());
@@ -252,18 +255,24 @@ void TelepathyAccount::onContactsUpgraded(Tp::PendingOperation* op)
 
 void TelepathyAccount::onNicknameChanged(const QString& nickname)
 {
-    m_accountResource.setProperty(Nepomuk::Vocabulary::NCO::imNickname(),
-                                  nickname);
+    // Do not update any property on the account resource if it hasn't yet been created.
+    if (!m_accountResource.uri().isEmpty()) {
+        m_accountResource.setProperty(Nepomuk::Vocabulary::NCO::imNickname(),
+                                      nickname);
+    }
 }
 
 void TelepathyAccount::onCurrentPresenceChanged(Tp::SimplePresence presence)
 {
-    m_accountResource.setProperty(Nepomuk::Vocabulary::NCO::imStatus(),
-                                  presence.status);
-    m_accountResource.setProperty(Nepomuk::Vocabulary::NCO::imStatusMessage(),
-                                  presence.statusMessage);
-    m_accountResource.setProperty(Nepomuk::Vocabulary::Telepathy::statusType(),
-                                  presence.type);
+    // Do not update any property on the account resource if it hasn't yet been created.
+    if (!m_accountResource.uri().isEmpty()) {
+        m_accountResource.setProperty(Nepomuk::Vocabulary::NCO::imStatus(),
+                                      presence.status);
+        m_accountResource.setProperty(Nepomuk::Vocabulary::NCO::imStatusMessage(),
+                                      presence.statusMessage);
+        m_accountResource.setProperty(Nepomuk::Vocabulary::Telepathy::statusType(),
+                                      presence.type);
+    }
 }
 
 

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list