[grilo/0.1.x] core: install plugins XML file in the same place as the plugin itself



commit 12035c947ccef87fdb9b6b9c7ff79e6f81ab5d4c
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Fri Jul 22 08:33:29 2011 +0000

    core: install plugins XML file in the same place as the plugin itself
    
    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              |    9 ---------
 src/Makefile.am           |    2 --
 src/grl-plugin-registry.c |    6 +++---
 3 files changed, 3 insertions(+), 14 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b7b25ac..d3b734d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,21 +70,12 @@ 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 9762421..72d3080 100644
--- a/src/grl-plugin-registry.c
+++ b/src/grl-plugin-registry.c
@@ -287,10 +287,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;
@@ -298,7 +298,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) {



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