diff --git a/src/widgets/dropjob.h b/src/widgets/dropjob.h --- a/src/widgets/dropjob.h +++ b/src/widgets/dropjob.h @@ -28,6 +28,7 @@ class QAction; class QDropEvent; +class QMenu; class KFileItemListProperties; namespace KIO @@ -86,6 +87,16 @@ */ void popupMenuAboutToShow(const KFileItemListProperties &itemProps); + /** + * Signals that the popup menu is about to be shown. + * Applications can use the information provided about the dropped URLs + * (e.g. the mimetype) to decide whether to call setApplicationActions. + * @param itemProps properties of the dropped items + * @param menu the popup menu instance + * @since 5.32 + */ + void popupMenuAboutToShow(const KFileItemListProperties &itemProps, QMenu *menu); + protected Q_SLOTS: void slotResult(KJob *job) Q_DECL_OVERRIDE; diff --git a/src/widgets/dropjob.cpp b/src/widgets/dropjob.cpp --- a/src/widgets/dropjob.cpp +++ b/src/widgets/dropjob.cpp @@ -238,6 +238,7 @@ const KFileItemListProperties itemProps(fileItems); emit q->popupMenuAboutToShow(fileItems); + emit q->popupMenuAboutToShow(fileItems, popup); const bool sReading = itemProps.supportsReading(); const bool sDeleting = itemProps.supportsDeleting();