[tasks] Fire loaded when the view is initially done
- From: Ross Burton <rburton src gnome org>
- To: svn-commits-list gnome org
- Subject: [tasks] Fire loaded when the view is initially done
- Date: Fri, 27 Mar 2009 13:48:50 -0400 (EDT)
commit 460e6570372da134fccd1d3b7a4165700de3a233
Author: Ross Burton <ross linux intel com>
Date: Fri Mar 27 17:41:56 2009 +0000
Fire loaded when the view is initially done
---
libkoto/koto-task-store.c | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/libkoto/koto-task-store.c b/libkoto/koto-task-store.c
index 057dbd3..e9706a9 100644
--- a/libkoto/koto-task-store.c
+++ b/libkoto/koto-task-store.c
@@ -35,7 +35,7 @@ struct _KotoTaskStorePrivate
{
ECal *cal;
ECalView *view;
- guint sig_added, sig_modified, sig_removed;
+ guint sig_added, sig_modified, sig_removed, sig_done;
GHashTable *uid_hash;
};
@@ -254,6 +254,18 @@ on_objects_removed (ECalView *view, GList *uids, KotoTaskStore *store) {
}
}
+static void
+on_view_done (ECalView *view, int status, KotoTaskStore *store)
+{
+ KotoTaskStorePrivate *priv = GET_PRIVATE (store);
+
+ g_signal_emit (store, signals[SIGNAL_LOADED], 0);
+
+ /* This is a one-shot signal */
+ g_signal_handler_disconnect (priv->view, priv->sig_done);
+ priv->sig_done = 0;
+}
+
/*
* Object methods
*/
@@ -387,7 +399,9 @@ koto_task_store_set_view (KotoTaskStore *store, ECalView *view)
g_signal_handler_disconnect (priv->view, priv->sig_added);
g_signal_handler_disconnect (priv->view, priv->sig_modified);
g_signal_handler_disconnect (priv->view, priv->sig_removed);
- priv->sig_added = priv->sig_modified = priv->sig_removed = 0;
+ if (priv->sig_done)
+ g_signal_handler_disconnect (priv->view, priv->sig_done);
+ priv->sig_added = priv->sig_modified = priv->sig_removed = priv->sig_done = 0;
g_object_unref (priv->view);
g_object_unref (priv->cal);
@@ -403,6 +417,7 @@ koto_task_store_set_view (KotoTaskStore *store, ECalView *view)
priv->sig_added = g_signal_connect (priv->view, "objects-added", G_CALLBACK (on_objects_added), store);
priv->sig_modified = g_signal_connect (priv->view, "objects-modified", G_CALLBACK (on_objects_modified), store);
priv->sig_removed = g_signal_connect (priv->view, "objects-removed", G_CALLBACK (on_objects_removed), store);
+ priv->sig_done = g_signal_connect (priv->view, "view-done", G_CALLBACK (on_view_done), store);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]