Implement the renaming feature in Ark
Review Request #120337 - Created Sept. 23, 2014 and discarded
This is a review request for an implementation of the renaming feature in Ark. While the implementation is partial, it fulfills most of the use cases expected by the users and provided by other archivers, e.g. Gnome's File Roller.
Allow the user to rename a file or a directory within an archive. To keep it simple, only one entry at time can be renamed, i.e. the rename action is enabled only when there is a single selection.
What has been implemented
- Rename using libarchive and the rar plugin.
- Rename a file
- Rename a directory
- Overwrite an existing file after renaming one of its sibling (if the user confirmed the operation)
What is still missing
- Rename using the zip e 7z plugin. For the zip plugin, there is an upstream bug that makes
zipnotecrash. For the 7z plugin, its rename command is available only beginning from version 9.28 or later, that is still a beta (even Arch Linux repo are stuck to stable version 9.20). So, for both these formats, either we wait that the renaming feature is made available upstream, or we could try to use libarchive (even if just for renaming).
- Merging between directories. At the moment is not possible to merge two sibling directories when one of the two is renamed with the name of the other one. It's also not possible to overwrite a directory by a sibling file and viceversa. This feature needs much more work, a own review request and probably a deep refactoring of the
- Rename a file and then preview/extract it, to check its content. Repeat the check after reopening the archive.
- Rename a directory and then preview/extract/rename one of its children. Repeat the check after reopening the archive.
- Rename a file with the name of a sibling, confirm the overwriting and then preview/extract it. Repeat the check after reopening the archive.
- Rename a file with the name of a sibling, prevent the overwriting by choosing another name and then preview/extract it. Repeat the check after reopening the archive.
- Rename a file or directory multiple times in the same Ark session.
I've just realized that whish 234375 is highly related to the renaming feature. Indeed, renaming an entry is just a particular case of moving an entry (i.e. when the destination directory is equal to the source directory). So, I'd better to generalize the renaming feature into a move feature. This would require a filemanager-like set of actions (e.g. Cut, Copy, Paste, etc.) and this would also allow us to address other bugs like, for instance, 162054.
Having said that, before to start writing new code (possibly a lot of code), I'd really appreciate some feedback whether this strategy makes sense or not.