Support for "mkdir -p" re-added
ClosedPublic

Authored by martinkostolny on Aug 29 2017, 9:42 PM.

Details

Summary

F7 (or any Create Folder action) will now support mkdir with path input (like "foo/bar/baz").

Unlike previous behaviour (which was broken for some time anyway), if one creates such folder hierarchy -> one stays in current folder. According the old code I've found, Krusader would've changed the current directory several times according the path input.

What's the way we want when creating a directory (or hierarchy)?

  1. Stay in current directory (simplest, now implemented)
  2. Go into last created directory
  3. Go into directory containing the last created directory

I'm for 1) unless there are requests for other options :).

Test Plan
  • create a directory "foobar"
  • create a directory "foo/bar/baz"
  • create a directory "foo/bar/baz//" (should strip the trailing slashes)
  • create a directory "../foo/bar"
  • create a directory "/tmp/mkdir-test-folder"

Diff Detail

Repository
R167 Krusader
Lint
Lint Skipped
Unit
Unit Tests Skipped
martinkostolny created this revision.Aug 29 2017, 9:42 PM
martinkostolny edited the summary of this revision. (Show Details)Aug 29 2017, 9:48 PM
martinkostolny edited the test plan for this revision. (Show Details)

Sorry, second iteration. Added support for absolute paths (starting with "/") - such path is resolved from root folder. Also works for remote filesystems. Tested on local fs and FTP.

asensi accepted this revision.Sep 1 2017, 9:58 PM
asensi added a subscriber: asensi.

For my part, I accept this because my performed tests went alright. Other people can do their checks.

This is not very important: perhaps the line

//const QString firstName = dirName.split('/').at(0);

should be removed?

> I'm for 1) unless there are requests for other options :).

I think the same. Total Commander also worked that way. Thanks!

This revision is now accepted and ready to land.Sep 1 2017, 9:58 PM
miroslavm accepted this revision.Sep 5 2017, 7:33 PM
miroslavm added a subscriber: miroslavm.

Hi,

the changes are working as expected.

  1. Stay in current directory (simplest, now implemented)

is fine for me

This revision was automatically updated to reflect the committed changes.

Thanks for testing. Committed without the commented code line mentioned by Toni, thanks for pointing that out!

I've noticed a regression after this push. Creation of new directory no longer focused the new directory. This should now be fixed in git with commit https://phabricator.kde.org/R167:ac22d0fc4412cc9a2f9130ba85184817c1667094. I didn't want to bother you with another review request. If there are another issues with this, I'll be happy to fix them.