Commit 465c89d5 authored by Kurt Hindenburg's avatar Kurt Hindenburg
Browse files

Add KIO version checks for insertOpenWithActionsTo()

void KFileItemActions::insertOpenWithActionsTo(QAction*, QMenu*,
const QString) requires KF 5.78 while
void KFileItemActions::insertOpenWithActionsTo (QAction*, QMenu*,
const QStringList) requires KF 5.82.  For any KF version earlier, use
void KFileItemActions::addOpenWithActionsTo(QMenu*, const QString)

Fixes build on older systems after
!527
parent 55994120
Pipeline #123454 passed with stage
in 1 minute and 58 seconds
......@@ -50,6 +50,7 @@
#include <KFileItemListProperties>
#include <kconfigwidgets_version.h>
#include <kio_version.h>
#include <kwidgetsaddons_version.h>
// Konsole
......@@ -1836,7 +1837,14 @@ void SessionController::showDisplayContextMenu(const QPoint &position)
const KFileItemListProperties props({item});
QScopedPointer<KFileItemActions> ac(new KFileItemActions(popup));
ac->setItemListProperties(props);
#if KIO_VERSION >= QT_VERSION_CHECK(5, 82, 0)
ac->insertOpenWithActionsTo(popup->actions().value(4, nullptr), popup, QStringList{qApp->desktopFileName()});
#elif KIO_VERSION >= QT_VERSION_CHECK(5, 78, 0)
ac->insertOpenWithActionsTo(popup->actions().value(4, nullptr), popup, QString());
#else
ac->addOpenWithActionsTo(popup);
#endif
auto newActions = popup->actions();
for (auto* elm : old) {
......
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