]> code.ossystems Code Review - openembedded-core.git/commitdiff
update volumes patch to work with utf8 filesystem
authorTomas Frydrych <tf@openedhand.com>
Thu, 8 Feb 2007 11:48:46 +0000 (11:48 +0000)
committerTomas Frydrych <tf@openedhand.com>
Thu, 8 Feb 2007 11:48:46 +0000 (11:48 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1264 311d38ba-8fff-0310-9ca6-ca027cbcb966

meta/packages/gtk+/gtk+-2.6.8/filesystem-volumes.patch
meta/packages/gtk+/gtk+_2.6.8.bb

index f0d25390b5e5b007e881b05e0dc008e134cbd550..4386d83ee9b59e57fd226dc95f13d3ab24bce6dd 100644 (file)
@@ -1,5 +1,5 @@
---- gtk+-2.6.8/gtk/gtkfilesystemunix.c.orig    2007-02-08 10:05:19.000000000 +0000
-+++ gtk+-2.6.8/gtk/gtkfilesystemunix.c 2007-02-08 10:05:19.000000000 +0000
+--- gtk+-2.6.8/gtk/gtkfilesystemunix.c.orig    2007-02-08 12:01:19.000000000 +0000
++++ gtk+-2.6.8/gtk/gtkfilesystemunix.c 2007-02-08 12:01:19.000000000 +0000
 @@ -33,6 +33,7 @@
  #include <errno.h>
  #include <string.h>
  }
  
  static GtkFileSystemVolume *
-@@ -590,7 +633,7 @@
+@@ -375,10 +418,15 @@
+   len = strlen (filename);
+-  if (len > 1 && filename[len - 1] == '/')
+-    return g_strndup (filename, len - 1);
+-  else
+-    return g_memdup (filename, len + 1);
++  if (len > 1)
++  {
++    gchar *c = g_utf8_prev_char (filename + len);
++
++    if (c && *c == '/')
++       return g_strndup (filename, len - 1);
++  }
++  
++  return g_memdup (filename, len + 1);
+ }
+ static GtkFileFolder *
+@@ -590,7 +638,7 @@
  gtk_file_system_unix_volume_get_base_path (GtkFileSystem        *file_system,
                                           GtkFileSystemVolume  *volume)
  {
  }
  
  static gboolean
-@@ -616,7 +659,29 @@
+@@ -616,7 +664,32 @@
  gtk_file_system_unix_volume_get_display_name (GtkFileSystem       *file_system,
                                              GtkFileSystemVolume *volume)
  {
 -  return g_strdup (_("Filesystem")); /* Same as Nautilus */
 +  gchar * slash;
 +  gchar * path;
-+
++  gchar * c;
++  
 +  g_return_val_if_fail (file_system && volume, NULL);
 +  
 +  path = gtk_file_system_path_to_filename (file_system, (GtkFilePath*) volume);
 +
 +  /* Now the media volumes */
 +  /* strip trailing / if any */
-+  if (path[strlen(path)-1] == '/')
-+    path[strlen(path)-1] = 0;
++  c = g_utf8_prev_char (path + strlen(path));
++  
++  if (*c == '/')
++    *c = 0;
 +
-+  slash = strrchr (path, '/');
++  slash = g_utf8_strrchr (path, -1, '/');
 +
 +  if (!slash)
 +      return g_strdup (path);
  }
  
  static IconType
-@@ -787,11 +852,51 @@
+@@ -787,11 +860,54 @@
                                         GError              **error)
  {
    GdkPixbuf *pixbuf;
 +  gchar * slash;
 +  gchar * path;
++  gchar * c;
 +  const gchar * id = NULL;
 +  
 +  g_return_val_if_fail (file_system && volume, NULL);
 +  {
 +    /* Now the media volumes */
 +    /* strip trailing / if any */
-+    if (path[strlen(path)-1] == '/')
-+      path[strlen(path)-1] = 0;
-+
-+    slash = strrchr (path, '/');
++    c = g_utf8_prev_char (path + strlen(path));
++  
++    if (*c == '/')
++      *c = 0;
 +
++    slash = g_utf8_strrchr (path, -1, '/');
 +    if (slash)
 +    {
 +      slash++;
 +        id = "gnome-dev-removable";
 +    }
 +  }
++
 +  if (id)
 +  {
 +    pixbuf = get_cached_icon (widget, id, pixel_size);
index 7b407c0f3cb2393c7e16debf282ab24d850adc2a..50990f14b9fb9440996927a1823382123b1d1858 100644 (file)
@@ -5,7 +5,7 @@ HOMEPAGE = "http://www.gtk.org"
 SECTION = "libs"
 PRIORITY = "optional"
 DEPENDS = "glib-2.0 pango atk jpeg libpng libxext libxcursor gtk-doc libgcrypt"
-PR = "r2"
+PR = "r3"
 
 SRC_URI = "ftp://ftp.gtk.org/pub/gtk/v2.6/gtk+-${PV}.tar.bz2 \
            file://no-demos.patch;patch=1 \