summaryrefslogtreecommitdiff
path: root/lib/kolabaccount.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2013-11-11 13:03:28 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2013-11-11 13:03:28 (GMT)
commit5cc21d084a89f871e009df2f5696040b32c379ac (patch)
tree1127ab30e7078a7dfa18ee82776c20f2537253e2 /lib/kolabaccount.cpp
parentee2b3d7dd1824a62da2dcd41b91f5fbd07396784 (diff)
downloadkolab-utils-5cc21d084a89f871e009df2f5696040b32c379ac.tar.gz
Set private and shared annotations. Moved folder creation to separate job to reuse in kolabaccount.
Diffstat (limited to 'lib/kolabaccount.cpp')
-rw-r--r--lib/kolabaccount.cpp24
1 files changed, 3 insertions, 21 deletions
diff --git a/lib/kolabaccount.cpp b/lib/kolabaccount.cpp
index 29cb6d0..a0b616c 100644
--- a/lib/kolabaccount.cpp
+++ b/lib/kolabaccount.cpp
@@ -19,6 +19,7 @@
#include "sessionfactory.h"
#include "jobs/setupkolabfoldersjob.h"
#include "jobs/fetchmessagesjob.h"
+#include "jobs/createkolabfolderjob.h"
#include <kimap/session.h>
#include <kimap/logoutjob.h>
#include <kimap/appendjob.h>
@@ -325,31 +326,13 @@ void KolabAccount::createFolder(const QString &name, const QByteArray &annotatio
Debug() << "creating folder: " << name << annotation;
return;
}
-
- KIMAP::CreateJob *createJob = new KIMAP::CreateJob(mSession);
- createJob->setMailBox(name);
+ CreateKolabFolderJob *createJob = new CreateKolabFolderJob(name, annotation, QByteArray(), CreateKolabFolderJob::capablitiesFromString(mCapabilities), mSession, this);
createJob->exec();
- Debug() << "created folder: " << name;
if (createJob->error()) {
Error() << createJob->errorString();
return;
}
-
- KIMAP::SetMetaDataJob *setMetadataJob = new KIMAP::SetMetaDataJob(mSession);
- setMetadataJob->setMailBox(createJob->mailBox());
- if ( mCapabilities.contains( "METADATA" ) ) {
- setMetadataJob->setServerCapability( KIMAP::MetaDataJobBase::Metadata );
- setMetadataJob->addMetaData( "/shared" KOLAB_FOLDER_TYPE_ANNOTATION, annotation );
- } else {
- setMetadataJob->setServerCapability( KIMAP::MetaDataJobBase::Annotatemore );
- setMetadataJob->setEntry( KOLAB_FOLDER_TYPE_ANNOTATION );
- setMetadataJob->addMetaData( "value.shared", annotation );
- }
- setMetadataJob->exec();
- if (setMetadataJob->error()) {
- Error() << setMetadataJob->errorString();
- }
-
+ Debug() << "created folder: " << name;
mFolders.append(name);
}
@@ -378,7 +361,6 @@ void KolabAccount::setupFolders()
KIMAP::SelectJob *selectJob = new KIMAP::SelectJob(mSession);
selectJob->setMailBox(QString());
//TODO internationalize folder names
- //TODO make part of setupkolabfoldersjob after adding types to folderTypeFromString in formathelpers.cpp
//TODO the suffixes should go in the private namespace
createFolder("Drafts", KOLAB_FOLDER_TYPE_MAIL KOLAB_FOLDER_TYPE_DRAFT_SUFFIX);
createFolder("Sent", KOLAB_FOLDER_TYPE_MAIL KOLAB_FOLDER_TYPE_SENT_SUFFIX);