summaryrefslogtreecommitdiff
path: root/TelepathyQt
diff options
context:
space:
mode:
authorAndre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>2012-04-03 15:09:37 -0300
committerAndre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>2012-04-03 15:09:37 -0300
commit40b4d6f147427b4c7fe7d1474e208b2e6532882e (patch)
tree663c5736827d871e44604cbb80e995292648f200 /TelepathyQt
parente92210fc716e86b1dd76910f07004a1418f3a8aa (diff)
BaseProtocol*Interface: Warn if createAdaptor is called more than once.
Diffstat (limited to 'TelepathyQt')
-rw-r--r--TelepathyQt/base-protocol.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/TelepathyQt/base-protocol.cpp b/TelepathyQt/base-protocol.cpp
index 7c24aa46..99434266 100644
--- a/TelepathyQt/base-protocol.cpp
+++ b/TelepathyQt/base-protocol.cpp
@@ -458,6 +458,12 @@ QString BaseProtocolAddressingInterface::normalizeContactUri(const QString &uri,
void BaseProtocolAddressingInterface::createAdaptor(const QDBusConnection &dbusConnection, QObject *dbusObject)
{
+ if (mPriv->adaptee) {
+ /* it should not happen unless external code called it directly, but we don't
+ * want to assert here */
+ warning() << "BaseProtocolAddressingInterface::createAdaptor: adaptor already created";
+ return;
+ }
mPriv->adaptee = new BaseProtocolAddressingInterface::Adaptee(dbusConnection, dbusObject, this);
}
@@ -548,6 +554,12 @@ void BaseProtocolAvatarsInterface::setAvatarDetails(const AvatarSpec &details)
void BaseProtocolAvatarsInterface::createAdaptor(const QDBusConnection &dbusConnection, QObject *dbusObject)
{
+ if (mPriv->adaptee) {
+ /* it should not happen unless external code called it directly, but we don't
+ * want to assert here */
+ warning() << "BaseProtocolAvatarsInterface::createAdaptor: adaptor already created";
+ return;
+ }
mPriv->adaptee = new BaseProtocolAvatarsInterface::Adaptee(dbusConnection, dbusObject, this);
}
@@ -603,6 +615,12 @@ void BaseProtocolPresenceInterface::setStatuses(const PresenceSpecList &statuses
void BaseProtocolPresenceInterface::createAdaptor(const QDBusConnection &dbusConnection, QObject *dbusObject)
{
+ if (mPriv->adaptee) {
+ /* it should not happen unless external code called it directly, but we don't
+ * want to assert here */
+ warning() << "BaseProtocolPresenceInterface::createAdaptor: adaptor already created";
+ return;
+ }
mPriv->adaptee = new BaseProtocolPresenceInterface::Adaptee(dbusConnection, dbusObject, this);
}