summaryrefslogtreecommitdiff
path: root/migrationutility/coordinationjob.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'migrationutility/coordinationjob.cpp')
-rw-r--r--migrationutility/coordinationjob.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/migrationutility/coordinationjob.cpp b/migrationutility/coordinationjob.cpp
index f7a402f..ae063df 100644
--- a/migrationutility/coordinationjob.cpp
+++ b/migrationutility/coordinationjob.cpp
@@ -32,12 +32,22 @@ CoordinationJob::CoordinationJob(SourceServer *sourceServer, KolabServer *kolabS
void CoordinationJob::start()
{
- QMetaObject::invokeMethod(this, "doStart", Qt::QueuedConnection);
+ UserListJob *listJob = mSourceServer->listUsers();
+ Q_ASSERT(listJob);
+ connect(listJob, SIGNAL(result(KJob*)), this, SLOT(onUserListJobDone(KJob*)));
+ listJob->start();
}
-void CoordinationJob::doStart()
+void CoordinationJob::onUserListJobDone(KJob* job)
{
- mUserList = mSourceServer->getUserList();
+ if (job->error()) {
+ setError(UserDefinedError);
+ setErrorText("Failed to get user list: " + job->errorString());
+ emitResult();
+ return;
+ }
+ UserListJob *listJob = static_cast<UserListJob*>(job);
+ mUserList = listJob->getUserList();
if (mUserList.isEmpty()) {
Debug() << "no users found";
} else {