aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-09-29 04:45:06 +0800
committerChris Lahey <clahey@src.gnome.org>2001-09-29 04:45:06 +0800
commitec852ee1f995b3a7deccf6312130ff0f3531ae3b (patch)
treedbf1b51f10094e33a38fd29f51f221c3f4c6d287
parent12ab0a8e8587d4bc6a732c7c84ef2826fcbecf91 (diff)
downloadgsoc2013-evolution-ec852ee1f995b3a7deccf6312130ff0f3531ae3b.tar
gsoc2013-evolution-ec852ee1f995b3a7deccf6312130ff0f3531ae3b.tar.gz
gsoc2013-evolution-ec852ee1f995b3a7deccf6312130ff0f3531ae3b.tar.bz2
gsoc2013-evolution-ec852ee1f995b3a7deccf6312130ff0f3531ae3b.tar.lz
gsoc2013-evolution-ec852ee1f995b3a7deccf6312130ff0f3531ae3b.tar.xz
gsoc2013-evolution-ec852ee1f995b3a7deccf6312130ff0f3531ae3b.tar.zst
gsoc2013-evolution-ec852ee1f995b3a7deccf6312130ff0f3531ae3b.zip
Stop the sort idle if the root node gets changed.
2001-09-28 Christopher James Lahey <clahey@ximian.com> * e-tree-sorted.c (ets_proxy_node_changed): Stop the sort idle if the root node gets changed. svn path=/trunk/; revision=13227
-rw-r--r--widgets/table/e-tree-sorted.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/widgets/table/e-tree-sorted.c b/widgets/table/e-tree-sorted.c
index f771c55914..e1c960d078 100644
--- a/widgets/table/e-tree-sorted.c
+++ b/widgets/table/e-tree-sorted.c
@@ -121,6 +121,17 @@ ets_sort_idle(gpointer user_data)
return FALSE;
}
+#define ETS_SORT_IDLE_ACTIVATED(ets) ((ets)->priv->sort_idle_id != 0)
+
+inline static void
+ets_stop_sort_idle (ETreeSorted *ets)
+{
+ if (ets->priv->sort_idle_id) {
+ g_source_remove(ets->priv->sort_idle_id);
+ ets->priv->sort_idle_id = 0;
+ }
+}
+
static gboolean
ets_insert_idle(ETreeSorted *ets)
{
@@ -591,10 +602,7 @@ ets_destroy (GtkObject *object)
priv->sort_info_changed_id = 0;
}
- if (ets->priv->sort_idle_id) {
- g_source_remove(ets->priv->sort_idle_id);
- ets->priv->sort_idle_id = 0;
- }
+ ets_stop_sort_idle (ets);
if (ets->priv->insert_idle_id) {
g_source_remove(ets->priv->insert_idle_id);
ets->priv->insert_idle_id = 0;
@@ -963,6 +971,8 @@ ets_proxy_node_changed (ETreeModel *etm, ETreePath node, ETreeSorted *ets)
d(g_print("Setting last access %p. (ets_proxy_node_changed)\n", ets->priv->last_access));
if (e_tree_model_node_is_root(ets->priv->source, node)) {
+ ets_stop_sort_idle (ets);
+
if (ets->priv->root) {
free_path(ets->priv->root);
}
@@ -1029,7 +1039,7 @@ ets_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETr
i = parent_path->num_children;
path = new_path(parent_path, child);
path->orig_position = position;
- if (ets->priv->sort_idle_id == 0) {
+ if (!ETS_SORT_IDLE_ACTIVATED (ets)) {
ets->priv->insert_count++;
if (ets->priv->insert_count > ETS_INSERT_MAX) {
/* schedule a sort, and append instead */