[dolphin] [Bug 462928] Copying a file after another copies the first file again

antonio bugzilla_noreply at kde.org
Tue Dec 13 19:07:51 GMT 2022


https://bugs.kde.org/show_bug.cgi?id=462928

--- Comment #7 from antonio <antdev66 at gmail.com> ---
(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...

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the kfm-devel mailing list