telepathy-qt: BaseChannel::create() arguments reordered in natural way.

Alexandr Akulich kaffeine at kemper.freedesktop.org
Wed May 6 01:10:28 PDT 2015


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

Author: Alexandr Akulich <akulichalexander at gmail.com>
Date:   Tue Apr 21 00:12:13 2015 +0500

BaseChannel::create() arguments reordered in natural way.

1) Swapped targetHandle and targetHandleType arguments.
2) Type of the targetHandleType changed to Tp::HandleType to
   force compilation error.
3) Added default values: targetHandleType = Tp::HandleTypeNone,
   targetHandle = 0.

---

 TelepathyQt/base-channel.cpp |   16 ++++++++--------
 TelepathyQt/base-channel.h   |   10 +++++-----
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/TelepathyQt/base-channel.cpp b/TelepathyQt/base-channel.cpp
index 6687e52..83cfffc 100644
--- a/TelepathyQt/base-channel.cpp
+++ b/TelepathyQt/base-channel.cpp
@@ -44,13 +44,13 @@ namespace Tp
 {
 
 struct TP_QT_NO_EXPORT BaseChannel::Private {
-    Private(BaseChannel *parent, const QDBusConnection &dbusConnection, BaseConnection* connection,
-            const QString &channelType, uint targetHandle, uint targetHandleType)
+    Private(BaseChannel *parent, const QDBusConnection &dbusConnection, BaseConnection *connection,
+            const QString &channelType, uint targetHandleType, uint targetHandle)
         : parent(parent),
           connection(connection),
           channelType(channelType),
-          targetHandle(targetHandle),
           targetHandleType(targetHandleType),
+          targetHandle(targetHandle),
           requested(true),
           initiatorHandle(0),
           adaptee(new BaseChannel::Adaptee(dbusConnection, parent)) {
@@ -71,9 +71,9 @@ struct TP_QT_NO_EXPORT BaseChannel::Private {
     QString channelType;
     QHash<QString, AbstractChannelInterfacePtr> interfaces;
     QString uniqueName;
+    uint targetHandleType;
     uint targetHandle;
     QString targetID;
-    uint targetHandleType;
     bool requested;
     uint initiatorHandle;
     QString initiatorID;
@@ -121,12 +121,12 @@ void BaseChannel::Adaptee::close(const Tp::Service::ChannelAdaptor::CloseContext
  */
 
 BaseChannel::BaseChannel(const QDBusConnection &dbusConnection,
-                         BaseConnection* connection,
-                         const QString &channelType, uint targetHandle,
-                         uint targetHandleType)
+                         BaseConnection *connection,
+                         const QString &channelType, uint targetHandleType,
+                         uint targetHandle)
     : DBusService(dbusConnection),
       mPriv(new Private(this, dbusConnection, connection,
-                        channelType, targetHandle, targetHandleType))
+                        channelType, targetHandleType, targetHandle))
 {
 }
 
diff --git a/TelepathyQt/base-channel.h b/TelepathyQt/base-channel.h
index 5b7d3e2..0b44b6d 100644
--- a/TelepathyQt/base-channel.h
+++ b/TelepathyQt/base-channel.h
@@ -45,10 +45,10 @@ class TP_QT_EXPORT BaseChannel : public DBusService
     Q_DISABLE_COPY(BaseChannel)
 
 public:
-    static BaseChannelPtr create(BaseConnection* connection, const QString &channelType,
-                                 uint targetHandle, uint targetHandleType) {
+    static BaseChannelPtr create(BaseConnection *connection, const QString &channelType,
+                                 Tp::HandleType targetHandleType = Tp::HandleTypeNone, uint targetHandle = 0) {
         return BaseChannelPtr(new BaseChannel(QDBusConnection::sessionBus(), connection,
-                                              channelType, targetHandle, targetHandleType));
+                                              channelType, targetHandleType, targetHandle));
     }
 
     virtual ~BaseChannel();
@@ -80,8 +80,8 @@ public:
 Q_SIGNALS:
     void closed();
 protected:
-    BaseChannel(const QDBusConnection &dbusConnection, BaseConnection* connection,
-                const QString &channelType, uint targetHandle, uint targetHandleType);
+    BaseChannel(const QDBusConnection &dbusConnection, BaseConnection *connection,
+                const QString &channelType, uint targetHandleType, uint targetHandle);
     virtual bool registerObject(const QString &busName, const QString &objectPath,
                                 DBusError *error);
 private:



More information about the telepathy-commits mailing list