[Telepathy-commits] [telepathy-qt4/master] Hook up Channel::Closed to making Channel have the dead readiness
Olli Salli
olli.salli at collabora.co.uk
Sat Sep 20 10:00:55 PDT 2008
---
TelepathyQt4/cli-channel.cpp | 17 +++++++++++++++--
TelepathyQt4/cli-channel.h | 1 +
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/TelepathyQt4/cli-channel.cpp b/TelepathyQt4/cli-channel.cpp
index 29a8271..7f192e2 100644
--- a/TelepathyQt4/cli-channel.cpp
+++ b/TelepathyQt4/cli-channel.cpp
@@ -58,12 +58,17 @@ struct Channel::Private
: parent(parent),
properties(parent)
{
+ debug() << "Creating new Channel";
+
readiness = ReadinessJustCreated;
+ debug() << "Connecting to Channel::Closed()";
+ parent.connect(&parent,
+ SIGNAL(Closed()),
+ SLOT(onClosed()));
+
introspectQueue.enqueue(&Private::introspectMain);
continueIntrospection();
-
- debug() << "Created new Channel";
}
void introspectMain()
@@ -297,5 +302,13 @@ void Channel::gotInterfaces(QDBusPendingCallWatcher* watcher)
mPriv->nowHaveInterfaces();
}
+void Channel::onClosed()
+{
+ debug() << "Got Channel::Closed";
+
+ if (mPriv->readiness != ReadinessDead)
+ mPriv->changeReadiness(ReadinessDead);
+}
+
}
}
diff --git a/TelepathyQt4/cli-channel.h b/TelepathyQt4/cli-channel.h
index 237c9cc..7ece273 100644
--- a/TelepathyQt4/cli-channel.h
+++ b/TelepathyQt4/cli-channel.h
@@ -172,6 +172,7 @@ private Q_SLOTS:
void gotChannelType(QDBusPendingCallWatcher* watcher);
void gotHandle(QDBusPendingCallWatcher* watcher);
void gotInterfaces(QDBusPendingCallWatcher* watcher);
+ void onClosed();
private:
struct Private;
--
1.5.6.5
More information about the Telepathy-commits
mailing list