diff options
author | Crispin Flowerday <gnome@flowerday.cx> | 2005-09-25 00:11:01 +0800 |
---|---|---|
committer | Crispin Flowerday <crispin@src.gnome.org> | 2005-09-25 00:11:01 +0800 |
commit | 0ab89ca2f875ad31dde266da63cef24ecb272255 (patch) | |
tree | a87715ef25add2d9b8c8f576c4db732da5ff76d2 /lib/ephy-module.c | |
parent | 7885000ddf06462e26d1c29dd16d0a3ebbd60319 (diff) | |
download | gsoc2013-epiphany-0ab89ca2f875ad31dde266da63cef24ecb272255.tar.gz gsoc2013-epiphany-0ab89ca2f875ad31dde266da63cef24ecb272255.tar.zst gsoc2013-epiphany-0ab89ca2f875ad31dde266da63cef24ecb272255.zip |
If the library path isn't absolute, look in the main extension dir, and
2005-09-24 Crispin Flowerday <gnome@flowerday.cx>
* lib/Makefile.am:
* lib/ephy-module.c: (ephy_module_load):
If the library path isn't absolute, look in the main extension
dir, and then the users own extension directory
Diffstat (limited to 'lib/ephy-module.c')
-rw-r--r-- | lib/ephy-module.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/lib/ephy-module.c b/lib/ephy-module.c index 4c6731461..9572d2010 100644 --- a/lib/ephy-module.c +++ b/lib/ephy-module.c @@ -84,10 +84,34 @@ ephy_module_load (GTypeModule *gmodule) { EphyModule *module = EPHY_MODULE (gmodule); EphyModuleRegisterFunc register_func; + gboolean is_absolute; LOG ("Loading %s", module->path); - module->library = g_module_open (module->path, 0); + is_absolute = g_path_is_absolute (module->path); + + if (module->library == NULL && ! is_absolute) + { + char *path = g_build_filename (EXTENSIONS_DIR, module->path, NULL); + + module->library = g_module_open (path, 0); + + g_free (path); + } + + if (module->library == NULL && ! is_absolute) + { + char *path = g_build_filename (ephy_dot_dir(), "extensions", module->path, NULL); + + module->library = g_module_open (path, 0); + + g_free (path); + } + + if (module->library == NULL) + { + module->library = g_module_open (module->path, 0); + } if (module->library == NULL) { |