[Telepathy-commits] [telepathy-qt4/master] PendingOperation: warn more verbosely when finishing twice

Simon McVittie simon.mcvittie at collabora.co.uk
Wed Dec 3 07:20:20 PST 2008


---
 TelepathyQt4/cli-pending-operation.cpp |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/TelepathyQt4/cli-pending-operation.cpp b/TelepathyQt4/cli-pending-operation.cpp
index b834939..94f5e4c 100644
--- a/TelepathyQt4/cli-pending-operation.cpp
+++ b/TelepathyQt4/cli-pending-operation.cpp
@@ -75,7 +75,12 @@ void PendingOperation::emitFinished()
 void PendingOperation::setFinished()
 {
     if (mPriv->finished) {
-        qWarning() << this << "already finished";
+        if (mPriv->errorName.isEmpty())
+            qWarning() << this << "trying to finish with success, but already"
+              " failed with" << errorName() << ":" << errorMessage();
+        else
+            qWarning() << this << "trying to finish with success, but already"
+              " succeeded";
         return;
     }
 
@@ -89,7 +94,13 @@ void PendingOperation::setFinishedWithError(const QString& name,
         const QString& message)
 {
     if (mPriv->finished) {
-        qWarning() << this << "already finished";
+        if (mPriv->errorName.isEmpty())
+            qWarning() << this << "trying to fail with" << name <<
+              "but already failed with" << errorName() << ":" <<
+              errorMessage();
+        else
+            qWarning() << this << "trying to fail with" << name <<
+              "but already succeeded";
         return;
     }
 
-- 
1.5.6.5




More information about the Telepathy-commits mailing list