r11707 - in /desktop/unstable/gnome-vfs2/debian: changelog patches/23_improve_volume_labels.patch

joss at users.alioth.debian.org joss at users.alioth.debian.org
Wed Jun 27 20:56:52 UTC 2007


Author: joss
Date: Wed Jun 27 20:56:52 2007
New Revision: 11707

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=11707
Log:
* 23_improve_volume_labels.patch: we are rich: display both mount
  point and volume size. Also fix a leak with size_str.

Modified:
    desktop/unstable/gnome-vfs2/debian/changelog
    desktop/unstable/gnome-vfs2/debian/patches/23_improve_volume_labels.patch

Modified: desktop/unstable/gnome-vfs2/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-vfs2/debian/changelog?rev=11707&op=diff
==============================================================================
--- desktop/unstable/gnome-vfs2/debian/changelog (original)
+++ desktop/unstable/gnome-vfs2/debian/changelog Wed Jun 27 20:56:52 2007
@@ -1,4 +1,4 @@
-gnome-vfs2 (1:2.18.1-3) UNRELEASED; urgency=low
+gnome-vfs2 (1:2.18.1-3) unstable; urgency=low
 
   [ Josselin Mouette ]
   * libgnomevfs2-common.preinst, libgnomevfs2-extra.preinst: use
@@ -12,7 +12,11 @@
     /live/image that are being use by live-initramfs while booting and
     hence completely useless for end-users.
 
- -- Otavio Salvador <otavio at ossystems.com.br>  Tue, 26 Jun 2007 12:35:43 -0300
+  [ Josselin Mouette ]
+  * 23_improve_volume_labels.patch: we are rich: display both mount
+    point and volume size. Also fix a leak with size_str.
+
+ -- Josselin Mouette <joss at debian.org>  Wed, 27 Jun 2007 22:49:33 +0200
 
 gnome-vfs2 (1:2.18.1-2) unstable; urgency=low
 

Modified: desktop/unstable/gnome-vfs2/debian/patches/23_improve_volume_labels.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-vfs2/debian/patches/23_improve_volume_labels.patch?rev=11707&op=diff
==============================================================================
--- desktop/unstable/gnome-vfs2/debian/patches/23_improve_volume_labels.patch (original)
+++ desktop/unstable/gnome-vfs2/debian/patches/23_improve_volume_labels.patch Wed Jun 27 20:56:52 2007
@@ -1,58 +1,105 @@
-Index: gnome-vfs2-2.18.1/libgnomevfs/gnome-vfs-hal-mounts.c
+Index: gnome-vfs-2.18.1/libgnomevfs/gnome-vfs-hal-mounts.c
 ===================================================================
---- gnome-vfs2-2.18.1.orig/libgnomevfs/gnome-vfs-hal-mounts.c	2007-06-25 22:46:57.000000000 -0300
-+++ gnome-vfs2-2.18.1/libgnomevfs/gnome-vfs-hal-mounts.c	2007-06-25 22:47:30.000000000 -0300
+--- gnome-vfs-2.18.1.orig/libgnomevfs/gnome-vfs-hal-mounts.c	2007-06-27 21:57:27.566795749 +0200
++++ gnome-vfs-2.18.1/libgnomevfs/gnome-vfs-hal-mounts.c	2007-06-27 22:48:46.818272291 +0200
 @@ -328,6 +328,7 @@
  	LibHalDriveType drive_type;
  	char *name;
  	char *vm_name;
-+	char *mountpoint;
++	char *size_str = NULL;
  	gboolean may_prepend_external;
  
  
-@@ -350,6 +351,16 @@
+@@ -341,7 +342,7 @@
+ 	    !libhal_drive_uses_removable_media (hal_drive) && 
+ 	    hal_volume != NULL) {
+ 		const char *label;
+-		const char *size_str;
++		const char *mountpoint;
+ 
+ 		/* use label if available */
+ 		label = libhal_volume_get_label (hal_volume);
+@@ -350,9 +351,23 @@
  			goto out;
  		}
  
+-		/* Otherwise, just use volume size */
+-
+ 		size_str = gnome_vfs_format_file_size_for_display (libhal_volume_get_size (hal_volume));
++
 +		/* use mount point if available */
 +		mountpoint = libhal_volume_get_mount_point (hal_volume);
 +		if (mountpoint != NULL && strlen (mountpoint) > 0) {
 +			/* chop off /media prefix */
 +			if (!strncmp (mountpoint, "/media/", 7) && strlen (mountpoint) > 7)
 +				mountpoint += 7;
-+			name = g_strdup_printf ("%s", mountpoint);
++			if (size_str != NULL) {
++				name = g_strdup_printf ("%s (%s)", mountpoint, size_str);
++			} else {
++				name = g_strdup (mountpoint);
++			}
 +			goto out;
 +		}
 +
- 		/* Otherwise, just use volume size */
++		/* Otherwise, just use volume size */
+ 		if (size_str != NULL) {
+ 			name = g_strdup_printf (_("%s Volume"), size_str);
+ 		}
+@@ -463,6 +478,7 @@
+ 	}
  
- 		size_str = gnome_vfs_format_file_size_for_display (libhal_volume_get_size (hal_volume));
-@@ -486,6 +497,7 @@
+ out:
++	g_free (size_str);
+ 	/* lame fallback */
+ 	if (name == NULL)
+ 		name = g_strdup (_("Drive"));
+@@ -485,7 +501,8 @@
+ 	LibHalDriveType drive_type;
  	const char *volume_label;
  	char *name;
- 	char *size_str;
-+	char *mountpoint;
+-	char *size_str;
++	char *size_str = NULL;
++	const char *mountpoint;
  
  	name = NULL;
  
-@@ -573,8 +585,19 @@
+@@ -573,20 +590,36 @@
  		goto out;
  	}
  
 -	/* Fallback: size of media */
+-
+ 	size_str = gnome_vfs_format_file_size_for_display (libhal_volume_get_size (hal_volume));
++
 +	/* mount point, when it's not removable */
 +	if (!libhal_drive_uses_removable_media (hal_drive)) {
 +		mountpoint = libhal_volume_get_mount_point (hal_volume);
 +		if (mountpoint != NULL && strlen (mountpoint) > 0) {
-+		    /* chop off /media prefix */
-+		    if (!strncmp (mountpoint, "/media/", 7) && strlen (mountpoint) > 7)
-+		       mountpoint += 7;
-+		    name = g_strdup_printf ("%s", mountpoint);
++			/* chop off /media prefix */
++			if (!strncmp (mountpoint, "/media/", 7) && strlen (mountpoint) > 7)
++				mountpoint += 7;
++			if (size_str != NULL) {
++				name = g_strdup_printf ("%s (%s)", mountpoint, size_str);
++			} else {
++				name = g_strdup (mountpoint);
++			}
 +		    goto out;
 +		}
 +	}
- 
++
 +	/* Fallback: size of media */
- 	size_str = gnome_vfs_format_file_size_for_display (libhal_volume_get_size (hal_volume));
  	if (size_str != NULL) {
  		if (libhal_drive_uses_removable_media (hal_drive)) {
+ 			name = g_strdup_printf (_("%s Removable Volume"), size_str);
+ 		} else {
+ 			name = g_strdup_printf (_("%s Volume"), size_str);
+ 		}
+-		g_free (size_str);
+ 	}
+ 
+ 
+ out:
++	g_free (size_str);
+ 	/* lame fallback */
+ 	if (name == NULL)
+ 		name = g_strdup (_("Volume"));




More information about the pkg-gnome-commits mailing list