Commit f54174f9 authored by David Faure's avatar David Faure
Browse files

Popupmenu: use KIO 5.27's new addPluginActionsTo method

REVIEW: 129085
parent 345e3e7a
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <KIO/EmptyTrashJob> #include <KIO/EmptyTrashJob>
#include <KIO/JobUiDelegate> #include <KIO/JobUiDelegate>
#include <KIO/Paste> #include <KIO/Paste>
#include <kio_version.h>
#include <KJobWidgets> #include <KJobWidgets>
#include <KMimeTypeTrader> #include <KMimeTypeTrader>
#include <KNewFileMenu> #include <KNewFileMenu>
...@@ -283,7 +284,7 @@ void DolphinContextMenu::openItemContextMenu() ...@@ -283,7 +284,7 @@ void DolphinContextMenu::openItemContextMenu()
fileItemActions.setItemListProperties(selectedItemsProps); fileItemActions.setItemListProperties(selectedItemsProps);
addServiceActions(fileItemActions); addServiceActions(fileItemActions);
addFileItemPluginActions(); addFileItemPluginActions(fileItemActions);
addVersionControlPluginActions(); addVersionControlPluginActions();
...@@ -355,7 +356,7 @@ void DolphinContextMenu::openViewportContextMenu() ...@@ -355,7 +356,7 @@ void DolphinContextMenu::openViewportContextMenu()
fileItemActions.setItemListProperties(baseUrlProperties); fileItemActions.setItemListProperties(baseUrlProperties);
addServiceActions(fileItemActions); addServiceActions(fileItemActions);
addFileItemPluginActions(); addFileItemPluginActions(fileItemActions);
addVersionControlPluginActions(); addVersionControlPluginActions();
...@@ -483,8 +484,12 @@ void DolphinContextMenu::addServiceActions(KFileItemActions& fileItemActions) ...@@ -483,8 +484,12 @@ void DolphinContextMenu::addServiceActions(KFileItemActions& fileItemActions)
fileItemActions.addServiceActionsTo(this); fileItemActions.addServiceActionsTo(this);
} }
void DolphinContextMenu::addFileItemPluginActions() void DolphinContextMenu::addFileItemPluginActions(KFileItemActions& fileItemActions)
{ {
#if KIO_VERSION >= QT_VERSION_CHECK(5, 27, 0)
fileItemActions.addPluginActionsTo(this);
#else
Q_UNUSED(fileItemActions);
KFileItemListProperties props; KFileItemListProperties props;
if (m_selectedItems.isEmpty()) { if (m_selectedItems.isEmpty()) {
props.setItems(KFileItemList() << baseFileItem()); props.setItems(KFileItemList() << baseFileItem());
...@@ -550,6 +555,7 @@ void DolphinContextMenu::addFileItemPluginActions() ...@@ -550,6 +555,7 @@ void DolphinContextMenu::addFileItemPluginActions()
addedPlugins << jsonMetadata.pluginId(); addedPlugins << jsonMetadata.pluginId();
} }
} }
#endif
} }
void DolphinContextMenu::addVersionControlPluginActions() void DolphinContextMenu::addVersionControlPluginActions()
......
...@@ -126,7 +126,7 @@ private: ...@@ -126,7 +126,7 @@ private:
/** /**
* Adds actions that are provided by a KFileItemActionPlugin. * Adds actions that are provided by a KFileItemActionPlugin.
*/ */
void addFileItemPluginActions(); void addFileItemPluginActions(KFileItemActions& fileItemActions);
/** /**
* Adds actions that are provided by a KVersionControlPlugin. * Adds actions that are provided by a KVersionControlPlugin.
......
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