summaryrefslogtreecommitdiff
path: root/migrationutility/kolabserver.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2013-02-19 12:35:16 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2013-02-19 12:35:16 (GMT)
commit14cb4d9c22506ae862d611e9c7f308972e2b52eb (patch)
treee4841f7692d5d3706f0326c12f1ec8346de5bd32 /migrationutility/kolabserver.cpp
parente2096af0680d0ba7ceba7897ccfeda3f05202350 (diff)
downloadkolab-utils-14cb4d9c22506ae862d611e9c7f308972e2b52eb.tar.gz
Allow setting a different target user for single user migration.
Diffstat (limited to 'migrationutility/kolabserver.cpp')
-rw-r--r--migrationutility/kolabserver.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/migrationutility/kolabserver.cpp b/migrationutility/kolabserver.cpp
index 9e5a520..76b3180 100644
--- a/migrationutility/kolabserver.cpp
+++ b/migrationutility/kolabserver.cpp
@@ -57,17 +57,26 @@ void KolabServer::setAuthentication(KIMAP::LoginJob::AuthenticationMode auth)
mAuthenticationMode = auth;
}
+void KolabServer::addTargetUserForSource(const QString &sourceUser, const QString &targetUser)
+{
+ mTargetForSourceUser.insert(sourceUser, targetUser);
+}
+
void KolabServer::setDryRun(bool enable)
{
mDryRun = enable;
}
-
KolabAccount* KolabServer::getAccount(const QString& user)
{
KolabAccount *account = new KolabAccount(this);
account->setHost(mHost, mPort);
- account->setCredentials(user, mPw, mUsername);
+ QString targetUser(user);
+ if (mTargetForSourceUser.contains(user)) {
+ targetUser = mTargetForSourceUser.value(user);
+ Debug() << "Using " << targetUser << " for " << user << "as target user";
+ }
+ account->setCredentials(targetUser, mPw, mUsername);
account->setDryRun(mDryRun);
account->setVersion(mVersion);
if (!account->init()) {
@@ -76,3 +85,4 @@ KolabAccount* KolabServer::getAccount(const QString& user)
}
return account;
}
+