[goffice] Plugins: add "autoload" flag.
- From: Morten Welinder <mortenw src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [goffice] Plugins: add "autoload" flag.
- Date: Thu, 21 Jan 2010 13:24:17 +0000 (UTC)
commit aa9ac6434cade52755f9d8724f163947abca3a58
Author: Morten Welinder <terra gnome org>
Date: Thu Jan 21 08:23:58 2010 -0500
Plugins: add "autoload" flag.
ChangeLog | 6 ++++++
NEWS | 2 ++
goffice/app/go-plugin.c | 10 ++++++++++
3 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d0522ff..adaadee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-01-21 Morten Welinder <terra gnome org>
+
+ * goffice/app/go-plugin.c (go_plugin_read): Add new "autoload"
+ flag
+ (go_plugin_activate): Autoload if requested.
+
2010-01-19 Morten Welinder <terra gnome org>
* configure.in: Post-release bump.
diff --git a/NEWS b/NEWS
index 77a2b41..6f277bc 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,7 @@
goffice 0.7.19:
+Morten:
+ * Add "autoload" flag for plugins.
--------------------------------------------------------------------------
goffice 0.7.18:
diff --git a/goffice/app/go-plugin.c b/goffice/app/go-plugin.c
index bf6d28e..e8c0142 100644
--- a/goffice/app/go-plugin.c
+++ b/goffice/app/go-plugin.c
@@ -91,6 +91,7 @@ struct _GOPlugin {
GHashTable *loader_attrs;
GOPluginLoader *loader;
GSList *services;
+ gboolean autoload;
char *saved_textdomain;
};
@@ -729,6 +730,7 @@ go_plugin_read (GOPlugin *plugin, gchar const *dir_name, GOErrorInfo **ret_error
gchar *loader_id;
GHashTable *loader_attrs;
gboolean require_explicit_enabling = FALSE;
+ gboolean autoload = FALSE;
g_return_if_fail (GO_IS_PLUGIN (plugin));
g_return_if_fail (dir_name != NULL);
@@ -776,6 +778,9 @@ go_plugin_read (GOPlugin *plugin, gchar const *dir_name, GOErrorInfo **ret_error
description = NULL;
if (go_xml_get_child_by_name (information_node, (xmlChar const *)"require_explicit_enabling"))
require_explicit_enabling = TRUE;
+
+ if (go_xml_get_child_by_name (information_node, (xmlChar const *)"autoload"))
+ autoload = TRUE;
} else {
name = NULL;
description = NULL;
@@ -819,6 +824,7 @@ go_plugin_read (GOPlugin *plugin, gchar const *dir_name, GOErrorInfo **ret_error
plugin->name = name;
plugin->description = description;
plugin->require_explicit_enabling = require_explicit_enabling;
+ plugin->autoload = autoload;
plugin->is_active = FALSE;
plugin->use_refcount = 0;
plugin->type_module = NULL;
@@ -835,6 +841,7 @@ go_plugin_read (GOPlugin *plugin, gchar const *dir_name, GOErrorInfo **ret_error
go_error_info_add_details (*ret_error, services_error);
} else
go_plugin_message (4, "Read plugin.xml file for %s.\n", plugin->id);
+
} else {
if (id != NULL) {
GSList *error_list = NULL;
@@ -993,6 +1000,9 @@ go_plugin_activate (GOPlugin *plugin, GOErrorInfo **ret_error)
);
plugin->is_active = TRUE;
g_signal_emit (G_OBJECT (plugin), go_plugin_signals[STATE_CHANGED], 0);
+
+ if (plugin->autoload)
+ go_plugin_load_base (plugin, ret_error);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]