summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2016-10-02 19:03:01 (GMT)
committerDavid Faure <faure@kde.org>2016-10-02 20:28:03 (GMT)
commitf54174f9f6b99aac433e81cad9965a7f31786ce7 (patch)
tree4c234462dcd06bf9d44c0bca4d2c5da1a1c44720
parent345e3e7a8276c12b481c3b6e91fb2e7ca6b6ab2b (diff)
Popupmenu: use KIO 5.27's new addPluginActionsTo method
REVIEW: 129085
-rw-r--r--src/dolphincontextmenu.cpp12
-rw-r--r--src/dolphincontextmenu.h2
2 files changed, 10 insertions, 4 deletions
diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp
index 971ef1e..ed3f643 100644
--- a/src/dolphincontextmenu.cpp
+++ b/src/dolphincontextmenu.cpp
@@ -34,6 +34,7 @@
#include <KIO/EmptyTrashJob>
#include <KIO/JobUiDelegate>
#include <KIO/Paste>
+#include <kio_version.h>
#include <KJobWidgets>
#include <KMimeTypeTrader>
#include <KNewFileMenu>
@@ -283,7 +284,7 @@ void DolphinContextMenu::openItemContextMenu()
fileItemActions.setItemListProperties(selectedItemsProps);
addServiceActions(fileItemActions);
- addFileItemPluginActions();
+ addFileItemPluginActions(fileItemActions);
addVersionControlPluginActions();
@@ -355,7 +356,7 @@ void DolphinContextMenu::openViewportContextMenu()
fileItemActions.setItemListProperties(baseUrlProperties);
addServiceActions(fileItemActions);
- addFileItemPluginActions();
+ addFileItemPluginActions(fileItemActions);
addVersionControlPluginActions();
@@ -483,8 +484,12 @@ void DolphinContextMenu::addServiceActions(KFileItemActions& fileItemActions)
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;
if (m_selectedItems.isEmpty()) {
props.setItems(KFileItemList() << baseFileItem());
@@ -550,6 +555,7 @@ void DolphinContextMenu::addFileItemPluginActions()
addedPlugins << jsonMetadata.pluginId();
}
}
+#endif
}
void DolphinContextMenu::addVersionControlPluginActions()
diff --git a/src/dolphincontextmenu.h b/src/dolphincontextmenu.h
index 419d3f9..f67300d 100644
--- a/src/dolphincontextmenu.h
+++ b/src/dolphincontextmenu.h
@@ -126,7 +126,7 @@ private:
/**
* Adds actions that are provided by a KFileItemActionPlugin.
*/
- void addFileItemPluginActions();
+ void addFileItemPluginActions(KFileItemActions& fileItemActions);
/**
* Adds actions that are provided by a KVersionControlPlugin.