Commit 36e918b0 authored by Tranter Madi's avatar Tranter Madi

Delay popup when dropping things into containments

Summary:
Depend: D26691
BUG: 415917

Test Plan: Drop files into desktop folder layout/folder widget, the menu is shown correctly in all cases.

Reviewers: #plasma, davidedmundson, broulik, hein

Reviewed By: #plasma, hein

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D26514
parent 26a005e8
......@@ -154,14 +154,14 @@ FocusScope {
var dragIndex = gridView.indexAt(dragPos.x, dragPos.y);
if (listener.dragX == -1 || dragIndex !== dropIndex) {
dir.drop(target, event, dropItemAt(dropPos));
dir.drop(target, event, dropItemAt(dropPos), root.isContainment && !plasmoid.immutable);
}
}
Connections {
target: dir
onPopupMenuAboutToShow: {
if (!plasmoid.immutable) {
if (root.isContainment && !plasmoid.immutable) {
plasmoid.processMimeData(mimeData, x, y, dropJob);
}
}
......
......@@ -1047,7 +1047,7 @@ static bool isDropBetweenSharedViews(const QList<QUrl> &urls, const QUrl &folder
return true;
}
void FolderModel::drop(QQuickItem *target, QObject* dropEvent, int row)
void FolderModel::drop(QQuickItem *target, QObject* dropEvent, int row, bool showMenuManually)
{
QMimeData *mimeData = qobject_cast<QMimeData *>(dropEvent->property("mimeData").value<QObject *>());
......@@ -1178,7 +1178,8 @@ void FolderModel::drop(QQuickItem *target, QObject* dropEvent, int row)
QDropEvent ev(pos, possibleActions, mimeData, buttons, modifiers);
ev.setDropAction(proposedAction);
KIO::DropJob *dropJob = KIO::drop(&ev, dropTargetUrl);
KIO::DropJobFlag flag = showMenuManually? KIO::ShowMenuManually : KIO::DropJobDefaultFlags;
KIO::DropJob *dropJob = KIO::drop(&ev, dropTargetUrl, flag);
dropJob->uiDelegate()->setAutoErrorHandlingEnabled(true);
// The QMimeData we extract from the DropArea's drop event is deleted as soon as this method
......
......@@ -218,7 +218,7 @@ class FOLDERPLUGIN_TESTS_EXPORT FolderModel : public QSortFilterProxyModel, publ
Q_INVOKABLE void setDragHotSpotScrollOffset(int x, int y); // FIXME TODO: Propify.
Q_INVOKABLE QPoint dragCursorOffset(int row);
Q_INVOKABLE void dragSelected(int x, int y);
Q_INVOKABLE void drop(QQuickItem *target, QObject *dropEvent, int row);
Q_INVOKABLE void drop(QQuickItem *target, QObject *dropEvent, int row, bool showMenuManually = false);
Q_INVOKABLE void dropCwd(QObject *dropEvent);
Q_INVOKABLE bool isBlank(int row) const;
......
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