[vinagre] Added vinagre_utils_create_dir()



commit 2e5764c9c14b9b05707cf16c169009d4b9d5e578
Author: Jonh Wendell <jwendell gnome org>
Date:   Wed Jan 27 11:20:46 2010 -0300

    Added vinagre_utils_create_dir()

 vinagre/vinagre-bookmarks-migration.c |   23 +----------------------
 vinagre/vinagre-utils.c               |   21 +++++++++++++++++++++
 vinagre/vinagre-utils.h               |    2 ++
 3 files changed, 24 insertions(+), 22 deletions(-)
---
diff --git a/vinagre/vinagre-bookmarks-migration.c b/vinagre/vinagre-bookmarks-migration.c
index 3114c8e..7628eaa 100644
--- a/vinagre/vinagre-bookmarks-migration.c
+++ b/vinagre/vinagre-bookmarks-migration.c
@@ -203,27 +203,6 @@ create_list (GKeyFile *kf)
   return entries;
 }
 
-static gboolean
-create_dir (const gchar *filename, GError **error)
-{
-  GFile    *file, *parent;
-  gboolean result;
-  gchar    *path;
-
-  file   = g_file_new_for_path (filename);
-  parent = g_file_get_parent (file);
-  path   = g_file_get_path (parent);
-  result = TRUE;
-
-  if (!g_file_test (path, G_FILE_TEST_EXISTS))
-    result = g_file_make_directory_with_parents (parent, NULL, error);
-
-  g_object_unref (file);
-  g_object_unref (parent);
-  g_free (path);
-  return result;
-}
-
 void
 vinagre_bookmarks_migration_migrate (const gchar *filename)
 {
@@ -233,7 +212,7 @@ vinagre_bookmarks_migration_migrate (const gchar *filename)
   GSList   *entries;
 
   error  = NULL;
-  if (!create_dir (filename, &error))
+  if (!vinagre_utils_create_dir (filename, &error))
     {
       g_warning (_("Error while migrating bookmarks: %s"), error?error->message:_("Failed to create the directory"));
       if (error)
diff --git a/vinagre/vinagre-utils.c b/vinagre/vinagre-utils.c
index da4b9e3..03181f1 100644
--- a/vinagre/vinagre-utils.c
+++ b/vinagre/vinagre-utils.c
@@ -735,4 +735,25 @@ vinagre_utils_ask_credential (GtkWindow *parent,
   return result == -5;
 }
 
+gboolean
+vinagre_utils_create_dir (const gchar *filename, GError **error)
+{
+  GFile    *file, *parent;
+  gboolean result;
+  gchar    *path;
+
+  file   = g_file_new_for_path (filename);
+  parent = g_file_get_parent (file);
+  path   = g_file_get_path (parent);
+  result = TRUE;
+
+  if (!g_file_test (path, G_FILE_TEST_EXISTS))
+    result = g_file_make_directory_with_parents (parent, NULL, error);
+
+  g_object_unref (file);
+  g_object_unref (parent);
+  g_free (path);
+  return result;
+}
+
 /* vim: set ts=8: */
diff --git a/vinagre/vinagre-utils.h b/vinagre/vinagre-utils.h
index e651fd6..146dac2 100644
--- a/vinagre/vinagre-utils.h
+++ b/vinagre/vinagre-utils.h
@@ -81,5 +81,7 @@ gboolean	vinagre_utils_ask_credential		(GtkWindow *parent,
 							 gchar **password,
 							 gboolean *save_in_keyring);
 
+gboolean	vinagre_utils_create_dir		(const gchar *filename, GError **error);
+
 #endif  /* __VINAGRE_UTILS_H__  */
 /* vim: set ts=8: */



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