Summary: | Copying a file after another copies the first file again | ||
---|---|---|---|
Product: | [Applications] dolphin | Reporter: | Yannick Roehlly <yannick.roehlly> |
Component: | general | Assignee: | Dolphin Bug Assignee <dolphin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | akb825, antdev66, bizyaev, coucouf, deltaone, felixernst, jeffrey.kenner, jens-bugs.kde.org, kfm-devel, michaelrst, nate, phantom4, sbjonathansb, thesourcehim, vze1pbnt, xavier.corredor.llano |
Priority: | HI | ||
Version: | 22.12.0 | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | Dolphin 22.12.1 and/or KF 5.102 | |
Sentry Crash Report: |
Description
Yannick Roehlly
2022-12-11 19:47:39 UTC
I confirm this bug. Operating System: Debian GNU/Linux KDE Plasma Version: 5.26.4 KDE Frameworks Version: 5.100.0 Qt Version: 5.15.6 It seems to be a clipboard problem: only the first element is inserted in the clipboard, the next are ignored, so the problem occurs ...same here on Gentoo and Arch. The same bug was reported on Debian unstable since the 22.12.0 upload : https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1025943 I couldn't reproduce this. Would be interesting to know if https://invent.kde.org/system/dolphin/-/commit/8d7e600f63a1961294dfe2c278a710b4ce0716e9 might be the cause of this. That commit made it so Dolphin can copy files to sandboxed applications (flatpak, snap). For this to work, it had to change what is exported to the clipboard. (In reply to Felix Ernst from comment #5) > I couldn't reproduce this. > Would be interesting to know if > https://invent.kde.org/system/dolphin/-/commit/ > 8d7e600f63a1961294dfe2c278a710b4ce0716e9 might be the cause of this. That > commit made it so Dolphin can copy files to sandboxed applications (flatpak, > snap). For this to work, it had to change what is exported to the clipboard. I tried to recompile locally, revert this commit solve the problem. (In reply to antonio from comment #6) > (In reply to Felix Ernst from comment #5) > > I couldn't reproduce this. > > Would be interesting to know if > > https://invent.kde.org/system/dolphin/-/commit/ > > 8d7e600f63a1961294dfe2c278a710b4ce0716e9 might be the cause of this. That > > commit made it so Dolphin can copy files to sandboxed applications (flatpak, > > snap). For this to work, it had to change what is exported to the clipboard. > > I tried to recompile locally, revert this commit solve the problem. The following changes create the problem: src/kitemviews/kitemlistcontroller.cpp src/views/dolphinview.cpp -> create problem This change instead does not seem to influence: src/panels/folders/treeviewcontextmenu.cpp -> no problem --- I don't know the code, but if you recompile these changes, no problems occur (and maintain export): src/views/dolphinview.cpp: void DolphinView::cutSelectedItemsToClipboard() { QMimeData* mimeData = selectionMimeData(); KIO::setClipboardDataCut(mimeData, true); - KUrlMimeData::exportUrlsToPortal(mimeData); QApplication::clipboard()->setMimeData(mimeData); + QMimeData* mimeData2 = selectionMimeData(); + KUrlMimeData::exportUrlsToPortal(mimeData2); } void DolphinView::copySelectedItemsToClipboard() { QMimeData *mimeData = selectionMimeData(); - KUrlMimeData::exportUrlsToPortal(mimeData); QApplication::clipboard()->setMimeData(mimeData); + QMimeData* mimeData2 = selectionMimeData(); + KUrlMimeData::exportUrlsToPortal(mimeData2); } src/kitemviews/kitemlistcontroller.cpp: - KUrlMimeData::exportUrlsToPortal(data); + QMimeData *data2 = m_model->createMimeData(selectedItems); + KUrlMimeData::exportUrlsToPortal(data2); if it can help... (In reply to antonio from comment #6) > (In reply to Felix Ernst from comment #5) > > I couldn't reproduce this. > > Would be interesting to know if > > https://invent.kde.org/system/dolphin/-/commit/ > > 8d7e600f63a1961294dfe2c278a710b4ce0716e9 might be the cause of this. That > > commit made it so Dolphin can copy files to sandboxed applications (flatpak, > > snap). For this to work, it had to change what is exported to the clipboard. > > I tried to recompile locally, revert this commit solve the problem. Thanks a lot for testing! This helps quite a bit! (In reply to antonio from comment #7) > I don't know the code, but if you recompile these changes, no problems occur > (and maintain export): Your changes are unfortunately functionally identical to a complete revert of 8d7e600f63a1961294dfe2c278a710b4ce0716e9. We need the same `data` object that was used in `exportUrlsToPortal()` to make its way to the clipboard, otherwise it has no effect and we lose the functionality of copy-pasting into sandboxed applications. Thanks for trying to fix it though! Git commit c8aed8ac81d9f7f3dc93a7570037041228a98bf4 by Felix Ernst. Committed on 14/12/2022 at 12:33. Pushed by felixernst into branch 'release/22.12'. Revert "portalize drag urls" This reverts commit 8d7e600f63a1961294dfe2c278a710b4ce0716e9. While this revert unfortunately removes Dolphin's ability to copy to sandboxed applications, the bugs being temporarily fixed by this seem more important. See the bugs mentioned below for details. Especially copy-pasting needs to work flawlessly for an application like Dolphin. After the revert this will either work correctly or – in the case of sandboxed applications – not at all. Related: bug 457529 M +1 -3 src/kitemviews/kitemlistcontroller.cpp M +0 -1 src/panels/folders/treeviewcontextmenu.cpp M +1 -4 src/views/dolphinview.cpp https://invent.kde.org/system/dolphin/commit/c8aed8ac81d9f7f3dc93a7570037041228a98bf4 With above commit, this will be fixed for Dolphin 22.12.1. I didn't revert on master so I hope we will be able to fix this bug in time for the Dolphin 23.04 release. This bug report will be kept open to track that. First of all, thanks for the quick fix of this bug. Today I almost lost a lot of documents due to this error while moving and overwriting some files in different folders, this bug could be terrible, KDE's users can easily lose their data with this bug, IMHO please consider releasing this patch asap in a new release. Thanks so much. I think the actual fix is here? https://invent.kde.org/frameworks/kcoreaddons/-/merge_requests/267 *** Bug 463095 has been marked as a duplicate of this bug. *** This should be fixed in the yet-to-be-released KDE frameworks 5.102 now by Ilya's commit https://invent.kde.org/frameworks/kcoreaddons/-/commit/75241a0929fb9d648c72385471760cfc937ff226. Marking as resolved. *** Bug 463579 has been marked as a duplicate of this bug. *** *** Bug 463351 has been marked as a duplicate of this bug. *** *** Bug 464235 has been marked as a duplicate of this bug. *** *** Bug 463672 has been marked as a duplicate of this bug. *** *** Bug 463816 has been marked as a duplicate of this bug. *** *** Bug 465193 has been marked as a duplicate of this bug. *** |