From kaffeine at kemper.freedesktop.org Wed May 2 17:52:29 2018 From: kaffeine at kemper.freedesktop.org (Alexandr Akulich) Date: Wed, 2 May 2018 17:52:29 +0000 (UTC) Subject: telepathy-qt: =?UTF-8?Q?Register=20object=20befor?= =?UTF-8?Q?e=20the=20service=20gets=20ex?= =?UTF-8?Q?posed=20on=20DBus?= Message-ID: <20180502175229.A8BA5761B8@kemper.freedesktop.org> Module: telepathy-qt Branch: master Commit: f81ae2d33ff36baa7938b4f89fa51372c9ff1fcc URL: http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=f81ae2d33ff36baa7938b4f89fa51372c9ff1fcc Author: Gustavo Pichorim Boiko Date: Tue Nov 22 14:37:37 2016 -0200 Register object before the service gets exposed on DBus Reviewed-by: Alexandr Akulich --- TelepathyQt/dbus-service.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/TelepathyQt/dbus-service.cpp b/TelepathyQt/dbus-service.cpp index c6dcab84..fa393635 100644 --- a/TelepathyQt/dbus-service.cpp +++ b/TelepathyQt/dbus-service.cpp @@ -164,15 +164,6 @@ bool DBusService::registerObject(const QString &busName, const QString &objectPa return true; } - if (!mPriv->dbusObject->dbusConnection().registerService(busName)) { - error->set(TP_QT_ERROR_INVALID_ARGUMENT, - QString(QLatin1String("Name %1 already in use by another process")) - .arg(busName)); - warning() << "Unable to register service" << busName << - "- name already registered by another process"; - return false; - } - if (!mPriv->dbusObject->dbusConnection().registerObject(objectPath, mPriv->dbusObject)) { error->set(TP_QT_ERROR_INVALID_ARGUMENT, QString(QLatin1String("Object at path %1 already registered")) @@ -182,6 +173,16 @@ bool DBusService::registerObject(const QString &busName, const QString &objectPa return false; } + if (!mPriv->dbusObject->dbusConnection().registerService(busName)) { + mPriv->dbusObject->dbusConnection().unregisterObject(objectPath); + error->set(TP_QT_ERROR_INVALID_ARGUMENT, + QString(QLatin1String("Name %1 already in use by another process")) + .arg(busName)); + warning() << "Unable to register service" << busName << + "- name already registered by another process"; + return false; + } + debug() << "Registered object" << objectPath << "at bus name" << busName; mPriv->busName = busName; From kaffeine at kemper.freedesktop.org Wed May 2 17:52:29 2018 From: kaffeine at kemper.freedesktop.org (Alexandr Akulich) Date: Wed, 2 May 2018 17:52:29 +0000 (UTC) Subject: telepathy-qt: =?UTF-8?Q?BaseChannelMessagesIn?= =?UTF-8?Q?terface=3A=20Use=20QMap=3A=3Aco?= =?UTF-8?Q?ntains=28=29=20instead=20of=20c?= =?UTF-8?Q?ount=28=29?= Message-ID: <20180502175229.B0DAD7632B@kemper.freedesktop.org> Module: telepathy-qt Branch: master Commit: a6eefefb0adebba8ac964afcc23b09781449d7d7 URL: http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=a6eefefb0adebba8ac964afcc23b09781449d7d7 Author: Alexandr Akulich Date: Wed Apr 26 04:22:15 2017 +0500 BaseChannelMessagesInterface: Use QMap::contains() instead of count() --- TelepathyQt/base-channel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TelepathyQt/base-channel.cpp b/TelepathyQt/base-channel.cpp index 3832f0ba..04683571 100644 --- a/TelepathyQt/base-channel.cpp +++ b/TelepathyQt/base-channel.cpp @@ -771,7 +771,7 @@ QString BaseChannelMessagesInterface::sendMessage(const Tp::MessagePartList &mes MessagePart header = fixedMessage.front(); uint timestamp = 0; - if (header.count(QLatin1String("message-sent"))) { + if (header.contains(QLatin1String("message-sent"))) { timestamp = header[QLatin1String("message-sent")].variant().toUInt(); } else { timestamp = QDateTime::currentMSecsSinceEpoch() / 1000; From kaffeine at kemper.freedesktop.org Wed May 2 17:52:29 2018 From: kaffeine at kemper.freedesktop.org (Alexandr Akulich) Date: Wed, 2 May 2018 17:52:29 +0000 (UTC) Subject: telepathy-qt: =?UTF-8?Q?Get=20rid=20extra=20semicol?= =?UTF-8?Q?ons?= Message-ID: <20180502175229.BC23C761B8@kemper.freedesktop.org> Module: telepathy-qt Branch: master Commit: 908fe67ab7a65062b3859f799612bb9fa1ae39dc URL: http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=908fe67ab7a65062b3859f799612bb9fa1ae39dc Author: Alexander Akulich Date: Sun Apr 29 13:16:23 2018 +0300 Get rid extra semicolons --- TelepathyQt/avatar.h | 4 ++-- TelepathyQt/presence.h | 8 ++++---- TelepathyQt/protocol-parameter.h | 4 ++-- TelepathyQt/requestable-channel-class-spec.h | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/TelepathyQt/avatar.h b/TelepathyQt/avatar.h index c48d3fd1..5c03a925 100644 --- a/TelepathyQt/avatar.h +++ b/TelepathyQt/avatar.h @@ -80,7 +80,7 @@ private: } // Tp -Q_DECLARE_METATYPE(Tp::AvatarData); -Q_DECLARE_METATYPE(Tp::AvatarSpec); +Q_DECLARE_METATYPE(Tp::AvatarData) +Q_DECLARE_METATYPE(Tp::AvatarSpec) #endif diff --git a/TelepathyQt/presence.h b/TelepathyQt/presence.h index 31fd056a..0412ca83 100644 --- a/TelepathyQt/presence.h +++ b/TelepathyQt/presence.h @@ -83,7 +83,7 @@ public: CanHaveStatusMessage = 0x2, AllFlags = MaySetOnSelf | CanHaveStatusMessage }; - Q_DECLARE_FLAGS(SimpleStatusFlags, SimpleStatusFlag); + Q_DECLARE_FLAGS(SimpleStatusFlags, SimpleStatusFlag) PresenceSpec(); PresenceSpec(const QString &status, const SimpleStatusSpec &spec); @@ -164,8 +164,8 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(PresenceSpec::SimpleStatusFlags) } // Tp -Q_DECLARE_METATYPE(Tp::Presence); -Q_DECLARE_METATYPE(Tp::PresenceSpec); -Q_DECLARE_METATYPE(Tp::PresenceSpecList); +Q_DECLARE_METATYPE(Tp::Presence) +Q_DECLARE_METATYPE(Tp::PresenceSpec) +Q_DECLARE_METATYPE(Tp::PresenceSpecList) #endif diff --git a/TelepathyQt/protocol-parameter.h b/TelepathyQt/protocol-parameter.h index 0762bb39..e8a9f1e2 100644 --- a/TelepathyQt/protocol-parameter.h +++ b/TelepathyQt/protocol-parameter.h @@ -88,7 +88,7 @@ uint qHash(const ProtocolParameter ¶meter); } // Tp -Q_DECLARE_METATYPE(Tp::ProtocolParameter); -Q_DECLARE_METATYPE(Tp::ProtocolParameterList); +Q_DECLARE_METATYPE(Tp::ProtocolParameter) +Q_DECLARE_METATYPE(Tp::ProtocolParameterList) #endif diff --git a/TelepathyQt/requestable-channel-class-spec.h b/TelepathyQt/requestable-channel-class-spec.h index 1b78f775..95eb8318 100644 --- a/TelepathyQt/requestable-channel-class-spec.h +++ b/TelepathyQt/requestable-channel-class-spec.h @@ -134,7 +134,7 @@ public: } // Tp -Q_DECLARE_METATYPE(Tp::RequestableChannelClassSpec); -Q_DECLARE_METATYPE(Tp::RequestableChannelClassSpecList); +Q_DECLARE_METATYPE(Tp::RequestableChannelClassSpec) +Q_DECLARE_METATYPE(Tp::RequestableChannelClassSpecList) #endif