Merge lp://qastaging/~facundo/ubuntuone-client/delete-to-trash into lp://qastaging/ubuntuone-client
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Facundo Batista | ||||
Approved revision: | 936 | ||||
Merged at revision: | 934 | ||||
Proposed branch: | lp://qastaging/~facundo/ubuntuone-client/delete-to-trash | ||||
Merge into: | lp://qastaging/ubuntuone-client | ||||
Diff against target: |
893 lines (+397/-120) 9 files modified
data/syncdaemon.conf (+6/-0) tests/platform/linux/test_os_helper.py (+105/-0) tests/syncdaemon/test_config.py (+5/-0) tests/syncdaemon/test_fsm.py (+107/-30) ubuntuone/platform/linux/__init__.py (+2/-1) ubuntuone/platform/linux/os_helper.py (+26/-0) ubuntuone/syncdaemon/config.py (+17/-3) ubuntuone/syncdaemon/filesystem_manager.py (+120/-80) ubuntuone/syncdaemon/sync.py (+9/-6) |
||||
To merge this branch: | bzr merge lp://qastaging/~facundo/ubuntuone-client/delete-to-trash | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Guillermo Gonzalez | Approve | ||
Lucio Torre (community) | Approve | ||
Review via email:
|
Commit message
Move to trash instead of plain deletion (LP: #690673)
Description of the change
Move to trash instead of plain deletion
For this, os_helper grown a new "move_to_trash" operation (only the linux part, for the windows version see #747741).
FSM calls this new method instead of just removing the file. The only issue was that for tree deletion the code relied on shutil.rmtree's on_error calls to make the directories RW, and we couldn't do that (because if we need to remove a whole tree, that whole tree must go to trash, not files and directories individually).
So, I had to refactor how EnableShareWrite works, to support a "recursive" option.
Finally, note that this new behaviour is configurable. However, to make it work, I had to fix the path in config.py, to take also the configuration from the branch (this was broken somewhen, you only notice that when a new parameter is added).
Tests included for everything.
=== modified file 'data/syncdaemo n.conf'
+use_trash.help = Send the files and folders to XDG Trash folder instead of
+ removing them permanently.
syncdaemon.conf is not platform dependent and i am not sure the trashbin in windows or other OSes is done/managed or anything by xdg.
we should get guillos coment on this one as well.