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


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

The following commit has been merged in the master branch:
commit 4462653d9dd6de8fc36e6695ff3c9fac10e958c0
Author: Martin Klapetek <mklapetek at kde.org>
Date:   Sat Apr 4 01:02:47 2015 +0200

    Delay the initialization of the accountUID a bit
    
    Text-ui creates contacts in the channel before the
    Tp::Account::connectionChanged is signaled and the
    accountUID property set, so this delays it to the
    point where it is actually needed.
    
    Proper fix should go to TelepathyQt to emit the signals
    in proper order, but that would be very complex patch.
    So this will have to do for now.
    
    Reviewed-by: David Edmundson
---
 KTp/contact.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/KTp/contact.cpp b/KTp/contact.cpp
index f849428..e7e83e1 100644
--- a/KTp/contact.cpp
+++ b/KTp/contact.cpp
@@ -37,8 +37,6 @@
 KTp::Contact::Contact(Tp::ContactManager *manager, const Tp::ReferencedHandles &handle, const Tp::Features &requestedFeatures, const QVariantMap &attributes)
     : Tp::Contact(manager, handle, requestedFeatures, attributes)
 {
-    m_accountUniqueIdentifier = manager->connection()->property("accountUID").toString();
-
     connect(manager->connection().data(), SIGNAL(destroyed()), SIGNAL(invalidated()));
     connect(manager->connection().data(), SIGNAL(invalidated(Tp::DBusProxy*,QString,QString)), SIGNAL(invalidated()));
     connect(this, SIGNAL(avatarTokenChanged(QString)), SLOT(invalidateAvatarCache()));
@@ -56,6 +54,9 @@ void KTp::Contact::onPresenceChanged(const Tp::Presence &presence)
 
 QString KTp::Contact::accountUniqueIdentifier() const
 {
+    if (m_accountUniqueIdentifier.isEmpty()) {
+        const_cast<KTp::Contact*>(this)->m_accountUniqueIdentifier = manager()->connection()->property("accountUID").toString();
+    }
     return m_accountUniqueIdentifier;
 }
 
@@ -64,7 +65,7 @@ QString KTp::Contact::uri() const
     // so real ID will look like
     // ktp://gabble/jabber/blah/asdfjwer?foo@bar.com
     // ? is used as it is not a valid character in the dbus path that makes up the account UID
-    return QStringLiteral("ktp://") + m_accountUniqueIdentifier + QLatin1Char('?') + id();
+    return QStringLiteral("ktp://") + accountUniqueIdentifier() + QLatin1Char('?') + id();
 }
 
 KTp::Presence KTp::Contact::presence() const

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list