[gvfs] Fix shadowed mount showing up next to existing volume icon
- From: Bastien Nocera <hadess src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gvfs] Fix shadowed mount showing up next to existing volume icon
- Date: Sun, 15 Nov 2009 12:23:36 +0000 (UTC)
commit 5bf437d9e65d69e985af1c1dc8d9c84cac744c96
Author: Martin Szulecki <opensuse sukimashita com>
Date: Sun Nov 15 01:42:03 2009 +0100
Fix shadowed mount showing up next to existing volume icon
The activation_root for a volume was not set when queried and thus
causing two icons created for the same volume/mount.
Now it already sets the activiation_root in the volume constructor
like in the gphoto2 backend.
https://bugzilla.gnome.org/show_bug.cgi?id=597802
monitor/afc/afcvolume.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/monitor/afc/afcvolume.c b/monitor/afc/afcvolume.c
index 73f2e55..3af4661 100644
--- a/monitor/afc/afcvolume.c
+++ b/monitor/afc/afcvolume.c
@@ -137,11 +137,19 @@ g_vfs_afc_volume_new (GVolumeMonitor *monitor,
const char *uuid)
{
GVfsAfcVolume *self;
+ GFile *root;
+ char *uri;
self = G_VFS_AFC_VOLUME(g_object_new (G_VFS_TYPE_AFC_VOLUME, NULL));
self->monitor = monitor;
self->uuid = g_strdup (uuid);
+ uri = g_strdup_printf ("afc://%s", self->uuid);
+ root = g_file_new_for_uri (uri);
+ g_free (uri);
+
+ g_object_set_data_full (G_OBJECT(self), "root", root, g_object_unref);
+
/* Get mount information here */
if (!_g_vfs_afc_volume_update_metadata (self))
return NULL;
@@ -233,15 +241,12 @@ g_vfs_afc_volume_mount (GVolume *volume,
GVfsAfcVolume *afc_volume = G_VFS_AFC_VOLUME (volume);
ActivationMountOp *data;
GFile *root;
- char *uri;
g_print ("g_vfs_afc_volume_mount (can_mount=%d uuid=%s)\n",
g_vfs_afc_volume_can_mount (volume),
afc_volume->uuid);
- uri = g_strdup_printf ("afc://%s", afc_volume->uuid);
- root = g_file_new_for_uri (uri);
- g_free (uri);
+ root = g_object_get_data (G_OBJECT (volume), "root");
data = g_new0 (ActivationMountOp, 1);
data->enclosing_volume = afc_volume;
@@ -249,8 +254,6 @@ g_vfs_afc_volume_mount (GVolume *volume,
data->user_data = user_data;
data->root = root;
- g_object_set_data_full (G_OBJECT(volume), "root", g_object_ref (root), g_object_unref);
-
g_file_mount_enclosing_volume (root,
0,
mount_operation,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]