summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandro Knauß <mail@sandroknauss.de>2014-05-14 19:27:36 (GMT)
committerSandro Knauß <mail@sandroknauss.de>2014-05-29 16:52:54 (GMT)
commit8ec8758e3a2d5c59d1adae4b0f5335a1b2f838ca (patch)
tree6db6cb4f0fe3e44f8d0f6a33a0dcc7ba0de4ba11
parent2d448664463ee16317875f9b7273a465ec0aeffc (diff)
downloadkolab-utils-8ec8758e3a2d5c59d1adae4b0f5335a1b2f838ca.tar.gz
fbdaemon/settings: added testmode
-rw-r--r--fbdaemon/settings.cpp17
-rw-r--r--fbdaemon/settings.h7
2 files changed, 23 insertions, 1 deletions
diff --git a/fbdaemon/settings.cpp b/fbdaemon/settings.cpp
index 5e639a5..dbe442b 100644
--- a/fbdaemon/settings.cpp
+++ b/fbdaemon/settings.cpp
@@ -22,7 +22,8 @@
Settings::Settings()
: mTimeframe(-1),
- mThreshold(-1)
+ mThreshold(-1),
+ mTestMode(false)
{
}
@@ -84,6 +85,10 @@ QString Settings::getServerUri(qint16 &port) const
KIMAP::LoginJob::EncryptionMode Settings::getEncryptionMode() const
{
+ if (getTestMode()) {
+ qDebug() << "Using unencryptd connection in testmode.";
+ return KIMAP::LoginJob::Unencrypted;
+ }
if (usesImplicitSSL()) {
return KIMAP::LoginJob::AnySslVersion;
}
@@ -132,6 +137,16 @@ QString Settings::getPassword() const
return getValue("admin_password", "NoAdminPassword").toString();
}
+void Settings::setTestMode(bool testMode)
+{
+ mTestMode = testMode;
+}
+
+bool Settings::getTestMode() const
+{
+ return mTestMode;
+}
+
void Settings::setTimeframe(int t)
{
mTimeframe = t;
diff --git a/fbdaemon/settings.h b/fbdaemon/settings.h
index fe8352f..a5282b5 100644
--- a/fbdaemon/settings.h
+++ b/fbdaemon/settings.h
@@ -62,6 +62,12 @@ public:
void setAggregatedICalOutputDirectory(const QString &dir);
QString getAggregatedICalOutputDirectory() const;
+
+ /**Testmode overrides the EncryptionMode to Unencrypted
+ * The default value is false
+ */
+ void setTestMode(bool);
+ bool getTestMode() const;
private:
QString getServerUri() const;
@@ -78,6 +84,7 @@ private:
int mTimeframe;
int mThreshold;
QString mAggregatedICalOutputDirectory;
+ bool mTestMode;
};
#endif // SETTINGS_H