FileUndoManager: Undoing symlink creation
Review Request #128527 - Created July 26, 2016 and submitted
|Chinmoy Ranjan Pradhan|
This patch adds the support for undoing creation of new symlinks.
Nice! Can you add a testcase in autotests/fileundomanagertest.cpp ?
I would start from FileUndoManagerTest::testCreateDir and adapt it for symlinks. The test should start with
QSKIP("Test skipped on Windows for lack of proper symlink support");
"I guess" isn't good enough for me, it's the point I want to clarify :-)
I now did some research.
Thanks for reminding me of the Copy-Job based KIO::link.
That one is supported by FileUndoManager (since it emits copyingLinkDone)... and in fact it's what we should be using in knewfilemenu.cpp, because it also supports popping up the "rename" dialog when trying to create a symlink with a name that already exists.
KIO::symlink is the low-level operation, KIO::link is the high-level operation, with support for conflict-handling and undo.
I think the real fix here is to change knewfilemenu.cpp - and the fileundomanager unittest - to use KIO::link. With a bit of luck, no change will be needed in fileundomanager itself ;-)
Can you give it a try?