[grilo/0.1.x] core: Use G_SEARCHPATH_SEPARATOR_S to separate paths



commit 1e0c3aab01e56f901b1e37c88067ceb72caaa691
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Fri Sep 23 14:27:16 2011 +0000

    core: Use G_SEARCHPATH_SEPARATOR_S to separate paths
    
    Currently, it means in Unix ":" will be used as the separator for the list of
    paths to search for plugins, while in Windows it will be ";".
    
    Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>

 src/grilo.c |   23 +++++++----------------
 1 files changed, 7 insertions(+), 16 deletions(-)
---
diff --git a/src/grilo.c b/src/grilo.c
index cbfb653..f587ae4 100644
--- a/src/grilo.c
+++ b/src/grilo.c
@@ -40,20 +40,14 @@
 #include "grl-log-priv.h"
 #include "config.h"
 
-#define GRL_PLUGIN_PATH_DEFAULT GRL_PLUGINS_DIR
-
 static gboolean grl_initialized = FALSE;
 static const gchar *plugin_path = NULL;
 static const gchar *plugin_list = NULL;
 
-#ifdef G_OS_WIN32
-
-/* We can't use ':' to split a list of paths on windows (C:\...) */
-#define PATH_SPLIT_CHARS ","
-
 static const gchar *
 get_default_plugin_dir (void)
 {
+#ifdef G_OS_WIN32
   static gchar *plugin_dir = NULL;
   gchar *run_directory;
 
@@ -66,17 +60,10 @@ get_default_plugin_dir (void)
                                  NULL);
   g_free (run_directory);
   return plugin_dir;
-}
 #else
-
-#define PATH_SPLIT_CHARS ":"
-
-static const gchar *
-get_default_plugin_dir (void)
-{
   return GRL_PLUGINS_DIR;
-}
 #endif
+}
 
 /**
  * grl_init:
@@ -142,7 +129,7 @@ grl_init (gint *argc,
     plugin_path = get_default_plugin_dir ();
   }
 
-  split_list = g_strsplit (plugin_path, PATH_SPLIT_CHARS, 0);
+  split_list = g_strsplit (plugin_path, G_SEARCHPATH_SEPARATOR_S, 0);
   for (split_element = split_list; *split_element; split_element++) {
     grl_plugin_registry_add_directory (registry, *split_element);
   }
@@ -182,7 +169,11 @@ grl_init_get_option_group (void)
   GOptionGroup *group;
   static const GOptionEntry grl_args[] = {
     { "grl-plugin-path", 0, 0, G_OPTION_ARG_STRING, &plugin_path,
+#ifdef G_OS_WIN32
+      "Semicolon-separated paths containing Grilo plugins", NULL },
+#else
       "Colon-separated paths containing Grilo plugins", NULL },
+#endif
     { "grl-plugin-use", 0, 0, G_OPTION_ARG_STRING, &plugin_list,
       "Colon-separated list of Grilo plugins to use", NULL },
     { NULL }



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