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 756589 - Improve the heuristics for external drives
Improve the heuristics for external drives
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 756542 756782 757034 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-10-14 19:55 UTC by Carlos Soriano
Modified: 2015-11-23 17:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkplacessidebar: improve heuristics for external drives (2.92 KB, patch)
2015-10-14 19:55 UTC, Carlos Soriano
committed Details | Review
gtkplacesview: remove dead code (1.21 KB, patch)
2015-10-14 19:55 UTC, Carlos Soriano
committed Details | Review
gtkplacesview: remove dead code (782 bytes, patch)
2015-10-14 19:55 UTC, Carlos Soriano
committed Details | Review
gtkplacesview: improve heuristics for external drives (1.94 KB, patch)
2015-10-14 19:55 UTC, Carlos Soriano
committed Details | Review
nautilus screencast (235.28 KB, video/webm)
2015-11-16 09:21 UTC, Luis Henrique Mello
  Details

Description Carlos Soriano 2015-10-14 19:55:25 UTC
Following https://bugzilla.gnome.org/show_bug.cgi?id=755654 we want to
hide all external drives in the sidebar and show them on gtkplacesview.
However checking for can_eject and is_media_removable is not enough, since
some external drives report that they are not. However we can check if they
can be stopped, that I believe internal drives can not.

These serie of patches do it for the sidebar and the gtkplacesview, alongside
with two patches for gtkplacesview that clean up some code.
Comment 1 Carlos Soriano 2015-10-14 19:55:30 UTC
Created attachment 313326 [details] [review]
gtkplacessidebar: improve heuristics for external drives

Since the change to use GtkPlacesView we don't want to show
internal storage on the sidebar.

In our case we were checking for drive_can_eject and
drive_is_media_removable.

However for some external hard drives it's reported that they
are not ejectable nor the have removable media. So the only
attribute that they have different from internal drives is that
they can be stopped.
So check for if the drive can be stopped to decide if it is
external or internal.

On the way realized we don't need to check for the mounts associated
with the volume to know if the volume can be ejected or not. So remove
that code.
Comment 2 Carlos Soriano 2015-10-14 19:55:37 UTC
Created attachment 313327 [details] [review]
gtkplacesview: remove dead code

This is checked on is_removable_volume
Comment 3 Carlos Soriano 2015-10-14 19:55:43 UTC
Created attachment 313328 [details] [review]
gtkplacesview: remove dead code

This is checked on add_volume inside the loop.
Comment 4 Carlos Soriano 2015-10-14 19:55:50 UTC
Created attachment 313329 [details] [review]
gtkplacesview: improve heuristics for external drives

Following the sidebar on commit b0989b190df, improve the way
we check when a drive is external or not.
Comment 5 Matthias Clasen 2015-10-15 14:07:10 UTC
Review of attachment 313326 [details] [review]:

Might have been nicer as three separate commits:

1) remove the unused mount

2) rename from removable to external

3) add the extra condition

But I'm not picky, so just push it as-is.
Comment 6 Matthias Clasen 2015-10-15 14:08:54 UTC
Review of attachment 313327 [details] [review]:

I would say "checked in", not "checked on".
Comment 7 Matthias Clasen 2015-10-15 14:10:01 UTC
Review of attachment 313328 [details] [review]:

Here too: "checked in"
Comment 8 Matthias Clasen 2015-10-15 14:10:41 UTC
Review of attachment 313329 [details] [review]:

same patch as the first ?!
Comment 9 Matthias Clasen 2015-10-15 14:10:59 UTC
Review of attachment 313329 [details] [review]:

ah, my bad. This is view, not bar
Comment 10 Carlos Soriano 2015-10-15 17:18:18 UTC
thanks for the reviews. Agree would look better, will do next time.

Attachment 313326 [details] pushed as 0cd4e7e - gtkplacessidebar: improve heuristics for external drives
Attachment 313327 [details] pushed as 569be9f - gtkplacesview: remove dead code
Attachment 313328 [details] pushed as 569be9f - gtkplacesview: remove dead code
Attachment 313329 [details] pushed as 1dbcce7 - gtkplacesview: improve heuristics for external drives
Comment 11 Carlos Soriano 2015-11-04 12:14:43 UTC
*** Bug 757034 has been marked as a duplicate of this bug. ***
Comment 12 Carlos Soriano 2015-11-04 12:14:52 UTC
*** Bug 756782 has been marked as a duplicate of this bug. ***
Comment 13 Luis Henrique Mello 2015-11-16 09:21:09 UTC
Created attachment 315653 [details]
nautilus screencast

Is this really fixed? On Arch Linux, since gtk 3.18.4 and nautilus 3.18.2 things got worse (see duplicate bug #756782) - now even external drives that used to be properly shown on 'Other Locations' aren't anymore, even though mounted properly...
Comment 14 Carlos Soriano 2015-11-23 10:30:27 UTC
*** Bug 756542 has been marked as a duplicate of this bug. ***
Comment 15 Carlos Soriano 2015-11-23 10:31:20 UTC
(In reply to Luis Henrique Mello from comment #13)
> Created attachment 315653 [details]
> nautilus screencast
> 
> Is this really fixed? On Arch Linux, since gtk 3.18.4 and nautilus 3.18.2
> things got worse (see duplicate bug #756782) - now even external drives that
> used to be properly shown on 'Other Locations' aren't anymore, even though
> mounted properly...

you need gtk 3.18.5 (sorry I didn't bump gtk+ requirement)
Comment 16 Luis Henrique Mello 2015-11-23 17:36:53 UTC
(In reply to Carlos Soriano from comment #15)
> (In reply to Luis Henrique Mello from comment #13)
> > Created attachment 315653 [details]
> > nautilus screencast
> > 
> > Is this really fixed? On Arch Linux, since gtk 3.18.4 and nautilus 3.18.2
> > things got worse (see duplicate bug #756782) - now even external drives that
> > used to be properly shown on 'Other Locations' aren't anymore, even though
> > mounted properly...
> 
> you need gtk 3.18.5 (sorry I didn't bump gtk+ requirement)

thank you, it's ok now :)