Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Desktop
Commits
21ded111
Commit
21ded111
authored
May 12, 2022
by
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
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
containments/desktop/plugins/folder/foldermodel.cpp
View file @
21ded111
...
...
@@ -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
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment