After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 771509 - Provide file chooser API to hide the trash similar to gtk_places_sidebar_set_show_trash
Provide file chooser API to hide the trash similar to gtk_places_sidebar_set_...
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-09-16 02:04 UTC by Mohammed Sadiq
Modified: 2018-05-02 17:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
file-chooser: add show trash and recent as options (7.88 KB, patch)
2017-03-26 15:26 UTC, Vyas Giridhar
none Details | Review
file-chooser: make show trash as optional (7.41 KB, patch)
2017-03-27 02:25 UTC, Vyas Giridhar
none Details | Review

Description Mohammed Sadiq 2016-09-16 02:04:43 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
Comment 1 Kartikeya Sharma 2017-02-25 12:33:00 UTC
(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?
Comment 2 Vyas Giridhar 2017-02-26 02:14:43 UTC
(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?
Comment 3 Ernestas Kulik 2017-02-26 06:33:48 UTC
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+.
Comment 4 Ernestas Kulik 2017-02-26 06:39:48 UTC
(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*
Comment 5 Kartikeya Sharma 2017-02-26 07:11:11 UTC
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).
Comment 6 Carlos Soriano 2017-02-26 10:13:58 UTC
So this is gtk+, and I think easy enough to be for newcomers in case you still want to give it a shot.
Comment 7 Vyas Giridhar 2017-03-26 15:26:24 UTC
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.
Comment 8 Vyas Giridhar 2017-03-26 15:29:22 UTC
(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 9 Vyas Giridhar 2017-03-26 15:47:51 UTC
Comment on attachment 348740 [details] [review]
file-chooser: add show trash and recent as options

Ignore the above patch.
Comment 10 Vyas Giridhar 2017-03-27 02:25:02 UTC
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.
Comment 11 GNOME Infrastructure Team 2018-05-02 17:32:39 UTC
-- 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.