[PATCH 1/3] core: install plugins XML file in the same place as the plugin itself



From: "Juan A. Suarez Romero" <jasuarez igalia com>

Sticking together both library and xml file makes things easier to handle,
specially when loading plugins from a different place than standard.

So far, user and/or developer can load plugins from a different place. But this
only was affecting the library files: the xml information files were still
getting from the standard place. Adding new functions and variables to specify
where to look for the xml files adds a unneeded level of complexity.

So the simple approach is to put both files together, so the xml files can be
obtained from the same place where the library resides.

Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>
---
 configure.ac              |    8 --------
 src/Makefile.am           |    2 --
 src/grl-plugin-registry.c |    6 +++---
 3 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8f84fdd..5e23b3b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,21 +70,13 @@ if test $libdir = "\${exec_prefix}/lib" ; then
 	libdir="$prefix/lib"
 fi
 
-if test $datadir = "NONE" ; then
-	datadir="$prefix/share"
-fi
-
 # Plugins directory
 
 GRL_PLUGINS_DIR="${libdir}/${GRL_NAME}"
 AC_SUBST(GRL_PLUGINS_DIR)
 AC_DEFINE_UNQUOTED(GRL_PLUGINS_DIR, "$GRL_PLUGINS_DIR", [Plugins directory])
-
 # Plugins configuration directory
 
-GRL_PLUGINS_CONF_DIR="${datadir}/${GRL_NAME}/plugins"
-AC_SUBST(GRL_PLUGINS_CONF_DIR)
-
 # ----------------------------------------------------------
 # DEPENDENCIES
 # ----------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 81cf803..b96f64a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -5,8 +5,6 @@
 #
 # Copyright (C) 2010, 2011 Igalia S.L. All rights reserved.
 
-INCLUDES = -DGRL_PLUGINS_CONF_DIR=\""$(GRL_PLUGINS_CONF_DIR)"\"
-
 # autogenerated files
 grl-marshal.h: grl-marshal.list
 	$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix grl_marshal	\
diff --git a/src/grl-plugin-registry.c b/src/grl-plugin-registry.c
index e645b99..47ff561 100644
--- a/src/grl-plugin-registry.c
+++ b/src/grl-plugin-registry.c
@@ -302,10 +302,10 @@ grl_plugin_registry_load_plugin_infos (GrlPluginRegistry *registry)
   gchar *file;
   gchar *suffix;
 
-  dir = g_dir_open (GRL_PLUGINS_CONF_DIR, 0, &error);
+  dir = g_dir_open (GRL_PLUGINS_DIR, 0, &error);
   if (!dir) {
     GRL_WARNING ("Could not open plugins' info directory '%s': %s",
-                 GRL_PLUGINS_CONF_DIR,
+                 GRL_PLUGINS_DIR,
                  error->message);
     g_error_free (error);
     return;
@@ -313,7 +313,7 @@ grl_plugin_registry_load_plugin_infos (GrlPluginRegistry *registry)
 
   while ((entry = g_dir_read_name (dir)) != NULL) {
     if ((suffix = g_strrstr (entry, "." GRL_PLUGIN_INFO_SUFFIX)) != NULL) {
-      file = g_build_filename (GRL_PLUGINS_CONF_DIR, entry, NULL);
+      file = g_build_filename (GRL_PLUGINS_DIR, entry, NULL);
       info = get_info_from_plugin_xml (file);
       g_free (file);
       if (info) {
-- 
1.7.5.4



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