[emerillon] Create the user's plugin dir if it doesn't exist



commit c6d2b5eac143c8e44af3f69fd0c217dfa87da1c2
Author: Simon Wenner <simon wenner ch>
Date:   Sun May 2 17:52:41 2010 +0200

    Create the user's plugin dir if it doesn't exist

 emerillon/main.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/emerillon/main.c b/emerillon/main.c
index 0972fef..738c8a5 100644
--- a/emerillon/main.c
+++ b/emerillon/main.c
@@ -72,6 +72,8 @@ main (int argc,
 {
   EthosManager *manager;
   GtkWidget *window;
+  GError *error = NULL;
+  GFile *plugin_dir;
   gchar *user_data;
   gchar *plugin_dirs[3] = {EMERILLON_PLUGINDIR,
                            NULL,
@@ -100,6 +102,19 @@ main (int argc,
   g_signal_connect (window, "delete-event", gtk_main_quit, NULL);
   gtk_widget_show (window);
 
+  /* Create the user plugin directory */
+  plugin_dir = g_file_new_for_path (plugin_dirs[1]);
+  if (!g_file_query_exists (plugin_dir, NULL))
+    {
+      g_file_make_directory_with_parents (plugin_dir, NULL, &error);
+      if (error)
+        {
+          g_warning ("%s", error->message);
+          g_error_free (error);
+        }
+    }
+  g_object_unref (plugin_dir);
+
   /* Setup the plugin infrastructure */
   manager = emerillon_manager_dup_default ();
   ethos_manager_set_app_name (manager, "Emerillon");



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