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
PIM Messagelib
Commits
f6b1dce2
Commit
f6b1dce2
authored
Jul 23, 2020
by
Laurent Montel
😁
Browse files
Use KCursor from GuiAddons when possible
parent
17db512d
Pipeline
#28095
failed with stage
in 27 minutes and 47 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
f6b1dce2
...
...
@@ -80,6 +80,7 @@ find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package
(
KF5XmlGui
${
KF5_MIN_VERSION
}
CONFIG REQUIRED
)
find_package
(
KF5SyntaxHighlighting
${
KF5_MIN_VERSION
}
CONFIG REQUIRED
)
find_package
(
KF5DBusAddons
${
KF5_MIN_VERSION
}
CONFIG REQUIRED
)
find_package
(
KF5GuiAddons
${
KF5_MIN_VERSION
}
CONFIG REQUIRED
)
find_package
(
Grantlee5
"5.2"
CONFIG REQUIRED
)
#Use KF5_VERSION in the future
...
...
messagecomposer/src/CMakeLists.txt
View file @
f6b1dce2
...
...
@@ -241,6 +241,7 @@ target_link_libraries(KF5MessageComposer
KF5::Archive
KF5::Contacts
KF5::SonnetCore
KF5::GuiAddons
)
target_include_directories
(
KF5MessageComposer INTERFACE
"$<INSTALL_INTERFACE:
${
KDE_INSTALL_INCLUDEDIR_KF5
}
/MessageComposer/;
${
KDE_INSTALL_INCLUDEDIR_KF5
}
/messagecomposer>"
)
...
...
messagecomposer/src/composer/composerviewbase.cpp
View file @
f6b1dce2
...
...
@@ -35,9 +35,14 @@
#include <MimeTreeParser/ObjectTreeParser>
#include <MimeTreeParser/SimpleObjectTreeSource>
#include <kguiaddons_version.h>
#if KGUIADDONS_VERSION < QT_VERSION_CHECK(5, 73, 0)
#ifndef QT_NO_CURSOR
#include <Libkdepim/KCursorSaver>
#endif
#else
#include <KCursorSaver>
#endif
#include <Sonnet/DictionaryComboBox>
#include <KIdentityManagement/Identity>
...
...
@@ -290,10 +295,13 @@ void ComposerViewBase::send(MessageComposer::MessageSender::SendMethod method, M
mSendMethod
=
method
;
mSaveIn
=
saveIn
;
#if KGUIADDONS_VERSION < QT_VERSION_CHECK(5, 73, 0)
#ifndef QT_NO_CURSOR
KPIM
::
KCursorSaver
busy
(
KPIM
::
KBusyPtr
::
busy
());
const
KPIM
::
KCursorSaver
saver
(
Qt
::
ArrowCursor
);
#endif
#else
KCursorSaver
saver
(
Qt
::
WaitCursor
);
#endif
const
KIdentityManagement
::
Identity
identity
=
identityManager
()
->
identityForUoid
(
m_identityCombo
->
currentIdentity
());
if
(
identity
.
attachVcard
()
&&
m_attachmentController
->
attachOwnVcard
())
{
...
...
@@ -1814,8 +1822,12 @@ bool ComposerViewBase::determineWhetherToSign(bool doSignCompletely, Kleo::KeyRe
case
Kleo
::
Ask
:
{
// the user wants to be asked or has to be asked
#if KGUIADDONS_VERSION < QT_VERSION_CHECK(5, 73, 0)
#ifndef QT_NO_CURSOR
KPIM
::
KCursorSaver
busy
(
KPIM
::
KBusyPtr
::
busy
());
const
KPIM
::
KCursorSaver
saver
(
Qt
::
ArrowCursor
);
#endif
#else
KCursorSaver
saver
(
Qt
::
WaitCursor
);
#endif
const
QString
msg
=
i18n
(
"Examination of the recipient's signing preferences "
"yielded that you be asked whether or not to sign "
...
...
@@ -1844,8 +1856,12 @@ bool ComposerViewBase::determineWhetherToSign(bool doSignCompletely, Kleo::KeyRe
case
Kleo
::
Conflict
:
{
// warn the user that there are conflicting signing preferences
#if KGUIADDONS_VERSION < QT_VERSION_CHECK(5, 73, 0)
#ifndef QT_NO_CURSOR
KPIM
::
KCursorSaver
busy
(
KPIM
::
KBusyPtr
::
busy
());
const
KPIM
::
KCursorSaver
saver
(
Qt
::
ArrowCursor
);
#endif
#else
KCursorSaver
saver
(
Qt
::
WaitCursor
);
#endif
const
QString
msg
=
i18n
(
"There are conflicting signing preferences "
"for these recipients.
\n
"
...
...
@@ -1872,8 +1888,12 @@ bool ComposerViewBase::determineWhetherToSign(bool doSignCompletely, Kleo::KeyRe
}
case
Kleo
::
Impossible
:
{
#if KGUIADDONS_VERSION < QT_VERSION_CHECK(5, 73, 0)
#ifndef QT_NO_CURSOR
KPIM
::
KCursorSaver
busy
(
KPIM
::
KBusyPtr
::
busy
());
const
KPIM
::
KCursorSaver
saver
(
Qt
::
ArrowCursor
);
#endif
#else
KCursorSaver
saver
(
Qt
::
WaitCursor
);
#endif
const
QString
msg
=
i18n
(
"You have requested to sign this message, "
"but no valid signing keys have been configured "
...
...
@@ -1893,8 +1913,12 @@ bool ComposerViewBase::determineWhetherToSign(bool doSignCompletely, Kleo::KeyRe
if
(
!
sign
||
!
doSignCompletely
)
{
if
(
MessageComposer
::
MessageComposerSettings
::
self
()
->
cryptoWarningUnsigned
())
{
#if KGUIADDONS_VERSION < QT_VERSION_CHECK(5, 73, 0)
#ifndef QT_NO_CURSOR
KPIM
::
KCursorSaver
busy
(
KPIM
::
KBusyPtr
::
busy
());
const
KPIM
::
KCursorSaver
saver
(
Qt
::
ArrowCursor
);
#endif
#else
KCursorSaver
saver
(
Qt
::
WaitCursor
);
#endif
const
QString
msg
=
sign
&&
!
doSignCompletely
?
i18n
(
"Some parts of this message will not be signed.
\n
"
...
...
@@ -1949,8 +1973,12 @@ bool ComposerViewBase::determineWhetherToEncrypt(bool doEncryptCompletely, Kleo:
case
Kleo
::
Ask
:
{
// the user wants to be asked or has to be asked
#if KGUIADDONS_VERSION < QT_VERSION_CHECK(5, 73, 0)
#ifndef QT_NO_CURSOR
KPIM
::
KCursorSaver
busy
(
KPIM
::
KBusyPtr
::
busy
());
const
KPIM
::
KCursorSaver
saver
(
Qt
::
ArrowCursor
);
#endif
#else
KCursorSaver
saver
(
Qt
::
WaitCursor
);
#endif
const
QString
msg
=
opportunistic
?
i18n
(
"Valid trusted encryption keys were found for all recipients.
\n
"
...
...
@@ -1986,8 +2014,12 @@ bool ComposerViewBase::determineWhetherToEncrypt(bool doEncryptCompletely, Kleo:
case
Kleo
::
Conflict
:
{
// warn the user that there are conflicting encryption preferences
#if KGUIADDONS_VERSION < QT_VERSION_CHECK(5, 73, 0)
#ifndef QT_NO_CURSOR
KPIM
::
KCursorSaver
busy
(
KPIM
::
KBusyPtr
::
busy
());
const
KPIM
::
KCursorSaver
saver
(
Qt
::
ArrowCursor
);
#endif
#else
KCursorSaver
saver
(
Qt
::
WaitCursor
);
#endif
const
QString
msg
=
i18n
(
"There are conflicting encryption preferences "
"for these recipients.
\n
"
...
...
@@ -2014,8 +2046,12 @@ bool ComposerViewBase::determineWhetherToEncrypt(bool doEncryptCompletely, Kleo:
}
case
Kleo
::
Impossible
:
{
#if KGUIADDONS_VERSION < QT_VERSION_CHECK(5, 73, 0)
#ifndef QT_NO_CURSOR
KPIM
::
KCursorSaver
busy
(
KPIM
::
KBusyPtr
::
busy
());
const
KPIM
::
KCursorSaver
saver
(
Qt
::
ArrowCursor
);
#endif
#else
KCursorSaver
saver
(
Qt
::
WaitCursor
);
#endif
const
QString
msg
=
i18n
(
"You have requested to encrypt this message, "
"and to encrypt a copy to yourself, "
...
...
@@ -2036,8 +2072,12 @@ bool ComposerViewBase::determineWhetherToEncrypt(bool doEncryptCompletely, Kleo:
if
(
!
encrypt
||
!
doEncryptCompletely
)
{
if
(
MessageComposer
::
MessageComposerSettings
::
self
()
->
cryptoWarningUnencrypted
())
{
#if KGUIADDONS_VERSION < QT_VERSION_CHECK(5, 73, 0)
#ifndef QT_NO_CURSOR
KPIM
::
KCursorSaver
busy
(
KPIM
::
KBusyPtr
::
busy
());
const
KPIM
::
KCursorSaver
saver
(
Qt
::
ArrowCursor
);
#endif
#else
KCursorSaver
saver
(
Qt
::
WaitCursor
);
#endif
const
QString
msg
=
!
doEncryptCompletely
?
i18n
(
"Some parts of this message will not be encrypted.
\n
"
...
...
messagecomposer/src/composer/keyresolver.cpp
View file @
f6b1dce2
...
...
@@ -14,9 +14,14 @@
#include "composer/keyresolver.h"
#include "job/savecontactpreferencejob.h"
#include <kguiaddons_version.h>
#if KGUIADDONS_VERSION < QT_VERSION_CHECK(5, 73, 0)
#ifndef QT_NO_CURSOR
#include <Libkdepim/KCursorSaver>
#endif
#else
#include <KCursorSaver>
#endif
#include "utils/kleo_util.h"
#include <KEmailAddress>
...
...
@@ -1551,8 +1556,12 @@ Kleo::Result Kleo::KeyResolver::showKeyApprovalDialog(bool &finalySendUnencrypte
std
::
copy
(
d
->
mSMIMEEncryptToSelfKeys
.
begin
(),
d
->
mSMIMEEncryptToSelfKeys
.
end
(),
std
::
back_inserter
(
senderKeys
));
#if KGUIADDONS_VERSION < QT_VERSION_CHECK(5, 73, 0)
#ifndef QT_NO_CURSOR
const
KPIM
::
KCursorSaver
idle
(
KPIM
::
KBusyPtr
::
idle
());
const
KPIM
::
KCursorSaver
saver
(
Qt
::
ArrowCursor
);
#endif
#else
KCursorSaver
saver
(
Qt
::
WaitCursor
);
#endif
QPointer
<
Kleo
::
KeyApprovalDialog
>
dlg
=
new
Kleo
::
KeyApprovalDialog
(
items
,
senderKeys
);
...
...
@@ -1635,8 +1644,12 @@ Kleo::Result Kleo::KeyResolver::showKeyApprovalDialog(bool &finalySendUnencrypte
:
i18n
(
"You did not select encryption keys for some of "
"the recipients: these persons will not be able to "
"decrypt the message if you encrypt it."
);
#if KGUIADDONS_VERSION < QT_VERSION_CHECK(5, 73, 0)
#ifndef QT_NO_CURSOR
KPIM
::
KCursorSaver
idle
(
KPIM
::
KBusyPtr
::
idle
());
const
KPIM
::
KCursorSaver
saver
(
Qt
::
ArrowCursor
);
#endif
#else
KCursorSaver
saver
(
Qt
::
WaitCursor
);
#endif
if
(
KMessageBox
::
warningContinueCancel
(
nullptr
,
msg
,
i18n
(
"Missing Key Warning"
),
...
...
messagecomposer/src/helper/messagefactoryng.cpp
View file @
f6b1dce2
...
...
@@ -14,9 +14,14 @@
#include "MessageComposer/Util"
#include <AkonadiCore/item.h>
#include <kguiaddons_version.h>
#if KGUIADDONS_VERSION < QT_VERSION_CHECK(5, 73, 0)
#ifndef QT_NO_CURSOR
#include <Libkdepim/KCursorSaver>
#endif
#else
#include <KCursorSaver>
#endif
#include <KIdentityManagement/kidentitymanagement/identitymanager.h>
#include <KIdentityManagement/kidentitymanagement/identity.h>
...
...
@@ -386,8 +391,12 @@ QPair< KMime::Message::Ptr, QVector< KMime::Content * > > MessageFactoryNG::crea
}
MessageHelper
::
setAutomaticFields
(
msg
,
true
);
#if KGUIADDONS_VERSION < QT_VERSION_CHECK(5, 73, 0)
#ifndef QT_NO_CURSOR
KPIM
::
KCursorSaver
busy
(
KPIM
::
KBusyPtr
::
busy
());
const
KPIM
::
KCursorSaver
saver
(
Qt
::
ArrowCursor
);
#endif
#else
KCursorSaver
saver
(
Qt
::
WaitCursor
);
#endif
if
(
numberOfItems
==
0
)
{
attachments
<<
createForwardAttachmentMessage
(
mOrigMsg
);
...
...
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