aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-tree.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-10-07 21:35:15 +0800
committerMilan Crha <mcrha@redhat.com>2011-10-07 21:35:15 +0800
commitaa75990c13d0fb2aea2ced1f9f7bd7d1785bdffc (patch)
tree108bd4a88211f42abfdc495d3cf71433b5af8cb1 /widgets/table/e-tree.c
parentd2232a718dc86dda4182d154a7fdfe1d218229dc (diff)
downloadgsoc2013-evolution-aa75990c13d0fb2aea2ced1f9f7bd7d1785bdffc.tar.gz
gsoc2013-evolution-aa75990c13d0fb2aea2ced1f9f7bd7d1785bdffc.tar.zst
gsoc2013-evolution-aa75990c13d0fb2aea2ced1f9f7bd7d1785bdffc.zip
Bug #235665 - Heavy hard disk access when resizing columns in views
Diffstat (limited to 'widgets/table/e-tree.c')
-rw-r--r--widgets/table/e-tree.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c
index effd1e9aa6..e24ce6a6e0 100644
--- a/widgets/table/e-tree.c
+++ b/widgets/table/e-tree.c
@@ -197,6 +197,9 @@ struct _ETreePrivate {
ETreeDragSourceSite *site;
GList *expanded_list;
+
+ gboolean state_changed;
+ guint state_change_freeze;
};
static guint et_signals[LAST_SIGNAL] = { 0, };
@@ -299,7 +302,10 @@ current_search_col (ETree *et)
static void
e_tree_state_change (ETree *et)
{
- g_signal_emit (G_OBJECT (et), et_signals[STATE_CHANGE], 0);
+ if (et->priv->state_change_freeze)
+ et->priv->state_changed = TRUE;
+ else
+ g_signal_emit (G_OBJECT (et), et_signals[STATE_CHANGE], 0);
}
static void
@@ -629,6 +635,9 @@ e_tree_init (ETree *e_tree)
G_CALLBACK (et_search_accept), e_tree);
e_tree->priv->always_search = g_getenv ("GAL_ALWAYS_SEARCH") ? TRUE : FALSE;
+
+ e_tree->priv->state_changed = FALSE;
+ e_tree->priv->state_change_freeze = 0;
}
/* Grab_focus handler for the ETree */
@@ -3787,3 +3796,28 @@ e_tree_set_info_message (ETree *tree,
} else
gnome_canvas_item_set (tree->priv->info_text, "text", info_message, NULL);
}
+
+void
+e_tree_freeze_state_change (ETree *tree)
+{
+ g_return_if_fail (tree != NULL);
+
+ tree->priv->state_change_freeze++;
+ if (tree->priv->state_change_freeze == 1)
+ tree->priv->state_changed = FALSE;
+
+ g_return_if_fail (tree->priv->state_change_freeze != 0);
+}
+
+void
+e_tree_thaw_state_change (ETree *tree)
+{
+ g_return_if_fail (tree != NULL);
+ g_return_if_fail (tree->priv->state_change_freeze != 0);
+
+ tree->priv->state_change_freeze--;
+ if (tree->priv->state_change_freeze == 0 && tree->priv->state_changed) {
+ tree->priv->state_changed = FALSE;
+ e_tree_state_change (tree);
+ }
+}