From ffec3e92a36ce871a71c5e739fbaf08fa957ab9c Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 12 Mar 2003 17:27:11 +0000 Subject: New, to free/thaw the ETree models. (e_summary_shown_add_node): Don't * e-summary-shown.c (e_summary_shown_freeze, e_summary_shown_thaw): New, to free/thaw the ETree models. (e_summary_shown_add_node): Don't freeze/thaw around the single add here. That doesn't really help much. * e-summary-preferences.c (fill_rdf_etable): Freeze/thaw the ESummaryShown while filling it in. * e-summary-weather.c (e_summary_weather_fill_etable): Likewise. svn path=/trunk/; revision=20263 --- my-evolution/ChangeLog | 12 ++++++++++++ my-evolution/e-summary-preferences.c | 3 +++ my-evolution/e-summary-shown.c | 36 +++++++++++++++++++----------------- my-evolution/e-summary-shown.h | 3 +++ my-evolution/e-summary-weather.c | 3 +++ 5 files changed, 40 insertions(+), 17 deletions(-) diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog index 67605633f9..f40f7d2674 100644 --- a/my-evolution/ChangeLog +++ b/my-evolution/ChangeLog @@ -1,3 +1,15 @@ +2003-03-12 Dan Winship + + * e-summary-shown.c (e_summary_shown_freeze, + e_summary_shown_thaw): New, to free/thaw the ETree models. + (e_summary_shown_add_node): Don't freeze/thaw around the single + add here. That doesn't really help much. + + * e-summary-preferences.c (fill_rdf_etable): Freeze/thaw the + ESummaryShown while filling it in. + + * e-summary-weather.c (e_summary_weather_fill_etable): Likewise. + 2003-03-07 Ettore Perazzoli * Locations (name): Add some escapes to the newly added locations diff --git a/my-evolution/e-summary-preferences.c b/my-evolution/e-summary-preferences.c index 056532d0b3..3e117df284 100644 --- a/my-evolution/e-summary-preferences.c +++ b/my-evolution/e-summary-preferences.c @@ -443,6 +443,7 @@ fill_rdf_etable (GtkWidget *widget, } ess = E_SUMMARY_SHOWN (widget); + e_summary_shown_freeze (ess); /* Fill the defaults first */ for (i = 0; rdfs[i].url; i++) { @@ -482,6 +483,7 @@ fill_rdf_etable (GtkWidget *widget, } if (handle == NULL) { + e_summary_shown_thaw (ess); return; } @@ -534,6 +536,7 @@ fill_rdf_etable (GtkWidget *widget, } fclose (handle); + e_summary_shown_thaw (ess); } static void diff --git a/my-evolution/e-summary-shown.c b/my-evolution/e-summary-shown.c index b8f2b4bd80..98301059c1 100644 --- a/my-evolution/e-summary-shown.c +++ b/my-evolution/e-summary-shown.c @@ -558,22 +558,6 @@ e_summary_shown_new (void) return GTK_WIDGET (shown); } -static ETreePath -e_tree_model_node_append (ETreeModel *etm, - ETreePath parent, - gpointer data) -{ - ETreeMemory *etmm; - ETreePath path; - - etmm = E_TREE_MEMORY (etm); - e_tree_memory_freeze (etmm); - path = e_tree_memory_node_insert (etmm, parent, -1, data); - e_tree_memory_thaw (etmm); - - return path; -} - ETreePath e_summary_shown_add_node (ESummaryShown *shown, gboolean all, @@ -603,7 +587,7 @@ e_summary_shown_add_node (ESummaryShown *shown, } etmm = E_TREE_MEMORY (td->etm); - path = e_tree_model_node_append (td->etm, parent, data); + path = e_tree_memory_node_insert (etmm, parent, -1, data); tree = e_tree_scrolled_get_tree (E_TREE_SCROLLED (td->etable)); e_tree_node_set_expanded (tree, path, expanded); @@ -650,6 +634,24 @@ e_summary_shown_remove_node (ESummaryShown *shown, } +void +e_summary_shown_freeze (ESummaryShown *shown) +{ + g_return_if_fail (IS_E_SUMMARY_SHOWN (shown)); + + e_tree_memory_freeze (E_TREE_MEMORY (shown->priv->all->etm)); + e_tree_memory_freeze (E_TREE_MEMORY (shown->priv->shown->etm)); +} + +void +e_summary_shown_thaw (ESummaryShown *shown) +{ + g_return_if_fail (IS_E_SUMMARY_SHOWN (shown)); + + e_tree_memory_thaw (E_TREE_MEMORY (shown->priv->all->etm)); + e_tree_memory_thaw (E_TREE_MEMORY (shown->priv->shown->etm)); +} + static void make_list (ETreePath path, gpointer data) diff --git a/my-evolution/e-summary-shown.h b/my-evolution/e-summary-shown.h index 739e773a0f..4f6ffd4459 100644 --- a/my-evolution/e-summary-shown.h +++ b/my-evolution/e-summary-shown.h @@ -75,6 +75,9 @@ ETreePath e_summary_shown_add_node (ESummaryShown *shown, void e_summary_shown_remove_node (ESummaryShown *shown, gboolean all, ESummaryShownModelEntry *entry); +void e_summary_shown_freeze (ESummaryShown *shown); +void e_summary_shown_thaw (ESummaryShown *shown); GList *e_summary_shown_get_selection (ESummaryShown *shown, gboolean all); + #endif diff --git a/my-evolution/e-summary-weather.c b/my-evolution/e-summary-weather.c index 00dbb25198..77614198f7 100644 --- a/my-evolution/e-summary-weather.c +++ b/my-evolution/e-summary-weather.c @@ -667,6 +667,8 @@ e_summary_weather_fill_etable (ESummaryShown *ess) gnome_config_get_vector ("Main/regions", &nregions, ®ions); region = NULL; + + e_summary_shown_freeze (ess); for (iregions = nregions - 1; iregions >= 0; iregions--) { int nstates, istates; char **states; @@ -754,6 +756,7 @@ e_summary_weather_fill_etable (ESummaryShown *ess) g_strfreev (regions); gnome_config_pop_prefix (); + e_summary_shown_thaw (ess); return; } -- cgit v1.2.3