diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2009-11-16 19:43:53 +0000 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2009-11-20 18:42:47 +0000 |
commit | da6412b49f7b4cb24273c4aafc8667e22f0e9064 (patch) | |
tree | e9a65a12f3a2707aa04b06dbf4dcae646ef73e94 | |
parent | cc4df7c513da6de25f8c7de5fb4e7a13e055a97c (diff) |
Load plugins from $GABBLE_PLUGIN_DIR if set
-rw-r--r-- | docs/telepathy-gabble.8.in | 4 | ||||
-rw-r--r-- | src/plugin-loader.c | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/docs/telepathy-gabble.8.in b/docs/telepathy-gabble.8.in index e0e073292..4dd9cc6d1 100644 --- a/docs/telepathy-gabble.8.in +++ b/docs/telepathy-gabble.8.in @@ -35,6 +35,10 @@ May be set to "all" for full debug output from the Wocky XMPP library used by Gabble, or various undocumented options (which may change from release to release) to filter the output. For general Gabble debugging, "net" is recommended. +.TP +\fBGABBLE_PLUGIN_DIR\fR=\fIdirectory\fR +If set, and Gabble was compiled with plugin support, plugins will be loaded +from \fIdirectory\fR rather than from the default directory. .SH SEE ALSO .IR http://telepathy.freedesktop.org/ , .IR http://telepathy.freedesktop.org/wiki/CategoryGabble , diff --git a/src/plugin-loader.c b/src/plugin-loader.c index 243f9d9fd..1c29401de 100644 --- a/src/plugin-loader.c +++ b/src/plugin-loader.c @@ -103,6 +103,7 @@ static void gabble_plugin_loader_probe (GabblePluginLoader *self) { GError *error = NULL; + const gchar *directory_name = g_getenv ("GABBLE_PLUGIN_DIR"); GDir *d; const gchar *file; @@ -112,7 +113,11 @@ gabble_plugin_loader_probe (GabblePluginLoader *self) return; } - d = g_dir_open (PLUGIN_DIR, 0, &error); + if (directory_name == NULL) + directory_name = PLUGIN_DIR; + + DEBUG ("probing %s", directory_name); + d = g_dir_open (directory_name, 0, &error); if (d == NULL) { @@ -128,7 +133,7 @@ gabble_plugin_loader_probe (GabblePluginLoader *self) if (!g_str_has_suffix (file, G_MODULE_SUFFIX)) continue; - path = g_build_filename (PLUGIN_DIR, file, NULL); + path = g_build_filename (directory_name, file, NULL); plugin_loader_try_to_load (self, path); g_free (path); } |