Bug 375917 - Dialog for confirming deletion could indicate if a directory is not empty
Summary: Dialog for confirming deletion could indicate if a directory is not empty
Status: CONFIRMED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.29.0
Platform: Fedora RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: David Faure
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2017-02-02 19:31 UTC by Jonathan Wakely
Modified: 2022-10-09 19:22 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Wakely 2017-02-02 19:31:21 UTC
When deleting directories in Dolphin it would be useful if the confirmation dialog indicated whether something is a directory rather than a file, and also distinguish between empty directories and non-empty directories.

Currently you only see the name of the directory, and no indication of how many other files inside that directory (if any) might be deleted. If the item being deleted is a directory and has any contents (except . and .. of course) the dialog could tell you that (it doesn't need to list them all, just show that there's *something* inside the directory).

This would be analogous to using rmdir on the command-line. If I want to remove a directory only if it's empty I would not use 'rm -r' I would use 'rmdir', because it would fail if it's not empty.
Comment 1 Jonathan Wakely 2017-02-02 19:33:37 UTC
P.S. the Details view-mode already makes this information available, by only showing the '>' symbol to expand the directory if it is non-empty. So my requested feature isn't needed if you're using view-mode, because you can tell before trying to delete the directory if it's empty.

Another way to solve the same problem would be to add some indicator of a non-empty directory for the icons and compact views too.
Comment 2 Elvis Angelaccio 2017-02-03 09:45:01 UTC
Well, if you have the Information panel visible, it says "Size: O items" for empty folders. However, I agree it would be nice to have a confirmation dialog aware of what is about to being deleted. (Moving to kio where this belongs)
Comment 3 Ben Hekster 2022-10-01 05:53:57 UTC
Prospective contributor here; was looking through the 'junior jobs' to see if there was anywhere I might pitch in, and found this one.

I see fundamentally two approaches to addressing this:
- work within the current UI structure and tweak, making less intrusive changes 
- reconsider the current UI structure in the context of the request, and rethink the deletion dialogs themselves in a fundamentally different manner

The current deletion confirmation dialogs come in two variations: one containing the URL of a single item to be deleted, and the other containing a list of URLs in the case of multiple items.  So a less-intrusive approach would suggest tweaking the displayed URL(s) in a way that conveys the requested information.  For example:
- file items: `/path/to/file`
- empty directory items: `/path/to/directory/empty/` (note trailing slash)
- nonempty directory items: `/path/to/directory/nonempty/*` (note trailing slash and suffix asterisk)
I can anticipate there may be some edge cases to be considered (nonlocal URLs, or expensive-to-determine).

A slightly more radical solution might involve (for example) consolidating the two variations into a single dialog that recursively counts the total number of items selected, and presenting both cases as a message along the lines of "Are you sure you want to delete 12,345 items?", which would provide ample warning to somebody expecting to delete a few empty directories.

I have no idea how KDE goes about proposing/discussing UI changes, but I imagine that more drastic changes are likely to require a longer process of deliberation; so my 'tweak' proposal might be more likely to be accepted.  I'm happy to discuss this, or even attempt to implement the 'tweak' proposal-- open to any suggestions.
Comment 4 Nate Graham 2022-10-09 19:22:42 UTC
Thanks for your interest in this, Ben! You can propose UI changes or discuss such ideas in the KDE VDG room; see https://community.kde.org/Get_Involved/design#Getting_started