summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-04-23 19:40:09 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2008-04-23 19:40:09 +0100
commitb5cd4c67a6d1c8c7d7caed890319fb3ae55db6b0 (patch)
tree3d70045d07cba0c63be4743d2910e4874eb15bb4
parenta6dd2d3a068f53aa4de1a240ad35314570246dc1 (diff)
Flush pending updates to AllocatorStore before getters().
-rw-r--r--src/allocators-store.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/allocators-store.c b/src/allocators-store.c
index 3625484..fe696ac 100644
--- a/src/allocators-store.c
+++ b/src/allocators-store.c
@@ -52,6 +52,9 @@ allocators_store_tree_model_init (GtkTreeModelIface *iface);
static GType
allocators_store_get_type (void);
+static gboolean
+_allocators_store_update (AllocatorsStore *store);
+
G_DEFINE_TYPE_WITH_CODE (AllocatorsStore, allocators_store, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL,
allocators_store_tree_model_init))
@@ -404,12 +407,24 @@ allocators_store_set_cmp (AllocatorsStore *store, GCompareFunc cmp)
struct _sum_allocator *
allocators_store_get_sums (AllocatorsStore *store)
{
+ if (store->update) {
+ g_source_remove (store->update);
+ store->update = 0;
+ _allocators_store_update (store);
+ }
+
return store->sums;
}
GPtrArray *
allocators_store_get_array (AllocatorsStore *store)
{
+ if (store->update) {
+ g_source_remove (store->update);
+ store->update = 0;
+ _allocators_store_update (store);
+ }
+
return store->allocators;
}
@@ -591,6 +606,7 @@ allocators_store_update (AllocatorsStore *store)
}
}
+
void
allocators_store_reset_filters (AllocatorsStore *store)
{
@@ -662,4 +678,5 @@ allocators_store_update_from_allocators (AllocatorsStore *store,
}
_allocators_store_update (store);
+
}