Commit 9a78e2dd authored by Sandro Knauß's avatar Sandro Knauß
Browse files

Add configuration to support Autocrypt for an identity.

parent 970c3c1d
Pipeline #46623 passed with stage
in 8 minutes and 6 seconds
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
set(PIM_VERSION "5.16.40")
set(PIM_VERSION "5.16.41")
project(KIdentityManagement VERSION ${PIM_VERSION})
......
......@@ -121,6 +121,9 @@ void IdentityTester::test_Identity()
QCOMPARE(identity.pgpAutoSign(), true);
identity.setPgpAutoEncrypt(true);
QCOMPARE(identity.pgpAutoEncrypt(), true);
QCOMPARE(identity.autocryptEnabled(), false);
identity.setAutocryptEnabled(true);
QCOMPARE(identity.autocryptEnabled(), true);
identity.setDefaultDomainName(QStringLiteral("kde.org"));
QCOMPARE(identity.defaultDomainName(), QStringLiteral("kde.org"));
Signature sig;
......
......@@ -184,6 +184,7 @@ QDataStream &KIdentityManagement::operator<<
<< i.mPropertiesMap[QLatin1String(s_disabledFcc)]
<< i.mPropertiesMap[QLatin1String(s_pgpautosign)]
<< i.mPropertiesMap[QLatin1String(s_pgpautoencrypt)]
<< i.mPropertiesMap[QLatin1String(s_autocryptEnabled)]
<< i.mPropertiesMap[QLatin1String(s_defaultDomainName)];
}
......@@ -220,6 +221,7 @@ QDataStream &KIdentityManagement::operator>>
>> i.mPropertiesMap[QLatin1String(s_disabledFcc)]
>> i.mPropertiesMap[QLatin1String(s_pgpautosign)]
>> i.mPropertiesMap[QLatin1String(s_pgpautoencrypt)]
>> i.mPropertiesMap[QLatin1String(s_autocryptEnabled)]
>> i.mPropertiesMap[QLatin1String(s_defaultDomainName)];
i.setProperty(QLatin1String(s_uoid), uoid);
......@@ -737,6 +739,21 @@ void Identity::setPgpAutoEncrypt(bool autoEncrypt)
setProperty(QLatin1String(s_pgpautoencrypt), autoEncrypt);
}
bool KIdentityManagement::Identity::autocryptEnabled() const
{
const auto var = property(QLatin1String(s_autocryptEnabled));
if (var.isNull()) {
return false;
} else {
return var.toBool();
}
}
void Identity::setAutocryptEnabled(const bool on)
{
setProperty(QLatin1String(s_autocryptEnabled), on);
}
QString Identity::defaultDomainName() const
{
return property(QLatin1String(s_defaultDomainName)).toString();
......
......@@ -56,6 +56,7 @@ 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";
static const char s_autocryptEnabled[] = "Autocrypt";
KIDENTITYMANAGEMENT_EXPORT QDataStream &operator<<(QDataStream &stream, const KIdentityManagement::Identity &ident);
KIDENTITYMANAGEMENT_EXPORT QDataStream &operator>>(QDataStream &stream, KIdentityManagement::Identity &ident);
......@@ -216,6 +217,12 @@ public:
Q_REQUIRED_RESULT bool pgpAutoEncrypt() const;
void setPgpAutoEncrypt(bool);
/**
* @since 5.17
*/
Q_REQUIRED_RESULT bool autocryptEnabled() const;
void setAutocryptEnabled(const bool);
/**
* @since 4.14
*/
......
Markdown is supported
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