[glade3/glade-3-8] * gladeui/glade-project.c: Notify iter changes when the widget name changes, increment project i
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade3/glade-3-8] * gladeui/glade-project.c: Notify iter changes when the widget name changes, increment project i
- Date: Thu, 16 Dec 2010 07:35:57 +0000 (UTC)
commit 536dc86f760858326786a167f6763e495750cdbd
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Thu Dec 16 16:41:46 2010 +0900
* gladeui/glade-project.c: Notify iter changes when the widget name changes, increment project
iter stamp before notifying row-inserted (old iters are invalid, the new iter persists),
fixed leaked GtkTreePath when rows are inserted.
ChangeLog | 4 ++++
gladeui/glade-project.c | 17 ++++++++++++++---
2 files changed, 18 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ce4e56b..1faf51d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,10 @@
* plugins/gtk+/glade-gtk.c: Avoid using gtk_combo_box_set_entry_text_column directly (build
for GTK+ 2.20).
+ * gladeui/glade-project.c: Notify iter changes when the widget name changes, increment project
+ iter stamp before notifying row-inserted (old iters are invalid, the new iter persists),
+ fixed leaked GtkTreePath when rows are inserted.
+
2010-12-15 Tristan Van Berkom <tristanvb openismus com>
* gladeui/glade-project.c: Cleanup glade_project_remove_object(), make sure row_deleted is
diff --git a/gladeui/glade-project.c b/gladeui/glade-project.c
index 1604f07..b3416a3 100644
--- a/gladeui/glade-project.c
+++ b/gladeui/glade-project.c
@@ -2773,7 +2773,9 @@ glade_project_set_widget_name (GladeProject *project,
GladeWidget *widget,
const gchar *name)
{
- gchar *new_name;
+ gchar *new_name;
+ GtkTreeIter iter;
+ GtkTreePath *path;
g_return_if_fail (GLADE_IS_PROJECT (project));
g_return_if_fail (GLADE_IS_WIDGET (widget));
@@ -2800,6 +2802,12 @@ glade_project_set_widget_name (GladeProject *project,
0, widget);
g_free (new_name);
+
+ /* Notify views about the iter change */
+ glade_project_model_get_iter_for_object (project, widget->object, &iter);
+ path = gtk_tree_model_get_path (GTK_TREE_MODEL (project), &iter);
+ gtk_tree_model_row_changed (GTK_TREE_MODEL (project), path, &iter);
+ gtk_tree_path_free (path);
}
static gint
@@ -2924,11 +2932,14 @@ glade_project_add_object (GladeProject *project,
if (!project->priv->loading)
{
+ /* The state of old iters go invalid and then the new iter is valid
+ * until the next change */
+ project->priv->stamp++;
+
glade_project_model_get_iter_for_object (project, object, &iter);
path = gtk_tree_model_get_path (GTK_TREE_MODEL (project), &iter);
-
gtk_tree_model_row_inserted (GTK_TREE_MODEL (project), path, &iter);
- project->priv->stamp++;
+ gtk_tree_path_free (path);
}
/* NOTE: Sensitive ordering here, we need to recurse after updating
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]