summaryrefslogtreecommitdiff
path: root/migrationutility/kolabserver.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2012-09-27 09:42:13 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2012-09-27 09:42:13 (GMT)
commit28b63970538c1e4bb8f801604aeb2bd47cd668db (patch)
tree39213cc29170b852e32f4e0a930068231f071860 /migrationutility/kolabserver.cpp
parentf8fc27d068aee9cd75ce25fa721f5e7120ba7fcd (diff)
downloadkolab-utils-28b63970538c1e4bb8f801604aeb2bd47cd668db.tar.gz
We can already list objects, and clean the target server. Now we need to setup the folders properly and implement the folder mapping.
Diffstat (limited to 'migrationutility/kolabserver.cpp')
-rw-r--r--migrationutility/kolabserver.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/migrationutility/kolabserver.cpp b/migrationutility/kolabserver.cpp
new file mode 100644
index 0000000..fa7dd28
--- /dev/null
+++ b/migrationutility/kolabserver.cpp
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2012 Christian Mollekopf <mollekopf@kolabsys.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "kolabserver.h"
+#include "kolabaccount.h"
+#include <kolab/errorhandler.h>
+
+KolabServer::KolabServer(QObject* parent)
+: QObject(parent),
+ mSession(0),
+ mEncryptionMode(KIMAP::LoginJob::TlsV1),
+ mAuthenticationMode(KIMAP::LoginJob::Plain)
+{
+
+}
+
+void KolabServer::setHost(const QString& host, qint16 port)
+{
+ mHost = host;
+ mPort = port;
+}
+
+void KolabServer::setAdminCredentials(const QString& username, const QString& pw)
+{
+ mUsername = username;
+ mPw = pw;
+}
+
+KolabAccount* KolabServer::getAccount(const QString& user)
+{
+ KolabAccount *account = new KolabAccount(this);
+ account->setHost(mHost, mPort);
+ account->setCredentials(user, mPw);
+ return account;
+}