Commit 73adfe01 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make compile without deprecated method (kf 5.83)

parent 1d0ed197
......@@ -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);
......
......@@ -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);
......
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