[glib/wip/gcleanup] giomodule: Allow overriding source directory gio modules are loaded from



commit 4b5857cbd9be89d82b9e15cd58c97992d48063ff
Author: Stef Walter <stefw gnome org>
Date:   Fri Nov 8 14:26:33 2013 +0100

    giomodule: Allow overriding source directory gio modules are loaded from
    
    When testing (and valgrinding) we need to have a known set of modules
    loaded.

 gio/giomodule.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gio/giomodule.c b/gio/giomodule.c
index c22a910..78d8511 100644
--- a/gio/giomodule.c
+++ b/gio/giomodule.c
@@ -1017,6 +1017,7 @@ _g_io_modules_ensure_loaded (void)
   static gboolean loaded_dirs = FALSE;
   const char *module_path;
   GIOModuleScope *scope;
+  const gchar *module_dir;
 
   _g_io_modules_ensure_extension_points_registered ();
   
@@ -1045,7 +1046,11 @@ _g_io_modules_ensure_loaded (void)
        }
 
       /* Then load the compiled in path */
-      g_io_modules_scan_all_in_directory_with_scope (GIO_MODULE_DIR, scope);
+      module_dir = g_getenv ("GIO_MODULE_DIR");
+      if (module_dir == NULL)
+        module_dir = GIO_MODULE_DIR;
+
+      g_io_modules_scan_all_in_directory_with_scope (module_dir, scope);
 
       g_io_module_scope_free (scope);
 


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