summaryrefslogtreecommitdiff
path: root/extra/gnome-vfs/hal-show-volume-names.patch
blob: 5b8420c2b8b4966da6669babb7b7c0a248b29fe8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Index: gnome-vfs-hal-mounts.c
===================================================================
RCS file: /cvs/gnome/gnome-vfs/libgnomevfs/gnome-vfs-hal-mounts.c,v
retrieving revision 1.33
diff -u -p -r1.33 gnome-vfs-hal-mounts.c
--- gnome-vfs/libgnomevfs/gnome-vfs-hal-mounts.c	7 Jul 2006 15:56:57 -0000	1.33
+++ gnome-vfs/libgnomevfs/gnome-vfs-hal-mounts.c	14 Jul 2006 18:48:51 -0000
@@ -877,6 +877,7 @@ _hal_add_volume (GnomeVFSVolumeMonitorDa
 	GnomeVFSDrive *drive;
 	GnomeVFSVolumeMonitor *volume_monitor;
 	char *name;
+  char *icon;
 	gboolean allowed_by_policy;
 	const char *backing_udi;
 
@@ -975,6 +976,8 @@ _hal_add_volume (GnomeVFSVolumeMonitorDa
 	 */
 	drive = _gnome_vfs_volume_monitor_find_drive_by_hal_udi (volume_monitor, libhal_volume_get_udi (hal_volume));
 	if (drive == NULL && allowed_by_policy) {
+    name = _hal_drive_policy_get_display_name (volume_monitor_daemon, hal_drive, hal_volume);
+    icon = _hal_drive_policy_get_icon (volume_monitor_daemon, hal_drive, hal_volume);
 		drive = g_object_new (GNOME_VFS_TYPE_DRIVE, NULL);
 		if (libhal_volume_disc_has_audio (hal_volume)) {
 			drive->priv->activation_uri = g_strdup_printf ("cdda://%s", 
@@ -989,16 +992,16 @@ _hal_add_volume (GnomeVFSVolumeMonitorDa
 			 * So just set it to the empty string
 			 */
 			drive->priv->activation_uri = g_strdup ("");
+      g_free (name);
+      name = _hal_volume_policy_get_display_name (volume_monitor_daemon, hal_drive, hal_volume);
+      g_free (icon);
+      icon = _hal_volume_policy_get_icon (volume_monitor_daemon, hal_drive, hal_volume);
 		}
 		drive->priv->is_connected = TRUE;
 		drive->priv->device_path = g_strdup (libhal_volume_get_device_file (hal_volume));
 		drive->priv->device_type = _hal_get_gnome_vfs_device_type (hal_drive);
 	
-		/* TODO: could add an icon of a drive with media in it since this codepath only
-		 * handles drives with media in them
-		 */
-		drive->priv->icon = _hal_drive_policy_get_icon (volume_monitor_daemon, hal_drive, NULL);
-		name = _hal_drive_policy_get_display_name (volume_monitor_daemon, hal_drive, hal_volume);
+    drive->priv->icon = icon;
 		drive->priv->display_name = _gnome_vfs_volume_monitor_uniquify_drive_name (volume_monitor, name);
 		g_free (name);
 		name = g_utf8_casefold (drive->priv->display_name, -1);