Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KIdentityManagement
Commits
9a78e2dd
Commit
9a78e2dd
authored
Jan 06, 2021
by
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
Changes
4
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
9a78e2dd
cmake_minimum_required
(
VERSION 3.5 FATAL_ERROR
)
set
(
PIM_VERSION
"5.16.4
0
"
)
set
(
PIM_VERSION
"5.16.4
1
"
)
project
(
KIdentityManagement VERSION
${
PIM_VERSION
}
)
...
...
autotests/identitytest.cpp
View file @
9a78e2dd
...
...
@@ -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
;
...
...
src/identity.cpp
View file @
9a78e2dd
...
...
@@ -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
();
...
...
src/identity.h
View file @
9a78e2dd
...
...
@@ -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
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment