KIO::DndPopupMenuPlugin Class

Base class for drag and drop popup menus. More...

Header: #include <KIO/DndPopupMenuPlugin>
CMake: find_package(KF6 REQUIRED COMPONENTS KIO)
target_link_libraries(mytarget PRIVATE KIOGui)
Since: KDE Frameworks 5.6
Inherits: QObject

Public Functions

DndPopupMenuPlugin(QObject *parent)
virtual QList<QAction *> setup(const KFileItemListProperties &popupMenuInfo, const QUrl &destination) = 0

Detailed Description

This can be used for adding dynamic menu items to the normal copy/move/link here menu appearing in KIO-based file managers. In the setup method you may check the properties of the dropped files, and if applicable, append your own QAction that the user may trigger in the menu.

The plugin should have Json metadata and be installed into kf6/kio_dnd/.

Member Function Documentation

DndPopupMenuPlugin::DndPopupMenuPlugin(QObject *parent)

Constructor.

[pure virtual] QList<QAction *> DndPopupMenuPlugin::setup(const KFileItemListProperties &popupMenuInfo, const QUrl &destination)

Implement the setup method in the plugin in order to create actions in the given actionCollection and add it to the menu using menu->addAction(). The popup menu will be set as parent of the actions.

popupMenuInfo all the information about the source URLs being dropped

destination the URL to where the file(s) were dropped

Returns a QList with the QActions that will be plugged into the menu.