From 716fdb209552960679c93cc110e804484f0de943 Mon Sep 17 00:00:00 2001 From: Tomas Frydrych Date: Thu, 8 Feb 2007 11:48:46 +0000 Subject: update volumes patch to work with utf8 filesystem git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1264 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- .../gtk+/gtk+-2.6.8/filesystem-volumes.patch | 54 ++++++++++++++++------ meta/packages/gtk+/gtk+_2.6.8.bb | 2 +- 2 files changed, 41 insertions(+), 15 deletions(-) (limited to 'meta/packages/gtk+') diff --git a/meta/packages/gtk+/gtk+-2.6.8/filesystem-volumes.patch b/meta/packages/gtk+/gtk+-2.6.8/filesystem-volumes.patch index f0d25390b5..4386d83ee9 100644 --- a/meta/packages/gtk+/gtk+-2.6.8/filesystem-volumes.patch +++ b/meta/packages/gtk+/gtk+-2.6.8/filesystem-volumes.patch @@ -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 #include @@ -59,7 +59,27 @@ } 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) { @@ -68,14 +88,15 @@ } 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); @@ -87,10 +108,12 @@ + + /* 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); @@ -99,12 +122,13 @@ } 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); @@ -122,11 +146,13 @@ + { + /* 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++; @@ -143,7 +169,7 @@ + id = "gnome-dev-removable"; + } + } - ++ + if (id) + { + pixbuf = get_cached_icon (widget, id, pixel_size); diff --git a/meta/packages/gtk+/gtk+_2.6.8.bb b/meta/packages/gtk+/gtk+_2.6.8.bb index 7b407c0f3c..50990f14b9 100644 --- a/meta/packages/gtk+/gtk+_2.6.8.bb +++ b/meta/packages/gtk+/gtk+_2.6.8.bb @@ -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 \ -- cgit v1.2.3-54-g00ecf