Verified Commit b5209e21 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Port away from deprecated KFileItemActions methods

parent be20366f
......@@ -22,6 +22,8 @@
#include <KFileItemListProperties>
#include <KFileItemActions>
#include <kio_version.h>
QMenu * ContextMenu::createTransferContextMenu(QList<TransferHandler*> transfers, QWidget *parent)
{
if (transfers.empty())
......@@ -83,9 +85,13 @@ QMenu * ContextMenu::createTransferContextMenu(TransferHandler* handler, QWidget
menuActions.setItemListProperties(KFileItemListProperties(items));
menuActions.setParentWidget(parent);
menuActions.addServiceActionsTo(popup);
menuActions.addOpenWithActionsTo(popup, "DesktopEntryName != 'kget'");
#if KIO_VERSION >= QT_VERSION_CHECK(5, 82, 0)
menuActions.addActionsTo(popup, KFileItemActions::MenuActionSource::Services);
menuActions.insertOpenWithActionsTo(nullptr, popup, QStringList("org.kde.kget"));
#else
menuActions.addServiceActionsTo(popup);
menuActions.addOpenWithActionsTo(popup, "DesktopEntryName != 'kget'");
#endif
// TODO : seems like the popup menu has to be showed while the KonqMenuActions instance exists ?
popup->exec(QCursor::pos());
popup->deleteLater();
......
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