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
73adfe01
Commit
73adfe01
authored
May 08, 2021
by
Laurent Montel
😁
Browse files
Make compile without deprecated method (kf 5.83)
parent
1d0ed197
Changes
2
Hide whitespace changes
Inline
Side-by-side
messagecomposer/src/attachment/attachmentcontrollerbase.cpp
View file @
73adfe01
...
...
@@ -27,6 +27,7 @@
#include <AkonadiCore/itemfetchjob.h>
#include <QIcon>
#include <kio/jobuidelegate.h>
#include <kio_version.h>
#include <QMenu>
#include <QPointer>
...
...
@@ -313,7 +314,11 @@ void AttachmentControllerBase::Private::editDone(MessageViewer::EditorWatcher *w
void
AttachmentControllerBase
::
Private
::
createOpenWithMenu
(
QMenu
*
topMenu
,
const
AttachmentPart
::
Ptr
&
part
)
{
const
QString
contentTypeStr
=
QString
::
fromLatin1
(
part
->
mimeType
());
#if KIO_VERSION < QT_VERSION_CHECK(5, 83, 0)
const
KService
::
List
offers
=
KFileItemActions
::
associatedApplications
(
QStringList
()
<<
contentTypeStr
,
QString
());
#else
const
KService
::
List
offers
=
KFileItemActions
::
associatedApplications
(
QStringList
()
<<
contentTypeStr
);
#endif
if
(
!
offers
.
isEmpty
())
{
QMenu
*
menu
=
topMenu
;
auto
actionGroup
=
new
QActionGroup
(
menu
);
...
...
messageviewer/src/viewer/viewer_p.cpp
View file @
73adfe01
...
...
@@ -30,6 +30,7 @@
#include "htmlwriter/webengineembedpart.h"
#include "viewerplugins/viewerplugintoolmanager.h"
#include <KContacts/VCardConverter>
#include <kio_version.h>
// KDE includes
#include <KActionCollection>
#include <KActionMenu>
...
...
@@ -420,7 +421,11 @@ void ViewerPrivate::scrollToAnchor(const QString &anchor)
void
ViewerPrivate
::
createOpenWithMenu
(
QMenu
*
topMenu
,
const
QString
&
contentTypeStr
,
bool
fromCurrentContent
)
{
#if KIO_VERSION > QT_VERSION_CHECK(5, 82, 0)
const
KService
::
List
offers
=
KFileItemActions
::
associatedApplications
(
QStringList
()
<<
contentTypeStr
);
#else
const
KService
::
List
offers
=
KFileItemActions
::
associatedApplications
(
QStringList
()
<<
contentTypeStr
,
QString
());
#endif
if
(
!
offers
.
isEmpty
())
{
QMenu
*
menu
=
topMenu
;
auto
actionGroup
=
new
QActionGroup
(
menu
);
...
...
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