GNOME Bugzilla – Bug 771509
Provide file chooser API to hide the trash similar to gtk_places_sidebar_set_show_trash
Last modified: 2018-05-02 17:32:39 UTC
When a file is copied/moved, Trash is listed in the destination list, which shouldn't happen. How to reproduce: 1. Select some file -> Right click -> Copy to/ Move to. Result: Trash is listed in the sidebar, But the copy/move fails as expected (since trash doesn't support those operations). Expected result: Don't list trash in the sidebar
(In reply to Mohammed Sadiq from comment #0) > When a file is copied/moved, Trash is listed in the destination list, which > shouldn't happen. > > How to reproduce: > 1. Select some file -> Right click -> Copy to/ Move to. > > Result: > Trash is listed in the sidebar, But the copy/move fails as expected (since > trash doesn't support those operations). > > Expected result: > Don't list trash in the sidebar we use GtkFileChooserDialog for copy to/move to. I could not find any API to disable/hide Trash listed in sidebar, in GtkFileChooser/GtkFileChooserDialog. Can this be a bug for GtkFileChooser to provide this API? or am i missing something?
(In reply to Kartikeya Sharma from comment #1) > (In reply to Mohammed Sadiq from comment #0) > > When a file is copied/moved, Trash is listed in the destination list, which > > shouldn't happen. > > > > How to reproduce: > > 1. Select some file -> Right click -> Copy to/ Move to. > > > > Result: > > Trash is listed in the sidebar, But the copy/move fails as expected (since > > trash doesn't support those operations). > > > > Expected result: > > Don't list trash in the sidebar > > we use GtkFileChooserDialog for copy to/move to. I could not find any API to > disable/hide Trash listed in sidebar, in > GtkFileChooser/GtkFileChooserDialog. Can this be a bug for GtkFileChooser to > provide this API? or am i missing something? Can we inherit GtkFileChooser to exclude Trash and use this class for folder selection?
I think it would make more sense to hide trash in the sidebar for all file chooser widgets with the save action. It doesn’t sound like it should even be a valid use case to trash files like that. That would mean reassigning this to GTK+.
(In reply to Ernestas Kulik from comment #3) > I think it would make more sense to hide trash in the sidebar for all file > chooser widgets with the save action. It doesn’t sound like it should even > be a valid use case to trash files like that. That would mean reassigning > this to GTK+. Oh, it’s not even the save action that is used. *shrug*
GtkPlacesSidebar provides gtk_places_sidebar_set_show_trash () for this purpose but GtkFileChooser/GtkFileChooserDialog doesn't provide this in their API. So, we just need to write a wrapper function for that in GtkFileChooser/GtkFileChooserDialog and make it public for use (At least that is what i think).
So this is gtk+, and I think easy enough to be for newcomers in case you still want to give it a shot.
Created attachment 348740 [details] [review] file-chooser: add show trash and recent as options When a file is copied/moved, Trash is listed in the destination list, which shouldn't happen. This commit adds the option to remove the Trash place from the GtkPlacesSidebar.
(In reply to Vyas Giridhar from comment #7) > Created attachment 348740 [details] [review] [review] > file-chooser: add show trash and recent as options > > When a file is copied/moved, Trash is listed in the destination list, > which shouldn't happen. > > This commit adds the option to remove the Trash place from > the GtkPlacesSidebar. The above patch is not complete, The trash place is removed but in it's place the current working directory from which it was launched is present.
Comment on attachment 348740 [details] [review] file-chooser: add show trash and recent as options Ignore the above patch.
Created attachment 348763 [details] [review] file-chooser: make show trash as optional When a file is copied/moved, Trash is listed in the destination list, which shouldn't happen. This commit adds the option to remove the Trash place from the GtkPlacesSidebar.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/674.