[libpeas] Only emit notify::plugin-list when it has changed
- From: Garrett Regier <gregier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpeas] Only emit notify::plugin-list when it has changed
- Date: Fri, 18 Feb 2011 01:07:50 +0000 (UTC)
commit 38397fb6a9ed777838b760c6cdec66a23dcece6e
Author: Garrett Regier <alias301 gmail com>
Date: Tue Feb 15 01:52:47 2011 -0800
Only emit notify::plugin-list when it has changed
libpeas/peas-engine.c | 14 +++++++++++---
tests/libpeas-gtk/plugin-manager-view.c | 2 +-
2 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/libpeas/peas-engine.c b/libpeas/peas-engine.c
index 1274887..29ee6b2 100644
--- a/libpeas/peas-engine.c
+++ b/libpeas/peas-engine.c
@@ -129,7 +129,12 @@ load_plugin_info (PeasEngine *engine,
if (peas_engine_get_plugin_info (engine, module_name) != NULL)
_peas_plugin_info_unref (info);
else
- engine->priv->plugin_list = g_list_prepend (engine->priv->plugin_list, info);
+ {
+ engine->priv->plugin_list = g_list_prepend (engine->priv->plugin_list,
+ info);
+
+ g_object_notify (G_OBJECT (engine), "plugin-list");
+ }
}
static void
@@ -192,6 +197,8 @@ peas_engine_rescan_plugins (PeasEngine *engine)
return;
}
+ g_object_freeze_notify (G_OBJECT (engine));
+
/* Go and read everything from the provided search paths */
for (item = engine->priv->search_paths; item != NULL; item = item->next)
{
@@ -199,7 +206,7 @@ peas_engine_rescan_plugins (PeasEngine *engine)
load_dir_real (engine, sp->module_dir, sp->data_dir, 1);
}
- g_object_notify (G_OBJECT (engine), "plugin-list");
+ g_object_thaw_notify (G_OBJECT (engine));
}
/**
@@ -243,8 +250,9 @@ peas_engine_add_search_path (PeasEngine *engine,
* the plugin list. */
engine->priv->search_paths = g_list_append (engine->priv->search_paths, sp);
+ g_object_freeze_notify (G_OBJECT (engine));
load_dir_real (engine, sp->module_dir, sp->data_dir, 1);
- g_object_notify (G_OBJECT (engine), "plugin-list");
+ g_object_thaw_notify (G_OBJECT (engine));
}
static guint
diff --git a/tests/libpeas-gtk/plugin-manager-view.c b/tests/libpeas-gtk/plugin-manager-view.c
index 3c99f80..e46f4f7 100644
--- a/tests/libpeas-gtk/plugin-manager-view.c
+++ b/tests/libpeas-gtk/plugin-manager-view.c
@@ -182,7 +182,7 @@ test_gtk_plugin_manager_view_reload (TestFixture *fixture)
gtk_tree_selection_select_iter (fixture->selection, &iter);
selected_info = testing_get_plugin_info_for_iter (fixture->view, &iter);
- peas_engine_rescan_plugins (fixture->engine);
+ g_object_notify (G_OBJECT (fixture->engine), "plugin-list");
g_assert (gtk_tree_selection_get_selected (fixture->selection, NULL, &iter));
g_assert (testing_get_plugin_info_for_iter (fixture->view, &iter) == selected_info);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]