Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Unmaintained
KDE Pim
Commits
3738dc0c
Commit
3738dc0c
authored
Dec 04, 2014
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't assert when we finally send as encrypted.
parent
7dfb296f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
messagecomposer/composer/keyresolver.cpp
messagecomposer/composer/keyresolver.cpp
+12
-6
messagecomposer/composer/keyresolver.h
messagecomposer/composer/keyresolver.h
+2
-2
No files found.
messagecomposer/composer/keyresolver.cpp
View file @
3738dc0c
...
...
@@ -1069,7 +1069,7 @@ bool Kleo::KeyResolver::encryptionPossible() const {
EmptyKeyList
)
==
d
->
mSecondaryEncryptionKeys
.
end
()
;
}
Kpgp
::
Result
Kleo
::
KeyResolver
::
resolveAllKeys
(
bool
&
signingRequested
,
bool
&
encryptionRequested
)
{
Kpgp
::
Result
Kleo
::
KeyResolver
::
resolveAllKeys
(
bool
&
signingRequested
,
bool
&
encryptionRequested
)
{
if
(
!
encryptionRequested
&&
!
signingRequested
)
{
// make a dummy entry with all recipients, but no signing or
// encryption keys to avoid special-casing on the caller side:
...
...
@@ -1079,8 +1079,13 @@ Kpgp::Result Kleo::KeyResolver::resolveAllKeys( bool& signingRequested, bool& en
return
Kpgp
::
Ok
;
}
Kpgp
::
Result
result
=
Kpgp
::
Ok
;
if
(
encryptionRequested
)
result
=
resolveEncryptionKeys
(
signingRequested
);
if
(
encryptionRequested
)
{
bool
finalySendUnencrypted
=
false
;
result
=
resolveEncryptionKeys
(
signingRequested
,
finalySendUnencrypted
);
if
(
finalySendUnencrypted
)
{
encryptionRequested
=
false
;
}
}
if
(
result
!=
Kpgp
::
Ok
)
return
result
;
if
(
signingRequested
)
{
...
...
@@ -1098,7 +1103,7 @@ Kpgp::Result Kleo::KeyResolver::resolveAllKeys( bool& signingRequested, bool& en
return
result
;
}
Kpgp
::
Result
Kleo
::
KeyResolver
::
resolveEncryptionKeys
(
bool
signingRequested
)
{
Kpgp
::
Result
Kleo
::
KeyResolver
::
resolveEncryptionKeys
(
bool
signingRequested
,
bool
&
finalySendUnencrypted
)
{
//
// 1. Get keys for all recipients:
//
...
...
@@ -1134,7 +1139,7 @@ Kpgp::Result Kleo::KeyResolver::resolveEncryptionKeys( bool signingRequested ) {
// 1a: Present them to the user
const
Kpgp
::
Result
res
=
showKeyApprovalDialog
();
const
Kpgp
::
Result
res
=
showKeyApprovalDialog
(
finalySendUnencrypted
);
if
(
res
!=
Kpgp
::
Ok
)
return
res
;
...
...
@@ -1443,7 +1448,7 @@ void Kleo::KeyResolver::dump() const {
#endif
}
Kpgp
::
Result
Kleo
::
KeyResolver
::
showKeyApprovalDialog
()
{
Kpgp
::
Result
Kleo
::
KeyResolver
::
showKeyApprovalDialog
(
bool
&
finalySendUnencrypted
)
{
const
bool
showKeysForApproval
=
showApprovalDialog
()
||
std
::
find_if
(
d
->
mPrimaryEncryptionKeys
.
begin
(),
d
->
mPrimaryEncryptionKeys
.
end
(),
ApprovalNeeded
)
!=
d
->
mPrimaryEncryptionKeys
.
end
()
...
...
@@ -1540,6 +1545,7 @@ Kpgp::Result Kleo::KeyResolver::showKeyApprovalDialog() {
KGuiItem
(
i18n
(
"Send &Unencrypted"
))
)
==
KMessageBox
::
Cancel
)
return
Kpgp
::
Canceled
;
finalySendUnencrypted
=
true
;
}
else
if
(
emptyListCount
>
0
)
{
const
QString
msg
=
(
emptyListCount
==
1
)
?
i18n
(
"You did not select an encryption key for one of "
...
...
messagecomposer/composer/keyresolver.h
View file @
3738dc0c
...
...
@@ -240,11 +240,11 @@ private:
std
::
vector
<
Item
>
getEncryptionItems
(
const
QStringList
&
recipients
);
std
::
vector
<
GpgME
::
Key
>
getEncryptionKeys
(
const
QString
&
recipient
,
bool
quiet
)
const
;
Kpgp
::
Result
showKeyApprovalDialog
();
Kpgp
::
Result
showKeyApprovalDialog
(
bool
&
finalySendUnencrypted
);
bool
encryptionPossible
()
const
;
bool
signingPossible
()
const
;
Kpgp
::
Result
resolveEncryptionKeys
(
bool
signingRequested
);
Kpgp
::
Result
resolveEncryptionKeys
(
bool
signingRequested
,
bool
&
finalySendUnencrypted
);
Kpgp
::
Result
resolveSigningKeysForEncryption
();
Kpgp
::
Result
resolveSigningKeysForSigningOnly
();
Kpgp
::
Result
checkKeyNearExpiry
(
const
GpgME
::
Key
&
key
,
...
...
Write
Preview
Markdown
is supported
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