[gthumb] Create library folders with gfile functions.
- From: Michael J. Chudobiak <mjc src gnome org>
- To: svn-commits-list gnome org
- Subject: [gthumb] Create library folders with gfile functions.
- Date: Thu, 23 Apr 2009 10:25:16 -0400 (EDT)
commit 0baf566b49b825816b5a4c2bfcad6076f1f730ef
Author: Michael J. Chudobiak <mjc avtechpulse com>
Date: Thu Apr 23 10:24:25 2009 -0400
Create library folders with gfile functions.
Also, fix the basename display functions for gthumb's special
catalog:// uris.
---
libgthumb/file-utils.c | 16 ++++++++++------
src/dlg-catalog.c | 20 ++++++++------------
2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/libgthumb/file-utils.c b/libgthumb/file-utils.c
index e411789..19e2203 100644
--- a/libgthumb/file-utils.c
+++ b/libgthumb/file-utils.c
@@ -1039,6 +1039,10 @@ get_utf8_display_name_from_uri (const char *escaped_uri)
utf8_name = g_strdup ("/");
} else if (strcmp (escaped_uri,"..") == 0) {
utf8_name = g_strdup ("..");
+ } else if (uri_scheme_is_catalog (escaped_uri)) {
+ gfile = gfile_new (escaped_uri+10);
+ utf8_name = g_file_get_parse_name (gfile);
+ g_object_unref (gfile);
} else if (uri_has_scheme (escaped_uri) || escaped_uri[0]=='/') {
gfile = gfile_new (escaped_uri);
utf8_name = g_file_get_parse_name (gfile);
@@ -1058,7 +1062,7 @@ get_utf8_display_name_from_uri (const char *escaped_uri)
utf8_name = g_strdup_printf ("%s",result+1);
g_free (result);
}
-
+
return utf8_name;
}
@@ -1399,12 +1403,12 @@ same_uri (const char *uri1,
char *
basename_for_display (const char *uri)
{
- GFile *gfile;
- char *result;
+ char *result;
+ char *utf8_name;
- gfile = gfile_new (uri);
- result = gfile_get_display_name (gfile);
- g_object_unref (gfile);
+ utf8_name = get_utf8_display_name_from_uri (uri);
+ result = g_strdup (file_name_from_path (utf8_name));
+ g_free (utf8_name);
return result;
}
diff --git a/src/dlg-catalog.c b/src/dlg-catalog.c
index 10119cd..4ecb789 100644
--- a/src/dlg-catalog.c
+++ b/src/dlg-catalog.c
@@ -125,9 +125,9 @@ static void
new_dir_cb (GtkWidget *widget,
DialogData *data)
{
- char *utf8_name;
- char *name;
- char *path;
+ char *utf8_name;
+ char *path;
+ GFile *gfile;
utf8_name = _gtk_request_dialog_run (GTK_WINDOW (data->window),
GTK_DIALOG_MODAL,
@@ -136,22 +136,18 @@ new_dir_cb (GtkWidget *widget,
1024,
GTK_STOCK_CANCEL,
_("C_reate"));
-
if (utf8_name == NULL)
return;
- name = gnome_vfs_escape_string (utf8_name);
- if (name == NULL)
- return;
path = g_strconcat (data->current_dir,
"/",
- name,
+ utf8_name,
NULL);
-
- dir_make (path);
-
+ gfile = gfile_new (path);
g_free (path);
- g_free (name);
+ g_file_make_directory (gfile, NULL, NULL);
+ g_object_unref (gfile);
+ g_free (utf8_name);
/* update the catalog list. */
catalog_list_change_to (data->cat_list, data->current_dir);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]