Commit 21ded111 authored by Fushan Wen's avatar Fushan Wen
Browse files

foldermodel: don't early return if mimeData has empty urls in `FolderModel::drop`

This makes the "Ark drag-and-drop" work again.

CCBUG: 453390
parent 58b952dd
Pipeline #175459 passed with stage
in 3 minutes and 15 seconds
......@@ -1072,6 +1072,10 @@ void FolderModel::dragSelectedInternal(int x, int y)
static bool isDropBetweenSharedViews(const QList<QUrl> &urls, const QUrl &folderUrl)
{
if (urls.empty()) {
return false;
}
for (const auto &url : urls) {
if (folderUrl.adjusted(QUrl::StripTrailingSlash) != url.adjusted(QUrl::RemoveFilename | QUrl::StripTrailingSlash)) {
return false;
......@@ -1200,6 +1204,11 @@ void FolderModel::drop(QQuickItem *target, QObject *dropEvent, int row, bool sho
KIO::DropJob *dropJob = KIO::drop(&ev, dropTargetUrl, flag);
dropJob->uiDelegate()->setAutoErrorHandlingEnabled(true);
// No menu will be shown so skip copying QMimeData
if (mimeData->urls().empty()) {
return;
}
// The QMimeData we extract from the DropArea's drop event is deleted as soon as this method
// ends but we need to keep a copy for when popupMenuAboutToShow fires.
QMimeData *mimeCopy = new QMimeData();
......
Supports Markdown
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