[telepathy-glib/master] account{, -manager}: make no feature ready until core is ready

Jonny Lamb jonny.lamb at collabora.co.uk
Fri Sep 25 05:03:29 PDT 2009


Signed-off-by: Jonny Lamb <jonny.lamb at collabora.co.uk>
---
 telepathy-glib/account-manager.c |   10 ++++++++--
 telepathy-glib/account.c         |    9 +++++++--
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/telepathy-glib/account-manager.c b/telepathy-glib/account-manager.c
index 9d869b7..1e97ed6 100644
--- a/telepathy-glib/account-manager.c
+++ b/telepathy-glib/account-manager.c
@@ -184,11 +184,10 @@ _tp_account_manager_check_features (TpAccountManager *self,
     const GQuark *features)
 {
   const GQuark *f;
+  TpAccountManagerFeature *feat;
 
   for (f = features; *f != 0; f++)
     {
-      TpAccountManagerFeature *feat;
-
       feat = _tp_account_manager_get_feature (self, *f);
 
       /* features which are NULL (ie. don't exist) are always considered as
@@ -198,6 +197,13 @@ _tp_account_manager_check_features (TpAccountManager *self,
         return FALSE;
     }
 
+  /* Special-case core: no other feature is ready unless core itself is
+   * ready. */
+  feat = _tp_account_manager_get_feature (self,
+      TP_ACCOUNT_MANAGER_FEATURE_CORE);
+  if (!feat->ready)
+    return FALSE;
+
   return TRUE;
 }
 
diff --git a/telepathy-glib/account.c b/telepathy-glib/account.c
index 20b6c08..0bd7e69 100644
--- a/telepathy-glib/account.c
+++ b/telepathy-glib/account.c
@@ -243,11 +243,10 @@ _tp_account_check_features (TpAccount *self,
     const GQuark *features)
 {
   const GQuark *f;
+  TpAccountFeature *feat;
 
   for (f = features; *f != 0; f++)
     {
-      TpAccountFeature *feat;
-
       feat = _tp_account_get_feature (self, *f);
 
       /* features which are NULL (ie. don't exist) are always considered as
@@ -257,6 +256,12 @@ _tp_account_check_features (TpAccount *self,
         return FALSE;
     }
 
+  /* Special-case core: no other feature is ready unless core itself is
+   * ready. */
+  feat = _tp_account_get_feature (self, TP_ACCOUNT_FEATURE_CORE);
+  if (!feat->ready)
+    return FALSE;
+
   return TRUE;
 }
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list