summaryrefslogtreecommitdiff
path: root/qt4
diff options
context:
space:
mode:
authorOlli Salli <ollisal@gmail.com>2011-09-25 20:03:38 +0300
committerOlli Salli <ollisal@gmail.com>2011-10-10 19:17:42 +0300
commitd70e0de88ab93abee0dc6777724906aedb43f278 (patch)
tree8319e72bbd8feba2cea1ff8c92158505676a4f64 /qt4
parent8c7e5faba701081494a8dc3db387501bfe2566d2 (diff)
STC: Skip invalid tubes in connections() to avoid warnings, like STS, and document the STS check
Diffstat (limited to 'qt4')
-rw-r--r--qt4/TelepathyQt4/stream-tube-client.cpp7
-rw-r--r--qt4/TelepathyQt4/stream-tube-server.cpp3
2 files changed, 10 insertions, 0 deletions
diff --git a/qt4/TelepathyQt4/stream-tube-client.cpp b/qt4/TelepathyQt4/stream-tube-client.cpp
index 2e9d0290b..4c3158969 100644
--- a/qt4/TelepathyQt4/stream-tube-client.cpp
+++ b/qt4/TelepathyQt4/stream-tube-client.cpp
@@ -369,6 +369,13 @@ QHash<QPair<AccountPtr, IncomingStreamTubeChannelPtr>, QSet<uint> >
QPair<AccountPtr, IncomingStreamTubeChannelPtr> tube;
foreach (tube, tubes()) {
+ if (!tube.second->isValid()) {
+ // The tube has been invalidated, so skip it to avoid warnings
+ // We're going to get rid of the wrapper in the next mainloop iteration when we get the
+ // invalidation signal
+ continue;
+ }
+
QSet<uint> tubeConns = QSet<uint>::fromList(tube.second->connections());
if (!tubeConns.empty()) {
conns.insert(tube, tubeConns);
diff --git a/qt4/TelepathyQt4/stream-tube-server.cpp b/qt4/TelepathyQt4/stream-tube-server.cpp
index f07ab6694..6eb7a3b96 100644
--- a/qt4/TelepathyQt4/stream-tube-server.cpp
+++ b/qt4/TelepathyQt4/stream-tube-server.cpp
@@ -393,6 +393,9 @@ QHash<QPair<QHostAddress /* sourceAddress */, quint16 /* sourcePort */>,
QPair<AccountPtr, OutgoingStreamTubeChannelPtr> tube;
foreach (tube, tubes()) {
+ // Ignore invalid and non-Open tubes to prevent a few useless warnings in corner cases where
+ // a tube is still being opened, or has been invalidated but we haven't processed that event
+ // yet.
if (!tube.second->isValid() || tube.second->state() != TubeChannelStateOpen) {
continue;
}