Adds GIO_EXTRA_MODULES environment variable support, closing bug #523039.
authorA. Walton <awalton@svn.gnome.org>
Fri, 28 Mar 2008 14:31:09 +0000 (14:31 +0000)
committerAndrew Walton <awalton@src.gnome.org>
Fri, 28 Mar 2008 14:31:09 +0000 (14:31 +0000)
2008-03-28  A. Walton  <awalton@svn.gnome.org>

* 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
docs/reference/gio/overview.xml
gio/ChangeLog
gio/giomodule.c

index ea63d99..9ef8363 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-28  A. Walton  <awalton@svn.gnome.org>
+
+       * gio/overview.xml:
+       Document GIO_EXTRA_MODULES, fixes a small typo.
+
 2008-03-19  Matthias Clasen  <mclasen@redhat.com>
 
        * gio/overview.xml: Document GVS_DISABLE_FUSE.
index dcf5fb9..6f0b31c 100644 (file)
 
       <para>
         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".  
       </para>
     </formalpara>
 
+    <formalpara>
+      <title><envar>GIO_EXTRA_MODULES</envar></title>
+
+      <para>
+       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.
+      </para>
+    </formalpara>
+
   </chapter>
 
   <chapter id="gio-extension-points">
index 60bce61..c704454 100644 (file)
@@ -1,3 +1,9 @@
+2008-03-28  A. Walton  <awalton@svn.gnome.org>
+
+       * giomodule.c (_g_io_modules_ensure_loaded):
+       Adds GIO_EXTRA_MODULES environment variable support, closing bug 
+       #523039.
+
 2008-03-28  Alexander Larsson  <alexl@redhat.com>
 
         * gfile.c:
index 69210e4..63ff2fa 100644 (file)
@@ -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 ();