[empathy: 1/4] chatroom-manager: add a ready property



commit b2ef2b768c2dbf77ff8647243862f183bb52cce0
Author: Jonny Lamb <jonny lamb collabora co uk>
Date:   Tue Sep 8 14:22:09 2009 +0100

    chatroom-manager: add a ready property
    
    Signed-off-by: Jonny Lamb <jonny lamb collabora co uk>

 libempathy/empathy-chatroom-manager.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/libempathy/empathy-chatroom-manager.c b/libempathy/empathy-chatroom-manager.c
index c6318ab..7d80b94 100644
--- a/libempathy/empathy-chatroom-manager.c
+++ b/libempathy/empathy-chatroom-manager.c
@@ -55,6 +55,7 @@ typedef struct
   gulong account_manager_ready_handler_id;
   /* source id of the autosave timer */
   gint save_timer_id;
+  gboolean ready;
 } EmpathyChatroomManagerPriv;
 
 enum {
@@ -69,6 +70,7 @@ static guint signals[LAST_SIGNAL];
 enum
 {
   PROP_FILE = 1,
+  PROP_READY,
   LAST_PROPERTY
 };
 
@@ -304,6 +306,9 @@ chatroom_manager_get_all (EmpathyChatroomManager *manager)
 		return FALSE;
 	}
 
+        priv->ready = TRUE;
+        g_object_notify (G_OBJECT (manager), "ready");
+
 	return TRUE;
 }
 
@@ -321,6 +326,9 @@ empathy_chatroom_manager_get_property (GObject *object,
       case PROP_FILE:
         g_value_set_string (value, priv->file);
         break;
+      case PROP_READY:
+        g_value_set_boolean (value, priv->ready);
+        break;
       default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
         break;
@@ -423,6 +431,8 @@ empathy_chatroom_manager_constructor (GType type,
   self = EMPATHY_CHATROOM_MANAGER (obj);
   priv = GET_PRIV (self);
 
+  priv->ready = FALSE;
+
   chatroom_manager_singleton = self;
   g_object_add_weak_pointer (obj, (gpointer) &chatroom_manager_singleton);
 
@@ -476,6 +486,14 @@ empathy_chatroom_manager_class_init (EmpathyChatroomManagerClass *klass)
       G_PARAM_STATIC_BLURB);
   g_object_class_install_property (object_class, PROP_FILE, param_spec);
 
+  param_spec = g_param_spec_boolean (
+      "ready",
+      "whether the manager is ready yet",
+      "whether the manager is ready yet",
+      FALSE,
+      G_PARAM_READABLE);
+  g_object_class_install_property (object_class, PROP_READY, param_spec);
+
   signals[CHATROOM_ADDED] = g_signal_new ("chatroom-added",
       G_TYPE_FROM_CLASS (klass),
       G_SIGNAL_RUN_LAST,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]