diff options
author | Federico Mena Quintero <federico@ximian.com> | 2004-06-22 20:08:36 +0000 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2004-06-22 20:08:36 +0000 |
commit | a2e95582caeb907516af2d2b3386f30d34d7a2d7 (patch) | |
tree | 89b538a32a323843c5c91dc297d0c686234c6816 /gtk/gtkfilesystemunix.c | |
parent | 21c987399d3756cd0447e4a39131f3459f563a89 (diff) | |
download | gtk+-a2e95582caeb907516af2d2b3386f30d34d7a2d7.tar.gz |
Fixes the GTK+ part of #142308:
2004-06-22 Federico Mena Quintero <federico@ximian.com>
Fixes the GTK+ part of #142308:
* gtk/gtkfilesystemunix.c (gtk_file_system_unix_filename_to_path):
Use filename_to_path().
(gtk_file_system_unix_uri_to_path): Likewise.
(filename_to_path): Use remove_trailing_slash().
Diffstat (limited to 'gtk/gtkfilesystemunix.c')
-rw-r--r-- | gtk/gtkfilesystemunix.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/gtk/gtkfilesystemunix.c b/gtk/gtkfilesystemunix.c index 2357bafcfa..c61a079670 100644 --- a/gtk/gtkfilesystemunix.c +++ b/gtk/gtkfilesystemunix.c @@ -1018,18 +1018,25 @@ static GtkFilePath * gtk_file_system_unix_uri_to_path (GtkFileSystem *file_system, const gchar *uri) { + GtkFilePath *path; gchar *filename = g_filename_from_uri (uri, NULL, NULL); + if (filename) - return gtk_file_path_new_steal (filename); + { + path = filename_to_path (filename); + g_free (filename); + } else - return NULL; + path = NULL; + + return path; } static GtkFilePath * gtk_file_system_unix_filename_to_path (GtkFileSystem *file_system, const gchar *filename) { - return gtk_file_path_new_dup (filename); + return filename_to_path (filename); } static const char * @@ -1833,7 +1840,10 @@ fill_in_mime_type (GtkFileFolderUnix *folder_unix, GError **error) static GtkFilePath * filename_to_path (const char *filename) { - return gtk_file_path_new_dup (filename); + char *tmp; + + tmp = remove_trailing_slash (filename); + return gtk_file_path_new_steal (tmp); } static gboolean |