[evolution] Bug 675391 - Remove support for EVOLUTION_PLUGIN_PATH.



commit 381c91c0d23f717e07da16ab6df56a655b5388b5
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu May 3 15:45:52 2012 -0400

    Bug 675391 - Remove support for EVOLUTION_PLUGIN_PATH.
    
    This was a hidden feature to load EPlugins from a custom location by
    setting the EVOLUTION_PLUGIN_PATH environment variable.  It defaulted
    to $HOME/.eplugins, which is in violation of the XDG Base Directory
    Specification.
    
    Since I've never ever heard of anyone using this and wasn't even aware
    of it myself, rather than migrating the folder to a standard-compliant
    location I'm just going to drop support for EVOLUTION_PLUGIN_PATH and
    put my money on no one noticing.  The EPlugin framework is gradually
    being decommissioned anyway in favor of the simpler and more flexible
    EExtension framework in Evolution-Data-Server.

 e-util/e-plugin.c |   79 +++++++++++-----------------------------------------
 e-util/e-plugin.h |    1 -
 2 files changed, 17 insertions(+), 63 deletions(-)
---
diff --git a/e-util/e-plugin.c b/e-util/e-plugin.c
index a125e68..fd11aba 100644
--- a/e-util/e-plugin.c
+++ b/e-util/e-plugin.c
@@ -67,8 +67,6 @@
 
 /* global table of plugin types by pluginclass.type */
 static GHashTable *ep_types;
-/* plugin load path */
-static GSList *ep_path;
 /* global table of plugins by plugin.id */
 static GHashTable *ep_plugins;
 /* the list of disabled plugins from GSettings */
@@ -289,7 +287,6 @@ static void
 e_plugin_class_init (EPluginClass *class)
 {
 	GObjectClass *object_class;
-	gchar *path, *col, *p;
 
 	object_class = G_OBJECT_CLASS (class);
 	object_class->set_property = ep_set_property;
@@ -308,25 +305,6 @@ e_plugin_class_init (EPluginClass *class)
 			"Whether the plugin is enabled",
 			TRUE,
 			G_PARAM_READWRITE));
-
-	/* Add paths in the environment variable or default global
-	 * and user specific paths */
-	path = g_strdup(g_getenv("EVOLUTION_PLUGIN_PATH"));
-	if (path == NULL) {
-		/* Add the global path */
-		e_plugin_add_load_path (EVOLUTION_PLUGINDIR);
-
-		path = g_build_filename(g_get_home_dir(), ".eplugins", NULL);
-	}
-
-	p = path;
-	while ((col = strchr (p, G_SEARCHPATH_SEPARATOR))) {
-		*col++ = 0;
-		e_plugin_add_load_path (p);
-		p = col;
-	}
-	e_plugin_add_load_path (p);
-	g_free (path);
 }
 
 static void
@@ -450,26 +428,6 @@ ep_load (const gchar *filename,
 	return 0;
 }
 
-/**
- * e_plugin_add_load_path:
- * @path: The path to add to search for plugins.
- *
- * Add a path to be searched when e_plugin_load_plugins() is called.
- * By default the system plugin directory and ~/.eplugins is used as
- * the search path unless overriden by the environmental variable
- * %EVOLUTION_PLUGIN_PATH.
- *
- * %EVOLUTION_PLUGIN_PATH is a : separated list of paths to search for
- * plugin definitions in order.
- *
- * Plugin definitions are XML files ending in the extension ".eplug".
- **/
-void
-e_plugin_add_load_path (const gchar *path)
-{
-	ep_path = g_slist_append (ep_path, g_strdup (path));
-}
-
 static void
 plugin_load_subclass (GType type,
                       GHashTable *hash_table)
@@ -529,7 +487,6 @@ gint
 e_plugin_load_plugins (void)
 {
 	GSettings *settings;
-	GSList *l;
 	gchar **strv;
 	gint i;
 
@@ -558,31 +515,29 @@ e_plugin_load_plugins (void)
 	g_object_unref (settings);
 
 	for (i = 0; i < 3; i++) {
-		for (l = ep_path; l; l = g_slist_next (l)) {
-			GDir *dir;
-			const gchar *d;
-			gchar *path = l->data;
+		GDir *dir;
+		const gchar *d;
+		const gchar *path = EVOLUTION_PLUGINDIR;
 
-			pd(printf("scanning plugin dir '%s'\n", path));
+		pd(printf("scanning plugin dir '%s'\n", path));
 
-			dir = g_dir_open (path, 0, NULL);
-			if (dir == NULL) {
-				/*g_warning("Could not find plugin path: %s", path);*/
-				continue;
-			}
+		dir = g_dir_open (path, 0, NULL);
+		if (dir == NULL) {
+			/*g_warning("Could not find plugin path: %s", path);*/
+			continue;
+		}
 
-			while ((d = g_dir_read_name (dir))) {
-				if (g_str_has_suffix  (d, ".eplug")) {
-					gchar *name;
+		while ((d = g_dir_read_name (dir))) {
+			if (g_str_has_suffix  (d, ".eplug")) {
+				gchar *name;
 
-					name = g_build_filename (path, d, NULL);
-					ep_load (name, i);
-					g_free (name);
-				}
+				name = g_build_filename (path, d, NULL);
+				ep_load (name, i);
+				g_free (name);
 			}
-
-			g_dir_close (dir);
 		}
+
+		g_dir_close (dir);
 	}
 
 	return 0;
diff --git a/e-util/e-plugin.h b/e-util/e-plugin.h
index 1815665..047d944 100644
--- a/e-util/e-plugin.h
+++ b/e-util/e-plugin.h
@@ -129,7 +129,6 @@ struct _EPluginClass {
 GType		e_plugin_get_type		(void);
 gint		e_plugin_construct		(EPlugin *plugin,
 						 xmlNodePtr root);
-void		e_plugin_add_load_path		(const gchar *path);
 gint		e_plugin_load_plugins		(void);
 GSList *	e_plugin_list_plugins		(void);
 gpointer	e_plugin_get_symbol		(EPlugin *plugin,



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