[CopyJob] Pass resolved URL to finalDestUrl so looking up trash filename works
AbandonedPublic

Authored by broulik on Apr 6 2018, 3:02 PM.

Details

Reviewers
dfaure
Group Reviewers
Frameworks
Summary

In case of desktop:/ KIO which rewrites URLs, looking up the URL the trashed file got didn't work.
This resulted in trash:/filename being recorded by the undo manager which then failed to restore the file as it was actually trashed to e.g. trash:/0-filename

BUG: 391606

CHANGELOG: Undoing trashing files on the desktop has been fixed

Test Plan

I always looked in the wrong place, the undo manager code was all sane it was just that we tried to restore (using the direct rename shortcut) a file that didn't exist :(

Trashed a file on desktop:/, hit Ctrl+Z, file showed up again immediately.

Diff Detail

Repository
R241 KIO
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik created this revision.Apr 6 2018, 3:02 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 6 2018, 3:02 PM
broulik requested review of this revision.Apr 6 2018, 3:02 PM

There's still something borked with it. It works once for a new file but when I undo, delete and undo again it breaks or sometimes still doesn't work at all. :(

dfaure added a comment.Apr 7 2018, 7:15 PM

This calls for unittests. UndoManager has unittests here in kio, but if this requires kio_desktop then the test needs to be where kio_desktop is.

src/core/copyjob.cpp
2095

slook?

Ping, any update on this? @dfaure, could you lend a hand maybe, when you have some time?

Restricted Application added a subscriber: kde-frameworks-devel. · View Herald TranscriptFeb 23 2019, 4:24 PM
dfaure added a comment.Sep 6 2019, 3:28 PM

I'm working on it. Unittest done, now looking into potentially better fix.

dfaure requested changes to this revision.Sep 6 2019, 4:16 PM

My version is up at D23758

src/core/copyjob.cpp
2097

Is this really the version of the fix that worked for you?

It seems to me that the second arg needs to be m_currentSrcURL too, otherwise FileUndoManager tries to call KIO::rename("trash:/...", "desktop:/...") which isn't supported by the trash ioslave.

This revision now requires changes to proceed.Sep 6 2019, 4:16 PM

@Kai-Uwe, you can drop this merge request, given that D23758 is in.

broulik abandoned this revision.Sep 10 2019, 4:08 PM