summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vrátil <dvratil@kde.org>2016-07-21 10:54:04 (GMT)
committerDaniel Vrátil <dvratil@kde.org>2016-07-22 09:02:37 (GMT)
commit5fc9962412a0f3d7475dde4b99391cef60a5f44f (patch)
tree1b4ec7d7d7135e4bcb772c555405343a97b0ba09
parent999d2fb0b541fbd8e0fc1994508da24d8019778f (diff)
Add per-identity auto-encrypt option
We already have per-identity flag to automatically sign emails, this change also adds a flag for per-identity encryption of emails. Differential Revision: https://phabricator.kde.org/D2243
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/identity.cpp17
-rw-r--r--src/identity.h7
3 files changed, 25 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d2cb303..7bd3285 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,7 +18,7 @@ include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMQtDeclareLoggingCategory)
-set(PIM_VERSION "5.3.40")
+set(PIM_VERSION "5.3.41")
set(KIDENTITYMANAGEMENT_LIB_VERSION ${PIM_VERSION})
set(PIMTEXTEDIT_LIB_VERSION "5.2.80")
diff --git a/src/identity.cpp b/src/identity.cpp
index b37f784..6e002c3 100644
--- a/src/identity.cpp
+++ b/src/identity.cpp
@@ -188,6 +188,7 @@ QDataStream &KIdentityManagement::operator<<
<< i.autocorrectionLanguage()
<< i.disabledFcc()
<< i.pgpAutoSign()
+ << i.pgpAutoEncrypt()
<< i.defaultDomainName();
}
@@ -222,6 +223,7 @@ QDataStream &KIdentityManagement::operator>>
>> i.mPropertiesMap[QLatin1String(s_autocorrectionLanguage)]
>> i.mPropertiesMap[QLatin1String(s_disabledFcc)]
>> i.mPropertiesMap[QLatin1String(s_pgpautosign)]
+ >> i.mPropertiesMap[QLatin1String(s_pgpautoencrypt)]
>> i.mPropertiesMap[QLatin1String(s_defaultDomainName)];
i.setProperty(QLatin1String(s_uoid), uoid);
@@ -689,6 +691,21 @@ void Identity::setPgpAutoSign(bool autoSign)
setProperty(QLatin1String(s_pgpautosign), autoSign);
}
+bool Identity::pgpAutoEncrypt() const
+{
+ const QVariant var = property(QLatin1String(s_pgpautoencrypt));
+ if (var.isNull()) {
+ return false;
+ } else {
+ return var.toBool();
+ }
+}
+
+void Identity::setPgpAutoEncrypt(bool autoEncrypt)
+{
+ setProperty(QLatin1String(s_pgpautoencrypt), autoEncrypt);
+}
+
QString Identity::defaultDomainName() const
{
return property(QLatin1String(s_defaultDomainName)).toString();
diff --git a/src/identity.h b/src/identity.h
index 83a13f5..703c270 100644
--- a/src/identity.h
+++ b/src/identity.h
@@ -70,6 +70,7 @@ static const char s_attachVcard[] = "Attach Vcard";
static const char s_autocorrectionLanguage[] = "Autocorrection Language";
static const char s_disabledFcc[] = "Disable Fcc";
static const char s_pgpautosign[] = "Pgp Auto Sign";
+static const char s_pgpautoencrypt[] = "Pgp Auto Encrypt";
static const char s_defaultDomainName[] = "Default Domain";
KIDENTITYMANAGEMENT_EXPORT QDataStream &operator<<
@@ -234,6 +235,12 @@ public:
void setPgpAutoSign(bool);
/**
+ * @since 5.4
+ */
+ bool pgpAutoEncrypt() const;
+ void setPgpAutoEncrypt(bool);
+
+ /**
* @since 4.14
*/
QString defaultDomainName() const;