[gedit/libgpe] Update to latest way of libgpe to specify search directories.
- From: Steve Frécinaux <sfre src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gedit/libgpe] Update to latest way of libgpe to specify search directories.
- Date: Sun, 15 Nov 2009 18:59:50 +0000 (UTC)
commit 5652d5ac713b0a4cb105e7c8e51ddcdda806c3f7
Author: Steve Frécinaux <code istique net>
Date: Sun Nov 15 19:57:51 2009 +0100
Update to latest way of libgpe to specify search directories.
gedit/gedit-plugins-engine.c | 32 ++++++++++++++++++--------------
1 files changed, 18 insertions(+), 14 deletions(-)
---
diff --git a/gedit/gedit-plugins-engine.c b/gedit/gedit-plugins-engine.c
index 7f6012d..7e2f246 100644
--- a/gedit/gedit-plugins-engine.c
+++ b/gedit/gedit-plugins-engine.c
@@ -159,31 +159,35 @@ gedit_plugins_engine_class_init (GeditPluginsEngineClass *klass)
GPEEngine *
gedit_plugins_engine_get_default (void)
{
- gchar *module_dir;
- gchar *data_dir;
+ gchar *modules_dir;
+ gchar *search_paths;
if (default_engine != NULL)
return default_engine;
- module_dir = gedit_dirs_get_binding_modules_dir ();
+ modules_dir = gedit_dirs_get_binding_modules_dir ();
+
+ search_paths = g_new (gchar *, 5);
+
+ /* Add the user plugins dir in ~ */
+ search_paths[0] = gedit_dirs_get_user_plugins_dir ();
+ search_paths[1] = gedit_dirs_get_user_plugins_dir ();
+
+ /* Add the system plugins dir */
+ search_paths[2] = gedit_dirs_get_gedit_plugins_dir ();
+ search_paths[3] = gedit_dirs_get_gedit_plugins_data_dir ();
+
+ /* Ending NULL */
+ search_paths[4] = NULL;
default_engine = GPE_ENGINE (g_object_new (GEDIT_TYPE_PLUGINS_ENGINE,
"app-name", "Gedit",
"base-module-dir", module_dir,
+ "search-paths", search_paths,
NULL));
- g_free (module_dir);
- /* Add the user plugins dir in ~ */
- module_dir = gedit_dirs_get_user_plugins_dir ();
- gpe_engine_add_plugin_directory (default_engine, module_dir, module_dir);
- g_free (module_dir);
-
- /* Add the system plugins dir */
- module_dir = gedit_dirs_get_gedit_plugins_dir ();
- data_dir = gedit_dirs_get_gedit_plugins_data_dir ();
- gpe_engine_add_plugin_directory (default_engine, module_dir, data_dir);
+ g_strfreev (search_paths);
g_free (module_dir);
- g_free (data_dir);
/* Load the plugin list from gconf */
gedit_plugins_engine_active_plugins_changed (GEDIT_PLUGINS_ENGINE (default_engine));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]