! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
delete key in tree view can delete all home user folder
Status:
RESOLVED: FIXED

Comments

Description hapical 2019-01-28 21:13:38 CET
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.
Comment 1 Theo Linkspfeifer editbugs 2019-04-22 22:10:19 CEST
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.
Comment 2 alexxcons editbugs 2019-04-22 23:37:56 CEST
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 ?
Comment 3 Theo Linkspfeifer editbugs 2019-04-23 02:07:05 CEST
Created attachment 8444 
proposed patch v2

New patch based on the findings from a discussion with alexxcons.
Comment 4 alexxcons editbugs 2019-04-23 12:25:34 CEST
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)
Comment 5 Git Bot editbugs 2019-04-23 20:57:21 CEST
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
Comment 6 Git Bot editbugs 2019-04-23 20:59:52 CEST
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
Comment 7 alexxcons editbugs 2019-04-23 21:01:24 CEST
Fixed for master and 4.14 branch, will be released in 1.8.5

Bug #15095

Reported by:
hapical
Reported on: 2019-01-28
Last modified on: 2019-04-23

People

Assignee:
Xfce Bug Triage
CC List:
4 users

Version

Attachments

proposed patch (1.39 KB, patch)
2019-04-22 22:10 CEST , Theo Linkspfeifer
no flags
proposed patch v2 (3.30 KB, patch)
2019-04-23 02:07 CEST , Theo Linkspfeifer
no flags
fix + removal of duplicated code (5.30 KB, patch)
2019-04-23 12:25 CEST , alexxcons
no flags

Additional information