summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2014-01-16 22:26:07 (GMT)
committerChristian Mollekopf <chrigi_1@fastmail.fm>2014-01-16 22:26:07 (GMT)
commitfd55973ddccff9ed5feee1f488c218c50f517f62 (patch)
tree92c7b4b4e99f22d8b7a5a2cf98ed1474195d58d6
parentc20c1408c4abace04b469509a2ffe0f1f1bc3845 (diff)
downloadkolab-utils-fd55973ddccff9ed5feee1f488c218c50f517f62.tar.gz
Move the target foldername normalization to KolabAccount.
Since only the target account knows about it's folder name limitations this is the more appropriate place.
-rw-r--r--lib/kolabaccount.cpp5
-rw-r--r--migrationutility/googlesourceaccount.cpp6
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/kolabaccount.cpp b/lib/kolabaccount.cpp
index 5925fc5..4c03524 100644
--- a/lib/kolabaccount.cpp
+++ b/lib/kolabaccount.cpp
@@ -436,8 +436,11 @@ QString KolabAccount::applyTargetFolderTransformations(const QString &folder) co
QString newName(folder);
foreach (const QString &searchString, mRegextrans.keys()) {
if (folder.contains(searchString)) {
- return mRegextrans.value(searchString);
+ newName = mRegextrans.value(searchString);
+ break;
}
}
+ //normalize so it works as imap mailbox name
+ newName.replace(QLatin1String("@"), QLatin1String("at"));
return newName;
}
diff --git a/migrationutility/googlesourceaccount.cpp b/migrationutility/googlesourceaccount.cpp
index 7e7ba22..c46a319 100644
--- a/migrationutility/googlesourceaccount.cpp
+++ b/migrationutility/googlesourceaccount.cpp
@@ -187,10 +187,8 @@ QPair<QString, QString> FetchCalendarFoldersJob::getFolder(const KGAPI2::ObjectP
const KGAPI2::Calendar &calendar = *object.dynamicCast<KGAPI2::Calendar>();
//TODO prefix with Calendar/
QString name = calendar.title();
- //normalize so it works as imap mailbox name
- name.replace(QLatin1String("@"), QLatin1String("at"));
-// Debug() << "calendar: " << name;
- return qMakePair<QString, QString>(calendar.uid(), name);
+// Debug() << "calendar: " << calendar.title();
+ return qMakePair<QString, QString>(calendar.uid(), calendar.title());
}
FetchTaskObjectsJob::FetchTaskObjectsJob(const QString &tasklistId, const KGAPI2::AccountPtr& account, QObject* parent)