[gthumb] Replaced dir_make with gfile functions



commit 93286a17163312498a699c2b70ec71a5afe79260
Author: Michael J. Chudobiak <mjc avtechpulse com>
Date:   Tue Jun 16 14:21:46 2009 -0400

    Replaced dir_make with gfile functions

 libgthumb/file-utils.c              |   20 --------------------
 libgthumb/file-utils.h              |    1 -
 src/dlg-web-exporter.c              |   19 +++++++++----------
 src/gth-browser-actions-callbacks.c |    2 +-
 4 files changed, 10 insertions(+), 32 deletions(-)
---
diff --git a/libgthumb/file-utils.c b/libgthumb/file-utils.c
index e2597c3..c30b6cb 100644
--- a/libgthumb/file-utils.c
+++ b/libgthumb/file-utils.c
@@ -347,26 +347,6 @@ path_list_find_path (GList *list, const char *path)
 
 
 gboolean
-dir_make (const gchar *path)
-{
-        GFile    *gfile;
-        gboolean  result;
-	GError   *error = NULL;
-
-        gfile = gfile_new (path);
-        result = g_file_make_directory (gfile, NULL, &error);
-
-	if (error != NULL) {
-                gfile_warning ("Could not create directory", gfile, error);
-                g_error_free (error);
-	}
-
-        g_object_unref (gfile);
-        return result;
-}
-
-
-gboolean
 dir_remove_recursive (const char *path)
 {
 	GFile    *gfile;
diff --git a/libgthumb/file-utils.h b/libgthumb/file-utils.h
index 2d0af59..e683a41 100644
--- a/libgthumb/file-utils.h
+++ b/libgthumb/file-utils.h
@@ -88,7 +88,6 @@ GList *             path_list_find_path           (GList              *list,
 
 /* Directory utils */
 
-gboolean            dir_make                      (const char       *uri);
 gboolean            dir_remove_recursive          (const char       *path);
 
 gboolean            ensure_dir_exists             (const char       *path);
diff --git a/src/dlg-web-exporter.c b/src/dlg-web-exporter.c
index dac0285..ab16d0d 100644
--- a/src/dlg-web-exporter.c
+++ b/src/dlg-web-exporter.c
@@ -732,16 +732,15 @@ theme_dialog__row_activated_cb (GtkTreeView       *tree_view,
 static void
 ensure_local_theme_dir_exists (void)
 {
-	char *theme_dir;
-
-	theme_dir = build_uri (get_home_uri (),
-			       ".gnome2",
-			       "gthumb/albumthemes",
-			       NULL);
-
-	dir_make (theme_dir);
-
-	g_free (theme_dir);
+	GFile *home = gfile_get_home_dir ();
+        GFile *theme_dir = gfile_append_path (home,
+					      ".gnome2",
+					      "gthumb",
+					      "albumthemes",
+					       NULL);
+	g_file_make_directory (theme_dir, NULL, NULL);
+	g_object_unref (home);
+	g_object_unref (theme_dir);
 }
 
 
diff --git a/src/gth-browser-actions-callbacks.c b/src/gth-browser-actions-callbacks.c
index 236ba5f..c63f45c 100644
--- a/src/gth-browser-actions-callbacks.c
+++ b/src/gth-browser-actions-callbacks.c
@@ -749,7 +749,7 @@ create_new_folder_or_library (GthBrowser *browser,
 		_gtk_error_dialog_run (GTK_WINDOW (browser),
 				       _("The name \"%s\" is already used. " "Please use a different name."), fd->utf8_name);
 	} 
-	else if (! dir_make (fd->utf8_path)) {
+	else if (! g_file_make_directory (fd->gfile, NULL, NULL)) {
 		_gtk_error_dialog_run (GTK_WINDOW (browser),
 				       str_error,
 				       fd->utf8_name);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]