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 668295 - Need a way to classify GVolume instances
Need a way to classify GVolume instances
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-01-19 18:18 UTC by David Zeuthen (not reading bugmail)
Modified: 2012-03-01 19:12 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description David Zeuthen (not reading bugmail) 2012-01-19 18:18:11 UTC
If an application (such as Nautilus) wants to show a sidebar with devices group into different groups such as "Devices" and "Network", it's currently up to the application itself to do the classification (for example by looking at the URI scheme for the activation root, e.g. smb://).

This is sub-optimal especially since we now generate GVolume instances for fstab entries such as

 server.tld:/somewhere/remote  /home/davidz/Movies  nfs4  default,users,noauto  0 0

will show up in the "Devices" part of Nautilus, see

 http://people.freedesktop.org/~david/gvfs-nautilus-missing-classification.png

One way to fix this is to introduce G_VOLUME_IDENTIFIER_KIND_CLASS with the following known values

 device
 network

and have the relevant volume monitors and backends set this as needed. We can later add other classes (bluetooth? maybe that's just 'device'), if needed.
Comment 1 Bastien Nocera 2012-01-19 18:36:19 UTC
Bluetooth, and most other device types supported by gvfs would fall under those 2 categories I would think.
Comment 2 David Zeuthen (not reading bugmail) 2012-03-01 19:12:22 UTC
OK, fixed in GLib with this commit

 http://git.gnome.org/browse/glib/commit/?id=10fbfcf09010e423cfc79c54e8da50b62a0f4b8a

and this commit

 http://git.gnome.org/browse/gvfs/commit/?id=31f24aa3bdfa7f53e74d4e24fcb79a3b7ed0d0ce

makes the udisks2 volume monitor set it. Example:

$ gvfs-mount -li

[...]

Drive(1): CD/DVD Drive
  Type: GProxyDrive (GProxyVolumeMonitorUDisks2)
  ids:
   unix-device: '/dev/sr0'
  themed icons:  [drive-optical]  [drive]
  is_media_removable=1
  has_media=1
  is_media_check_automatic=1
  can_poll_for_media=0
  can_eject=1
  can_start=0
  can_stop=0
  start_stop_type=unknown
  sort_key=00coldplug/11removable/sr0
  Volume(0): LSI HBA Drivers
    Type: GProxyVolume (GProxyVolumeMonitorUDisks2)
    ids:
     class: 'device'
     unix-device: '/dev/sr0'
     label: 'LSI HBA Drivers'
    themed icons:  [media-optical-cd-rom]  [media-optical-cd]  [media-optical]  [media]
    can_mount=1
    can_eject=1
    should_automount=0
    sort_key=gvfs.time_detected_usec.1330628670248775

[...]

Volume(3): files
  Type: GProxyVolume (GProxyVolumeMonitorUDisks2)
  ids:
   class: 'network'
  themed icons:  [folder-remote]  [folder]
  can_mount=1
  can_eject=0
  should_automount=0
  sort_key=gvfs.time_detected_usec.1330628670249575