diff options
author | Olli Salli <ollisal@gmail.com> | 2011-08-25 15:04:01 +0300 |
---|---|---|
committer | Olli Salli <ollisal@gmail.com> | 2011-10-10 19:17:41 +0300 |
commit | 45caf5bae192991e8d931926ccb76f28d22b2277 (patch) | |
tree | ed666f8eca599a75f2787dd5c96704a696094347 /qt4 | |
parent | c6798c852fc4b3a77028b34ba859f60233a906dd (diff) |
StreamTubeClient: Add isRegistered() for verifying registration was successful
Also fixes trying to unregister non-registered handlers on destruction
Diffstat (limited to 'qt4')
-rw-r--r-- | qt4/TelepathyQt4/stream-tube-client.cpp | 7 | ||||
-rw-r--r-- | qt4/TelepathyQt4/stream-tube-client.h | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/qt4/TelepathyQt4/stream-tube-client.cpp b/qt4/TelepathyQt4/stream-tube-client.cpp index 64e41cc9e..78eb86164 100644 --- a/qt4/TelepathyQt4/stream-tube-client.cpp +++ b/qt4/TelepathyQt4/stream-tube-client.cpp @@ -255,7 +255,7 @@ StreamTubeClient::StreamTubeClient( */ StreamTubeClient::~StreamTubeClient() { - if (!clientName().isNull()) { + if (isRegistered()) { mPriv->registrar->unregisterClient(mPriv->handler); } @@ -274,6 +274,11 @@ QString StreamTubeClient::clientName() const return mPriv->clientName; } +bool StreamTubeClient::isRegistered() const +{ + return mPriv->isRegistered; +} + bool StreamTubeClient::monitorsConnections() const { return mPriv->handler->monitorsConnections(); diff --git a/qt4/TelepathyQt4/stream-tube-client.h b/qt4/TelepathyQt4/stream-tube-client.h index 04aa18105..1f77c3456 100644 --- a/qt4/TelepathyQt4/stream-tube-client.h +++ b/qt4/TelepathyQt4/stream-tube-client.h @@ -116,6 +116,7 @@ public: ClientRegistrarPtr registrar() const; QString clientName() const; + bool isRegistered() const; bool monitorsConnections() const; bool acceptsAsTcp() const; // if setToAcceptAsTCP has been used last |