[emerillon/gtk3] Set plugin directory before trying to load plugins
- From: Johannes Schmid <jhs src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [emerillon/gtk3] Set plugin directory before trying to load plugins
- Date: Sun, 26 Jun 2011 10:06:07 +0000 (UTC)
commit 635577b31aa7d53938e7bc208ccbb14dde82b300
Author: Johannes Schmid <jhs gnome org>
Date: Sun Jun 26 11:42:08 2011 +0200
Set plugin directory before trying to load plugins
emerillon/main.c | 1 +
emerillon/manager.c | 16 +++++++++++++---
emerillon/manager.h | 2 ++
3 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/emerillon/main.c b/emerillon/main.c
index bee2dc3..0fed8b5 100644
--- a/emerillon/main.c
+++ b/emerillon/main.c
@@ -182,6 +182,7 @@ main (int argc,
{
peas_engine_add_search_path (engine, *dir, NULL);
}
+ emerillon_manager_initialize(EMERILLON_MANAGER(engine));
gtk_main ();
diff --git a/emerillon/manager.c b/emerillon/manager.c
index 14a2503..8649405 100644
--- a/emerillon/manager.c
+++ b/emerillon/manager.c
@@ -54,7 +54,7 @@ is_enabled (gchar ** conf, PeasPluginInfo *plugin)
return FALSE;
}
-static void
+void
emerillon_manager_initialize (EmerillonManager *manager)
{
const GList *list,
@@ -64,10 +64,21 @@ emerillon_manager_initialize (EmerillonManager *manager)
manager->priv->settings_plugins = g_settings_new (EMERILLON_SCHEMA_PLUGINS);
conf_list = g_settings_get_strv (manager->priv->settings_plugins,
EMERILLON_CONF_PLUGINS_ACTIVE_PLUGINS);
-
+
list = peas_engine_get_plugin_list (PEAS_ENGINE(manager));
for (iter = list; iter; iter = iter->next)
{
+ GError *error = NULL;
+
+ if (!peas_plugin_info_is_available (iter->data, &error))
+ {
+ g_warning ("%s: %s: %s",
+ peas_plugin_info_get_module_name (iter->data),
+ "Not available",
+ error ? error->message : "Unknown error");
+ if (error)
+ g_error_free (error);
+ }
if (peas_plugin_info_is_loaded (iter->data))
{
continue;
@@ -88,7 +99,6 @@ static void
emerillon_manager_init (EmerillonManager *self)
{
self->priv = EMERILLON_MANAGER_GET_PRIVATE (self);
- emerillon_manager_initialize(self);
}
static void
diff --git a/emerillon/manager.h b/emerillon/manager.h
index 9a489c7..28f828b 100644
--- a/emerillon/manager.h
+++ b/emerillon/manager.h
@@ -57,6 +57,8 @@ GType emerillon_manager_get_type (void) G_GNUC_CONST;
PeasEngine * emerillon_manager_dup_default (void);
+void emerillon_manager_initialize (EmerillonManager *manager);
+
G_END_DECLS
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]