In the same way that we cannot delete home folder totally with right click, delete permanently (if enabled), and we cannot do that selecting home folder in the main panel, we should not be able to do it with keyboard delete key in the left treeview panel. How to reproduce: * Select treeview for the sidebar * Select home folder and try to delete it by pressing "delete", you can delete all the home user content.
Created attachment 8443 proposed patch The attached patch adds an additional check, so that pressing the DEL key will have no effect in the described scenario. Also, works as expected when GVfs is disabled.
Not sure I get this right ... so this bug is NOT about permanent deletion, but just about moving a folder to trash. In that case the proposed patch looks almost good to me. One thing to add: thunar_tree_view_get_selected_file may return NULL in some occassions. Something like if (G_LIKELY (file != NULL) should be added to avoid crashes. /* ask the user whether to delete the folder... */ I did not notice any query .. possibly the comment is a lie and can be dumped ?
Created attachment 8444 proposed patch v2 New patch based on the findings from a discussion with alexxcons.
Created attachment 8446 fix + removal of duplicated code Attached a fix which as well removes the duplicated code from the two delete methods by adding a third, general method. move_to_trash now does not delete any more (which directly conflicted with the method name)
Alexander Schwinn referenced this bugreport in commit 693b36ca57d6642d9a45bc74c8066c3d89aab7fc delete key in tree-view can delete the user home folder (Bug #15095) https://git.xfce.org/xfce/thunar/commit?id=693b36ca57d6642d9a45bc74c8066c3d89aab7fc
Alexander Schwinn referenced this bugreport in commit ac629bb919764294d3c37b110facc8e2652fd61c delete key in tree-view can delete the user home folder (Bug #15095) https://git.xfce.org/xfce/thunar/commit?id=ac629bb919764294d3c37b110facc8e2652fd61c
Fixed for master and 4.14 branch, will be released in 1.8.5