summaryrefslogtreecommitdiffstats
path: root/meta/packages/gtk+
diff options
context:
space:
mode:
authorTomas Frydrych <tf@openedhand.com>2007-02-08 11:48:46 +0000
committerTomas Frydrych <tf@openedhand.com>2007-02-08 11:48:46 +0000
commit716fdb209552960679c93cc110e804484f0de943 (patch)
tree344d681e77340d51a5a421fbbbc4aaef2acb564b /meta/packages/gtk+
parentc179a53fec6fd41d554570739d57f9bbaa55078c (diff)
downloadpoky-716fdb209552960679c93cc110e804484f0de943.tar.gz
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
Diffstat (limited to 'meta/packages/gtk+')
-rw-r--r--meta/packages/gtk+/gtk+-2.6.8/filesystem-volumes.patch54
-rw-r--r--meta/packages/gtk+/gtk+_2.6.8.bb2
2 files changed, 41 insertions, 15 deletions
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 @@
1--- gtk+-2.6.8/gtk/gtkfilesystemunix.c.orig 2007-02-08 10:05:19.000000000 +0000 1--- gtk+-2.6.8/gtk/gtkfilesystemunix.c.orig 2007-02-08 12:01:19.000000000 +0000
2+++ gtk+-2.6.8/gtk/gtkfilesystemunix.c 2007-02-08 10:05:19.000000000 +0000 2+++ gtk+-2.6.8/gtk/gtkfilesystemunix.c 2007-02-08 12:01:19.000000000 +0000
3@@ -33,6 +33,7 @@ 3@@ -33,6 +33,7 @@
4 #include <errno.h> 4 #include <errno.h>
5 #include <string.h> 5 #include <string.h>
@@ -59,7 +59,27 @@
59 } 59 }
60 60
61 static GtkFileSystemVolume * 61 static GtkFileSystemVolume *
62@@ -590,7 +633,7 @@ 62@@ -375,10 +418,15 @@
63
64 len = strlen (filename);
65
66- if (len > 1 && filename[len - 1] == '/')
67- return g_strndup (filename, len - 1);
68- else
69- return g_memdup (filename, len + 1);
70+ if (len > 1)
71+ {
72+ gchar *c = g_utf8_prev_char (filename + len);
73+
74+ if (c && *c == '/')
75+ return g_strndup (filename, len - 1);
76+ }
77+
78+ return g_memdup (filename, len + 1);
79 }
80
81 static GtkFileFolder *
82@@ -590,7 +638,7 @@
63 gtk_file_system_unix_volume_get_base_path (GtkFileSystem *file_system, 83 gtk_file_system_unix_volume_get_base_path (GtkFileSystem *file_system,
64 GtkFileSystemVolume *volume) 84 GtkFileSystemVolume *volume)
65 { 85 {
@@ -68,14 +88,15 @@
68 } 88 }
69 89
70 static gboolean 90 static gboolean
71@@ -616,7 +659,29 @@ 91@@ -616,7 +664,32 @@
72 gtk_file_system_unix_volume_get_display_name (GtkFileSystem *file_system, 92 gtk_file_system_unix_volume_get_display_name (GtkFileSystem *file_system,
73 GtkFileSystemVolume *volume) 93 GtkFileSystemVolume *volume)
74 { 94 {
75- return g_strdup (_("Filesystem")); /* Same as Nautilus */ 95- return g_strdup (_("Filesystem")); /* Same as Nautilus */
76+ gchar * slash; 96+ gchar * slash;
77+ gchar * path; 97+ gchar * path;
78+ 98+ gchar * c;
99+
79+ g_return_val_if_fail (file_system && volume, NULL); 100+ g_return_val_if_fail (file_system && volume, NULL);
80+ 101+
81+ path = gtk_file_system_path_to_filename (file_system, (GtkFilePath*) volume); 102+ path = gtk_file_system_path_to_filename (file_system, (GtkFilePath*) volume);
@@ -87,10 +108,12 @@
87+ 108+
88+ /* Now the media volumes */ 109+ /* Now the media volumes */
89+ /* strip trailing / if any */ 110+ /* strip trailing / if any */
90+ if (path[strlen(path)-1] == '/') 111+ c = g_utf8_prev_char (path + strlen(path));
91+ path[strlen(path)-1] = 0; 112+
113+ if (*c == '/')
114+ *c = 0;
92+ 115+
93+ slash = strrchr (path, '/'); 116+ slash = g_utf8_strrchr (path, -1, '/');
94+ 117+
95+ if (!slash) 118+ if (!slash)
96+ return g_strdup (path); 119+ return g_strdup (path);
@@ -99,12 +122,13 @@
99 } 122 }
100 123
101 static IconType 124 static IconType
102@@ -787,11 +852,51 @@ 125@@ -787,11 +860,54 @@
103 GError **error) 126 GError **error)
104 { 127 {
105 GdkPixbuf *pixbuf; 128 GdkPixbuf *pixbuf;
106+ gchar * slash; 129+ gchar * slash;
107+ gchar * path; 130+ gchar * path;
131+ gchar * c;
108+ const gchar * id = NULL; 132+ const gchar * id = NULL;
109+ 133+
110+ g_return_val_if_fail (file_system && volume, NULL); 134+ g_return_val_if_fail (file_system && volume, NULL);
@@ -122,11 +146,13 @@
122+ { 146+ {
123+ /* Now the media volumes */ 147+ /* Now the media volumes */
124+ /* strip trailing / if any */ 148+ /* strip trailing / if any */
125+ if (path[strlen(path)-1] == '/') 149+ c = g_utf8_prev_char (path + strlen(path));
126+ path[strlen(path)-1] = 0; 150+
127+ 151+ if (*c == '/')
128+ slash = strrchr (path, '/'); 152+ *c = 0;
129+ 153+
154+ slash = g_utf8_strrchr (path, -1, '/');
155
130+ if (slash) 156+ if (slash)
131+ { 157+ {
132+ slash++; 158+ slash++;
@@ -143,7 +169,7 @@
143+ id = "gnome-dev-removable"; 169+ id = "gnome-dev-removable";
144+ } 170+ }
145+ } 171+ }
146 172+
147+ if (id) 173+ if (id)
148+ { 174+ {
149+ pixbuf = get_cached_icon (widget, id, pixel_size); 175+ 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"
5SECTION = "libs" 5SECTION = "libs"
6PRIORITY = "optional" 6PRIORITY = "optional"
7DEPENDS = "glib-2.0 pango atk jpeg libpng libxext libxcursor gtk-doc libgcrypt" 7DEPENDS = "glib-2.0 pango atk jpeg libpng libxext libxcursor gtk-doc libgcrypt"
8PR = "r2" 8PR = "r3"
9 9
10SRC_URI = "ftp://ftp.gtk.org/pub/gtk/v2.6/gtk+-${PV}.tar.bz2 \ 10SRC_URI = "ftp://ftp.gtk.org/pub/gtk/v2.6/gtk+-${PV}.tar.bz2 \
11 file://no-demos.patch;patch=1 \ 11 file://no-demos.patch;patch=1 \