Summary: | Drag and drop does not work in folder view | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kio | Reporter: | dusan.peterc |
Component: | general | Assignee: | David Faure <faure> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | bshah, kde, kdelibs-bugs-null, plasma-bugs-null |
Priority: | NOR | ||
Version First Reported In: | 5.22.0 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
URL: | https://en.wikipedia.org/wiki/Drag_and_drop | ||
Latest Commit: | http://commits.kde.org/plasma-desktop/a79cbce0fed06c64ea32cd540b4824662e3a7e9e | Version Fixed In: | 5.7.0 |
Sentry Crash Report: |
Description
dusan.peterc
2016-06-05 16:25:46 UTC
I can confirm also on master. What this bug report is about: 1. Have a folderview set to desktop:/ folder 2. Have a desktop file to an application there (eg. drag Kate from kickoff there and link here) 3. now drag a file onto the "Kate" icon in the folderview Instead of opening Kate with the file I just dropped, I get an error message saying "Access denied to ." Problem lies here in foldermodel.cpp I suppose: if (file.readType() == QLatin1String("Link")) { dropTargetUrl = file.readUrl(); } else { dropTargetUrl = item.url(); } If the desktop file is a Link to another location it should offer to move/copy/link to that location or else move/copy/link to where the desktop file is (. being the current directory). It nowhere handles the case of dropping something onto an Application type desktop file It does -- KIO::drop() is responsible for that. Right, I can also reproduce with Dolphin. Either a bug in KIO or the desktop:/ kio slave. Re-assigning. It creates a DropJob with URL QUrl("desktop:/org.kde.kate.desktop") which is then rewritten *somewhere* (I suspect the rewriteUrl thing in the desktop KIO slave) to QUrl("file:///home/kaiuwe/Schreibtisch//foo"), note the double slash. This ends up making QUrl::toLocalFile fail and return an empty QString in the DropJobPrivate::slotStart() so KDesktopFile::isDesktopFile returns false and it never actually tries to open the dropped file with the application. Git commit f2772c4fe63944f71f797c0d34d2cdb37897a535 by David Faure. Committed on 16/06/2016 at 13:34. Pushed by dfaure into branch 'master'. Fix DnD onto desktop:/ app desktop file. We need to resolve from desktop:/ to file:/ so that DropJob can handle application .desktop files. M +1 -1 src/panels/folders/folderspanel.cpp M +1 -1 src/views/dolphinview.cpp http://commits.kde.org/dolphin/f2772c4fe63944f71f797c0d34d2cdb37897a535 Git commit a79cbce0fed06c64ea32cd540b4824662e3a7e9e by Kai Uwe Broulik. Committed on 27/06/2016 at 10:34. Pushed by broulik into branch 'Plasma/5.7'. [FolderModel] Use mostLocalUrl() to properly resolve desktop:/ URLs This fixes dropping files onto applications in the desktop:/ folder. FIXED-IN: 5.7.0 Differential Revision: https://phabricator.kde.org/D1915 M +2 -2 containments/desktop/plugins/folder/foldermodel.cpp http://commits.kde.org/plasma-desktop/a79cbce0fed06c64ea32cd540b4824662e3a7e9e |