Skip to content

Commit 00f2d5a

Browse files
committed
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.
1 parent bf04e9f commit 00f2d5a

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

TelepathyQt/base-channel.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ namespace Tp
4444
{
4545

4646
struct TP_QT_NO_EXPORT BaseChannel::Private {
47-
Private(BaseChannel *parent, const QDBusConnection &dbusConnection, BaseConnection* connection,
48-
const QString &channelType, uint targetHandle, uint targetHandleType)
47+
Private(BaseChannel *parent, const QDBusConnection &dbusConnection, BaseConnection *connection,
48+
const QString &channelType, uint targetHandleType, uint targetHandle)
4949
: parent(parent),
5050
connection(connection),
5151
channelType(channelType),
52-
targetHandle(targetHandle),
5352
targetHandleType(targetHandleType),
53+
targetHandle(targetHandle),
5454
requested(true),
5555
initiatorHandle(0),
5656
adaptee(new BaseChannel::Adaptee(dbusConnection, parent)) {
@@ -71,9 +71,9 @@ struct TP_QT_NO_EXPORT BaseChannel::Private {
7171
QString channelType;
7272
QHash<QString, AbstractChannelInterfacePtr> interfaces;
7373
QString uniqueName;
74+
uint targetHandleType;
7475
uint targetHandle;
7576
QString targetID;
76-
uint targetHandleType;
7777
bool requested;
7878
uint initiatorHandle;
7979
QString initiatorID;
@@ -121,12 +121,12 @@ void BaseChannel::Adaptee::close(const Tp::Service::ChannelAdaptor::CloseContext
121121
*/
122122

123123
BaseChannel::BaseChannel(const QDBusConnection &dbusConnection,
124-
BaseConnection* connection,
125-
const QString &channelType, uint targetHandle,
126-
uint targetHandleType)
124+
BaseConnection *connection,
125+
const QString &channelType, uint targetHandleType,
126+
uint targetHandle)
127127
: DBusService(dbusConnection),
128128
mPriv(new Private(this, dbusConnection, connection,
129-
channelType, targetHandle, targetHandleType))
129+
channelType, targetHandleType, targetHandle))
130130
{
131131
}
132132

TelepathyQt/base-channel.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ class TP_QT_EXPORT BaseChannel : public DBusService
4545
Q_DISABLE_COPY(BaseChannel)
4646

4747
public:
48-
static BaseChannelPtr create(BaseConnection* connection, const QString &channelType,
49-
uint targetHandle, uint targetHandleType) {
48+
static BaseChannelPtr create(BaseConnection *connection, const QString &channelType,
49+
Tp::HandleType targetHandleType = Tp::HandleTypeNone, uint targetHandle = 0) {
5050
return BaseChannelPtr(new BaseChannel(QDBusConnection::sessionBus(), connection,
51-
channelType, targetHandle, targetHandleType));
51+
channelType, targetHandleType, targetHandle));
5252
}
5353

5454
virtual ~BaseChannel();
@@ -80,8 +80,8 @@ class TP_QT_EXPORT BaseChannel : public DBusService
8080
Q_SIGNALS:
8181
void closed();
8282
protected:
83-
BaseChannel(const QDBusConnection &dbusConnection, BaseConnection* connection,
84-
const QString &channelType, uint targetHandle, uint targetHandleType);
83+
BaseChannel(const QDBusConnection &dbusConnection, BaseConnection *connection,
84+
const QString &channelType, uint targetHandleType, uint targetHandle);
8585
virtual bool registerObject(const QString &busName, const QString &objectPath,
8686
DBusError *error);
8787
private:

0 commit comments

Comments
 (0)