diff --git a/containments/desktop/package/contents/ui/FolderView.qml b/containments/desktop/package/contents/ui/FolderView.qml --- a/containments/desktop/package/contents/ui/FolderView.qml +++ b/containments/desktop/package/contents/ui/FolderView.qml @@ -134,6 +134,12 @@ } } + Connections { + target: dir + onPopupMenuAboutToShow: { + plasmoid.processMimeData(mimeData, x, y, menu); + } + } function makeBackButton() { return Qt.createQmlObject("BackButtonItem {}", main); } diff --git a/containments/desktop/plugins/folder/foldermodel.h b/containments/desktop/plugins/folder/foldermodel.h --- a/containments/desktop/plugins/folder/foldermodel.h +++ b/containments/desktop/plugins/folder/foldermodel.h @@ -249,6 +249,9 @@ void restoreSelectedFromTrash(); void undoTextChanged(const QString &text); + Q_SIGNALS: + void popupMenuAboutToShow(QObject *menu, QMimeData *mimeData, int x, int y); + private: struct DragImage { int row; diff --git a/containments/desktop/plugins/folder/foldermodel.cpp b/containments/desktop/plugins/folder/foldermodel.cpp --- a/containments/desktop/plugins/folder/foldermodel.cpp +++ b/containments/desktop/plugins/folder/foldermodel.cpp @@ -931,6 +931,13 @@ KIO::DropJob *dropJob = KIO::drop(&ev, dropTargetUrl); dropJob->ui()->setAutoErrorHandlingEnabled(true); + QMimeData *mimeDataCopy = qobject_cast(dropEvent->property("mimeData").value()); + const int x = dropEvent->property("x").toInt(); + const int y = dropEvent->property("y").toInt(); + + connect(dropJob, static_cast(&KIO::DropJob::popupMenuAboutToShow), this, [this, mimeDataCopy, x, y](const KFileItemListProperties &, QMenu *menu) { + emit popupMenuAboutToShow(menu, mimeDataCopy, x, y); + }); } void FolderModel::dropCwd(QObject* dropEvent)