Commit 5fc99624 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

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
parent 999d2fb0
......@@ -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")
......
......@@ -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();
......
......@@ -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<<
......@@ -233,6 +234,12 @@ public:
bool pgpAutoSign() const;
void setPgpAutoSign(bool);
/**
* @since 5.4
*/
bool pgpAutoEncrypt() const;
void setPgpAutoEncrypt(bool);
/**
* @since 4.14
*/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment