diff options
author | Andre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk> | 2012-04-03 15:09:37 -0300 |
---|---|---|
committer | Andre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk> | 2012-04-03 15:09:37 -0300 |
commit | 40b4d6f147427b4c7fe7d1474e208b2e6532882e (patch) | |
tree | 663c5736827d871e44604cbb80e995292648f200 | |
parent | e92210fc716e86b1dd76910f07004a1418f3a8aa (diff) |
BaseProtocol*Interface: Warn if createAdaptor is called more than once.
-rw-r--r-- | TelepathyQt/base-protocol.cpp | 18 |
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); } |