telepathy-qt: Services/Conn.I.Contacts: Restored full API-compatibility with 0.9.6.

Alexandr Akulich kaffeine at kemper.freedesktop.org
Fri Nov 20 08:40:11 PST 2015


Module: telepathy-qt
Branch: master
Commit: 0ebd71d9a87af7ec3b7a77a79d215e5d7613cb87
URL:    http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=0ebd71d9a87af7ec3b7a77a79d215e5d7613cb87

Author: Alexandr Akulich <akulichalexander at gmail.com>
Date:   Sun Oct 11 14:54:28 2015 +0500

Services/Conn.I.Contacts: Restored full API-compatibility with 0.9.6.

setBaseConnection() overloaded to get connection ptr.

---

 TelepathyQt/base-connection.cpp |   13 +++++++++----
 TelepathyQt/base-connection.h   |   11 ++++++-----
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/TelepathyQt/base-connection.cpp b/TelepathyQt/base-connection.cpp
index d62b031..dd90237 100644
--- a/TelepathyQt/base-connection.cpp
+++ b/TelepathyQt/base-connection.cpp
@@ -948,8 +948,8 @@ void BaseConnectionRequestsInterface::createChannel(const QVariantMap &request,
 // Conn.I.Contacts
 // The BaseConnectionContactsInterface code is fully or partially generated by the TelepathyQt-Generator.
 struct TP_QT_NO_EXPORT BaseConnectionContactsInterface::Private {
-    Private(BaseConnectionContactsInterface *parent, BaseConnection *connection)
-        : connection(connection),
+    Private(BaseConnectionContactsInterface *parent)
+        : connection(0),
           adaptee(new BaseConnectionContactsInterface::Adaptee(parent))
     {
     }
@@ -1014,9 +1014,9 @@ void BaseConnectionContactsInterface::Adaptee::getContactByID(const QString &ide
 /**
  * Class constructor.
  */
-BaseConnectionContactsInterface::BaseConnectionContactsInterface(BaseConnection *connection)
+BaseConnectionContactsInterface::BaseConnectionContactsInterface()
     : AbstractConnectionInterface(TP_QT_IFACE_CONNECTION_INTERFACE_CONTACTS),
-      mPriv(new Private(this, connection))
+      mPriv(new Private(this))
 {
 }
 
@@ -1028,6 +1028,11 @@ BaseConnectionContactsInterface::~BaseConnectionContactsInterface()
     delete mPriv;
 }
 
+void BaseConnectionContactsInterface::setBaseConnection(BaseConnection *connection)
+{
+    mPriv->connection = connection;
+}
+
 /**
  * Return the immutable properties of this interface.
  *
diff --git a/TelepathyQt/base-connection.h b/TelepathyQt/base-connection.h
index 044f0be..bed8b68 100644
--- a/TelepathyQt/base-connection.h
+++ b/TelepathyQt/base-connection.h
@@ -202,15 +202,15 @@ class TP_QT_EXPORT BaseConnectionContactsInterface : public AbstractConnectionIn
     Q_DISABLE_COPY(BaseConnectionContactsInterface)
 
 public:
-    static BaseConnectionContactsInterfacePtr create(BaseConnection *connection)
+    static BaseConnectionContactsInterfacePtr create()
     {
-        return BaseConnectionContactsInterfacePtr(new BaseConnectionContactsInterface(connection));
+        return BaseConnectionContactsInterfacePtr(new BaseConnectionContactsInterface());
     }
     template<typename BaseConnectionContactsInterfaceSubclass>
-    static SharedPtr<BaseConnectionContactsInterfaceSubclass> create(BaseConnection *connection)
+    static SharedPtr<BaseConnectionContactsInterfaceSubclass> create()
     {
         return SharedPtr<BaseConnectionContactsInterfaceSubclass>(
-                new BaseConnectionContactsInterfaceSubclass(connection));
+                new BaseConnectionContactsInterfaceSubclass());
     }
 
     virtual ~BaseConnectionContactsInterface();
@@ -227,7 +227,8 @@ public:
     void getContactByID(const QString &identifier, const QStringList &interfaces, uint &handle, QVariantMap &attributes, DBusError *error);
 
 protected:
-    BaseConnectionContactsInterface(BaseConnection *connection);
+    BaseConnectionContactsInterface();
+    void setBaseConnection(BaseConnection *connection);
 
 private:
     void createAdaptor();



More information about the telepathy-commits mailing list