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 543711 - Migrate Disk Mounter from GnomeVFS to GIO
Migrate Disk Mounter from GnomeVFS to GIO
Product: gnome-applets
Classification: Other
Component: Disk Mounter (drivemount)
Other Linux
: Normal normal
: ---
Assigned To: gnome-applets Maintainers
gnome-applets Maintainers
Depends on:
Reported: 2008-07-19 10:30 UTC by André Klapper
Modified: 2008-10-05 08:52 UTC
See Also:
GNOME target: ---
GNOME version: ---

conversion patch (37.00 KB, patch)
2008-08-29 18:26 UTC, Pierre Ossman
reviewed Details | Review
conversion patch with DVD/CDA (37.17 KB, patch)
2008-09-02 18:07 UTC, Pierre Ossman
committed Details | Review

Description André Klapper 2008-07-19 10:30:24 UTC
See for more information.

$:andre\> cd gnome-applets/
$:andre\> grep -r vfs .
./drivemount/drive-button.c:	gnome_vfs_drive_unref (self->drive);
./drivemount/drive-button.c:	gnome_vfs_volume_unref (self->volume);
./drivemount/drive-button.c:	self->drive = gnome_vfs_drive_ref (drive);
./drivemount/drive-button.c:	gnome_vfs_drive_unref (self->drive);
./drivemount/drive-button.c:	gnome_vfs_volume_unref (self->volume);
./drivemount/drive-button.c:	self->volume = gnome_vfs_volume_ref (volume);
./drivemount/drive-button.c:	display_name = gnome_vfs_drive_get_display_name (self->drive);
./drivemount/drive-button.c:	if (gnome_vfs_drive_is_mounted (self->drive))
./drivemount/drive-button.c:	else if (gnome_vfs_drive_is_connected (self->drive))
./drivemount/drive-button.c:	display_name = gnome_vfs_volume_get_display_name (self->volume);
./drivemount/drive-button.c:	if (gnome_vfs_volume_is_mounted (self->volume))
./drivemount/drive-button.c:	if (gnome_vfs_drive_is_mounted (self->drive)) {
./drivemount/drive-button.c:	    volumes = gnome_vfs_drive_get_mounted_volumes (self->drive);
./drivemount/drive-button.c:	    icon_name = gnome_vfs_volume_get_icon (volume);
./drivemount/drive-button.c:	    g_list_foreach (volumes, (GFunc)gnome_vfs_volume_unref, NULL);
./drivemount/drive-button.c:	    icon_name = gnome_vfs_drive_get_icon (self->drive);
./drivemount/drive-button.c:	icon_name = gnome_vfs_volume_get_icon (self->volume);
./drivemount/drive-button.c:	    return gnome_vfs_drive_compare (button->drive, other_button->drive);
./drivemount/drive-button.c:	    return gnome_vfs_volume_compare (button->volume, other_button->volume);
./drivemount/drive-button.c:	argv[1] = gnome_vfs_drive_get_activation_uri (self->drive);
./drivemount/drive-button.c:	    volumes = gnome_vfs_drive_get_mounted_volumes (self->drive);
./drivemount/drive-button.c:		argv[1] = gnome_vfs_volume_get_activation_uri (volume);
./drivemount/drive-button.c:		g_list_foreach (volumes, (GFunc)gnome_vfs_volume_unref, NULL);
./drivemount/drive-button.c:	argv[1] = gnome_vfs_volume_get_activation_uri (self->volume);
./drivemount/drive-button.c:	char *device_path = gnome_vfs_volume_get_device_path (volume);
./drivemount/drive-button.c:	char *uri = gnome_vfs_volume_get_activation_uri (volume);
./drivemount/drive-button.c:	char *mount_path = gnome_vfs_get_local_path_from_uri (uri);
./drivemount/drive-button.c:	char *udi = gnome_vfs_volume_get_hal_udi (volume);
./drivemount/drive-button.c:	char *activation_uri = gnome_vfs_volume_get_activation_uri (volume);
./drivemount/drive-button.c:	char *device_path = gnome_vfs_drive_get_device_path (self->drive);
./drivemount/drive-button.c:	volumes = gnome_vfs_drive_get_mounted_volumes (self->drive);
./drivemount/drive-button.c:	uri = gnome_vfs_volume_get_activation_uri (volume);
./drivemount/drive-button.c:	mount_path = gnome_vfs_get_local_path_from_uri (uri);
./drivemount/drive-button.c:	gnome_vfs_drive_get_display_name (self->drive);
./drivemount/drive-button.c:	g_list_foreach (volumes, (GFunc)gnome_vfs_volume_unref, NULL);
./drivemount/drive-button.c:	gnome_vfs_drive_mount (self->drive, mount_result,
./drivemount/drive-button.c:	gnome_vfs_drive_unmount (self->drive, mount_result,
./drivemount/drive-button.c:	gnome_vfs_volume_unmount (self->volume, mount_result,
./drivemount/drive-button.c:	gnome_vfs_drive_eject (self->drive, mount_result,
./drivemount/drive-button.c:	gnome_vfs_volume_eject (self->volume, mount_result,
./drivemount/drive-button.c:	if (!gnome_vfs_drive_is_connected (self->drive)) return;
./drivemount/drive-button.c:	device_type = gnome_vfs_drive_get_device_type (self->drive);
./drivemount/drive-button.c:	display_name = gnome_vfs_drive_get_display_name (self->drive);
./drivemount/drive-button.c:	ejectable = gnome_vfs_drive_needs_eject (self->drive);
./drivemount/drive-button.c:	if (gnome_vfs_drive_is_mounted (self->drive)) {
./drivemount/drive-button.c:	volumes = gnome_vfs_drive_get_mounted_volumes (self->drive);
./drivemount/drive-button.c:		device_type = gnome_vfs_volume_get_device_type (volume);
./drivemount/drive-button.c:	g_list_foreach (volumes, (GFunc)gnome_vfs_volume_unref, NULL);
./drivemount/drive-button.c:	GnomeVFSDrive* drive = gnome_vfs_volume_get_drive (self->volume);
./drivemount/drive-button.c:	if (!gnome_vfs_volume_is_mounted (self->volume)) return;
./drivemount/drive-button.c:	device_type = gnome_vfs_volume_get_device_type (self->volume);
./drivemount/drive-button.c:	display_name = gnome_vfs_volume_get_display_name (self->volume);
./drivemount/drive-button.c:	    ejectable = gnome_vfs_drive_needs_eject (drive);
./drivemount/drive-list.c:	volume_monitor = gnome_vfs_get_volume_monitor ();
./drivemount/drive-list.c:    connected_drives = gnome_vfs_volume_monitor_get_connected_drives (volume_monitor);
./drivemount/drive-list.c:	gnome_vfs_drive_unref (drive);
./drivemount/drive-list.c:    mounted_volumes = gnome_vfs_volume_monitor_get_mounted_volumes (volume_monitor);
./drivemount/drive-list.c:	gnome_vfs_volume_unref (volume);
./drivemount/drive-list.c:    drive = gnome_vfs_volume_get_drive (volume);
./drivemount/drive-list.c:	gnome_vfs_drive_unref (drive);
./drivemount/drive-list.c:    drive = gnome_vfs_volume_get_drive (volume);
./drivemount/drive-list.c:	gnome_vfs_drive_unref (drive);
./drivemount/drive-list.c:    if (!gnome_vfs_drive_is_user_visible (drive))
./drivemount/drive-list.c:    if (!gnome_vfs_volume_is_user_visible (volume))
./drivemount/drive-list.c:    if (gnome_vfs_volume_get_volume_type (volume)
./drivemount/drive-list.c:    drive = gnome_vfs_volume_get_drive (volume);
./drivemount/drive-list.c:	gnome_vfs_drive_unref (drive);
./drivemount/drivemount.c:#include <libgnomevfs/gnome-vfs.h>
./drivemount/drive-button.h:#include <libgnomevfs/gnome-vfs.h>
./drivemount/drive-list.h:#include <libgnomevfs/gnome-vfs.h>
Comment 1 Pierre Ossman 2008-08-28 19:56:53 UTC
I have started working on this. Patch later today or tomorrow.
Comment 2 Callum McKenzie 2008-08-28 20:52:12 UTC
Great, looking forward to it.
Comment 3 Pierre Ossman 2008-08-28 21:25:24 UTC
How fond are people of the "Play DVD" and "Play Audio CD" menu entries? They're a bit of a pain to convert (and has some nasty copypasta from g-v-m). I'd like to take them out back...
Comment 4 Pierre Ossman 2008-08-29 18:26:20 UTC
Created attachment 117596 [details] [review]
conversion patch

This converts the drivemount applet to use GIO. As part of this, some things were changed:

- It no longer has any special handling for DVDs and audio CDs.
- It does not report any errors for mount/unmount requests. gnome-mount does this by itself and GIO said something about not presenting its error messages in a gui, afterwhich it proceeded to insult my mother.
- It uses standard icon names for the menu images

I've noticed two side effects from the conversion:

- Drives retain their name even when unmounted. The old code got different names because gnome-vfs' "drive" maps better to GDrive than GVolume when it comes to naming. Personally, I think the new behaviour is more sane.

- Drives are not sorted by type. The old code organised the icons based on type (actually gnome-vfs did), but there is no type information in GIO so it is now a strictly name based ordering.
Comment 5 Pierre Ossman 2008-08-29 18:28:04 UTC
Someone with an account on is welcome to update the status on the GioPort page. :)
Comment 6 André Klapper 2008-08-29 18:47:43 UTC
Comment 7 Callum McKenzie 2008-09-01 11:30:45 UTC
I'm generally happy with the patch, but I'm not happy about the regression with respect to CD and DVD playback.

What exactly is the problem with the DVD/CD stuff (aside from the usual problems all copy.pasted code has)? The DVD stuff is simple to fix since two of the arguments aren't used and the third comes from g_mount_get_root (). The CD stuff doesn't look like it will translate directly. What are the other issues?
Comment 8 Pierre Ossman 2008-09-01 12:31:10 UTC
The problem was that it was far from obvious what to do in all cases, at least with my very shallow knowledge of GIO and gnome-vfs. E.g. it could trigger the "play dvd" command on a volume, where it isn't guaranteed that you have a mount object and hence no known mount point.

I can have another stab at it if you like, but someone else needs to test it as I have neither CDs nor DVDs (hey, this is the 21st century!).
Comment 9 Pierre Ossman 2008-09-01 12:33:01 UTC
Btw, I don't think you meant to mark the entire bug as obsolete ;)
Comment 10 André Klapper 2008-09-01 12:36:45 UTC
Yeah, I beg to differ with closing this ticket. :-)
Comment 11 Callum McKenzie 2008-09-01 20:49:43 UTC
Pierre, I can test the code and fix it, so thats not a problem.

As for marking the bug obsolete, my apologies, that wasn't deliberate.
Comment 12 Pierre Ossman 2008-09-02 18:07:45 UTC
Created attachment 117861 [details] [review]
conversion patch with DVD/CDA

Here's a patch with the DVD and CDA stuff restored. I do think having them in is a bad idea though as g-v-m and this code will constantly get out of sync. Right now they support different launch commands for example.
Comment 13 Callum McKenzie 2008-09-02 20:25:35 UTC
I'm not sure about the long-term viability of the CD/DVD stuff either, but I don't want to remove anything at this point of the release cycle. Thanks for the effort, I've been delaying the 2.23.91 release in the hope this would come through. I'll try and get this committed later today.
Comment 14 Callum McKenzie 2008-09-05 00:20:59 UTC
Finally committed. The build requirements for gtk+ and glib have also been updated.
Comment 15 Sebastien Bacher 2008-09-11 22:45:49 UTC
the new version seems to crash when ejecting a cd or dvd
Comment 16 Callum McKenzie 2008-09-12 00:36:50 UTC
Yes, see bug 551669. It's being worked on.
Comment 17 gbil 2008-10-04 19:44:46 UTC
After changing to GIO drivemount no longer displays entries in fstab for cifs mount system as before. 

Since nautilus doesn't do that either since version 2.22 because of GIO, in order to overcome this limitation I have used until now the drivemount applet. Now this is gone too. 

Any suggestion?
Comment 18 Callum McKenzie 2008-10-04 20:38:06 UTC
Filesystems like CIFS are handled by gio using gvfs. gvfs handles cifs (and many others) via a plugin. You may not have the required plugins installed. If you installed from source the backend should have been installed, if you are using a distribution you may need to look for a separate package on top of gvfs (for Ubuntu the extra package is gvfs-backends).
Comment 19 gbil 2008-10-05 06:21:26 UTC
Thanks for the answer but this doesn't seem to be the case.

In fedora 10 this package is gvfs-smb-1.0.1-4.fc10.i386 and is installed but again diskmounter doesn't show the cifs entries in fstab. I've tested with an Ubuntu virtual machine with gvfs-backends installed and its the same, cifs entries in fstab don't show up in diskmounter with gio backend. 
Comment 20 Callum McKenzie 2008-10-05 08:06:00 UTC
gbil, could you please open a new bug for this problem. Put a reference to this bug (specifically  mentioning comment 17) and include a copy of your fstab file (or at least the relevant lines). Thanks.