Refactor the "New Folder..." dialog so that it keeps a folder history and suggests folder names
ClosedPublic

Authored by asensi on Apr 30 2020, 10:49 PM.

Details

Summary

The "New Folder..." dialog is refactored in order to be able to use a folder
history, which contains a list of folder names that can be reused.

When typing the name of a new folder, if in the folder history there is an entry
that starts the same way as the new name, then folder names are suggested in a
non-intrusive way. Any unwanted element of the folder list can be deleted using
Shift+Del. That folder list is useful, for example, when creating similarly (or
equally) named folders, when creating frequent ones like: incoming, resolved,
accounting, defectives, without_backup, etc.

This commit fixes the "File -> New directory" part of:

Add separate history for each text field
https://bugs.kde.org/show_bug.cgi?id=328922

ADDED: The "New Folder..." dialog keeps a manageable folder history and suggests folder names

Test Plan

Use the "File > New Folder..." dialog in order to create folders with usual and unusual names.

Create a folder named "incoming". Check that later, after creating a new folder and typing "i", then the "incoming" name is suggested.

See the suggested folder names after pressing F7 over a file, over a folder, and over the ".." entry.

Close Krusader, execute Krusader, press F7 and check that the expected entries are seen in the folder history.

Delete entries from the new folder history:
a) using Shift+Del when the popup list is seen;
b) or using the arrow keys and Shift+Del when the popup list is not visible.

Try to delete all the host addresses until the list is empty, press Shift+Del again. Press the "Cancel" button.

Open the "File > New Folder..." dialog again, check that the list is empty.

Press F7, type "testC", press the Cancel button, press F7 again and check that the "testC" entry is not in the folder history.

Do similar tests though inside a zip file, using a fish:// connection, several versions of operating systems, etc.

Diff Detail

Repository
R167 Krusader
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
asensi requested review of this revision.Apr 30 2020, 10:49 PM
asensi created this revision.
gengisdave accepted this revision.May 3 2020, 11:55 AM
gengisdave added a subscriber: gengisdave.

Compiled and tested, no problems found

This revision is now accepted and ready to land.May 3 2020, 11:55 AM

Thanks for testing and informing, Davide!

This revision was automatically updated to reflect the committed changes.