aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table.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-table.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-table.c')
-rw-r--r--widgets/table/e-table.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index 472681796f..e81dc6b23c 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -203,7 +203,10 @@ et_disconnect_model (ETable *et)
static void
e_table_state_change (ETable *et)
{
- g_signal_emit (G_OBJECT (et), et_signals[STATE_CHANGE], 0);
+ if (et->state_change_freeze)
+ et->state_changed = TRUE;
+ else
+ g_signal_emit (G_OBJECT (et), et_signals[STATE_CHANGE], 0);
}
#define CHECK_HORIZONTAL(et) \
@@ -605,6 +608,9 @@ e_table_init (ETable *e_table)
e_table->current_search_col = NULL;
e_table->header_width = 0;
+
+ e_table->state_changed = FALSE;
+ e_table->state_change_freeze = 0;
}
/* Grab_focus handler for the ETable */
@@ -3709,3 +3715,28 @@ e_table_class_init (ETableClass *class)
gal_a11y_e_table_init ();
}
+
+void
+e_table_freeze_state_change (ETable *table)
+{
+ g_return_if_fail (table != NULL);
+
+ table->state_change_freeze++;
+ if (table->state_change_freeze == 1)
+ table->state_changed = FALSE;
+
+ g_return_if_fail (table->state_change_freeze != 0);
+}
+
+void
+e_table_thaw_state_change (ETable *table)
+{
+ g_return_if_fail (table != NULL);
+ g_return_if_fail (table->state_change_freeze != 0);
+
+ table->state_change_freeze--;
+ if (table->state_change_freeze == 0 && table->state_changed) {
+ table->state_changed = FALSE;
+ e_table_state_change (table);
+ }
+}