telepathy-qt: dbus-tubes: Before taking any action, check if the operation is still running ( and hence if no action has been taken yet)
Dario Freddi
drf at kemper.freedesktop.org
Tue Jul 3 15:08:42 PDT 2012
Module: telepathy-qt
Branch: master
Commit: 3ba36e4a18b1db15a5889a76979ca80a25530cb1
URL: http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=3ba36e4a18b1db15a5889a76979ca80a25530cb1
Author: Dario Freddi <dario.freddi at collabora.co.uk>
Date: Thu Jun 30 11:31:50 2011 +0200
dbus-tubes: Before taking any action, check if the operation is still running (and hence if no action has been taken yet)
---
TelepathyQt/pending-dbus-tube.cpp | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/TelepathyQt/pending-dbus-tube.cpp b/TelepathyQt/pending-dbus-tube.cpp
index e021364..c4da9db 100644
--- a/TelepathyQt/pending-dbus-tube.cpp
+++ b/TelepathyQt/pending-dbus-tube.cpp
@@ -116,6 +116,11 @@ QString PendingDBusTube::address() const
void PendingDBusTube::onConnectionFinished(PendingOperation *op)
{
+ if (isFinished()) {
+ // The operation has already failed
+ return;
+ }
+
if (op->isError()) {
// Fail
setFinishedWithError(op->errorName(), op->errorMessage());
@@ -152,6 +157,11 @@ void PendingDBusTube::onChannelInvalidated(DBusProxy* proxy,
{
Q_UNUSED(proxy);
+ if (isFinished()) {
+ // The operation has already finished
+ return;
+ }
+
setFinishedWithError(errorName, errorMessage);
}
More information about the telepathy-commits
mailing list