dcc: Always clean up if a transfer completed or failed
authorManuel Nickschas <sputnick@quassel-irc.org>
Thu, 29 Sep 2016 19:23:03 +0000 (21:23 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 29 Sep 2016 19:23:03 +0000 (21:23 +0200)
src/common/transfer.cpp

index de81472..e4d3847 100644 (file)
@@ -81,6 +81,9 @@ void Transfer::setStatus(Transfer::Status status)
         _status = status;
         SYNC(ARG(status));
         emit statusChanged(status);
+        if (status == Status::Completed || status == Status::Failed) {
+            cleanUp();
+        }
     }
 }
 
@@ -212,7 +215,6 @@ void Transfer::setError(const QString &errorString)
     qWarning() << Q_FUNC_INFO << errorString;
     emit error(errorString);
     setStatus(Status::Failed);
-    cleanUp();
 }