From 096201834d4511604775c22c10831d8fd00a7e98 Mon Sep 17 00:00:00 2001 From: "A. Walton" Date: Fri, 28 Mar 2008 14:31:09 +0000 Subject: [PATCH] Adds GIO_EXTRA_MODULES environment variable support, closing bug #523039. 2008-03-28 A. Walton * giomodule.c (_g_io_modules_ensure_loaded): Adds GIO_EXTRA_MODULES environment variable support, closing bug #523039. svn path=/trunk/; revision=6768 --- docs/reference/ChangeLog | 5 +++++ docs/reference/gio/overview.xml | 12 +++++++++++- gio/ChangeLog | 6 ++++++ gio/giomodule.c | 18 ++++++++++++++++++ 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index ea63d99..9ef8363 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,8 @@ +2008-03-28 A. Walton + + * gio/overview.xml: + Document GIO_EXTRA_MODULES, fixes a small typo. + 2008-03-19 Matthias Clasen * gio/overview.xml: Document GVS_DISABLE_FUSE. diff --git a/docs/reference/gio/overview.xml b/docs/reference/gio/overview.xml index dcf5fb9..6f0b31c 100644 --- a/docs/reference/gio/overview.xml +++ b/docs/reference/gio/overview.xml @@ -185,7 +185,7 @@ This variable can be set to the name of a #GDesktopAppInfoLookup - implementation to override the dfeault for debugging purposes. + implementation to override the default for debugging purposes. GIO does not include a #GDesktopAppInfoLookup implementation, the GConf-based implementation in the gvfs module has the name "gconf". @@ -203,6 +203,16 @@ + + <envar>GIO_EXTRA_MODULES</envar> + + + When this environment variable is set to a path, or a set of + paths separated by a colon, GIO will attempt to load + modules from within the path. + + + diff --git a/gio/ChangeLog b/gio/ChangeLog index 60bce61..c704454 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,3 +1,9 @@ +2008-03-28 A. Walton + + * giomodule.c (_g_io_modules_ensure_loaded): + Adds GIO_EXTRA_MODULES environment variable support, closing bug + #523039. + 2008-03-28 Alexander Larsson * gfile.c: diff --git a/gio/giomodule.c b/gio/giomodule.c index 69210e4..63ff2fa 100644 --- a/gio/giomodule.c +++ b/gio/giomodule.c @@ -300,6 +300,7 @@ _g_io_modules_ensure_loaded (void) GList *modules, *l; static gboolean loaded_dirs = FALSE; GIOExtensionPoint *ep; + const char *module_path; G_LOCK (loaded_dirs); @@ -329,6 +330,23 @@ _g_io_modules_ensure_loaded (void) modules = g_io_modules_load_all_in_directory (GIO_MODULE_DIR); + module_path = g_getenv ("GIO_EXTRA_MODULES"); + + if (module_path) + { + int i = 0; + gchar **paths; + paths = g_strsplit (module_path, ":", 0); + + while (paths[i] != NULL) + { + modules = g_list_prepend (modules, g_io_modules_load_all_in_directory (paths[i])); + i++; + } + + g_strfreev (paths); + } + /* Initialize types from built-in "modules" */ #if defined(HAVE_SYS_INOTIFY_H) || defined(HAVE_LINUX_INOTIFY_H) _g_inotify_directory_monitor_get_type (); -- 2.7.4