summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2013-11-11 15:18:37 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2013-11-11 15:18:37 (GMT)
commit5d0ad7df4185f9720ddf5dbaa1d4b815ea73675e (patch)
tree5cba2ce2f1a1739b6db51b29eaeec2455df7d510
parentccd7b984d12c3e80b5e711d44e302bd36b609ad2 (diff)
downloadkolab-utils-5d0ad7df4185f9720ddf5dbaa1d4b815ea73675e.tar.gz
Wait for the fetchjob to be complete.
Otherwise the migrate job may abort in the middle of fetching.
-rw-r--r--migrationutility/migratefolderjob.cpp6
-rw-r--r--migrationutility/migratefolderjob.h1
2 files changed, 5 insertions, 2 deletions
diff --git a/migrationutility/migratefolderjob.cpp b/migrationutility/migratefolderjob.cpp
index fd1a09a..bd77b42 100644
--- a/migrationutility/migratefolderjob.cpp
+++ b/migrationutility/migratefolderjob.cpp
@@ -26,7 +26,8 @@ MigrateFolderJob::MigrateFolderJob(const QString &folder, SourceAccount* sourceA
mSourceAccount(sourceAccount),
mKolabAccount(kolabAccount),
mFolder(folder),
- mRunningAppendJobs(0)
+ mRunningAppendJobs(0),
+ mFetchDone(false)
{
}
@@ -62,6 +63,7 @@ void MigrateFolderJob::fetchJobFinished(KJob *job)
setError(KJob::UserDefinedError);
Warning() << job->errorString();
}
+ mFetchDone = true;
checkDone();
}
@@ -94,7 +96,7 @@ void MigrateFolderJob::appendJobFinished(KJob *job)
void MigrateFolderJob::checkDone()
{
- if (mRunningAppendJobs <= 0) {
+ if (mRunningAppendJobs <= 0 && mFetchDone) {
emitResult();
}
}
diff --git a/migrationutility/migratefolderjob.h b/migrationutility/migratefolderjob.h
index a2f95d8..c0644ce 100644
--- a/migrationutility/migratefolderjob.h
+++ b/migrationutility/migratefolderjob.h
@@ -41,6 +41,7 @@ private:
QString mFolder;
QString mTargetFolder;
int mRunningAppendJobs;
+ bool mFetchDone;
};
#endif // MIGRATEFOLDERJOB_H