diff options
author | Vivek Dasmohapatra <vivek@collabora.co.uk> | 2011-07-21 13:02:21 +0100 |
---|---|---|
committer | Vivek Dasmohapatra <vivek@collabora.co.uk> | 2011-07-21 13:02:21 +0100 |
commit | 0d2d3718faf22255a575b44c6184435cd16b4027 (patch) | |
tree | 53979a3f2f37f7187e2a26c0f0de475f09c3908e /src | |
parent | da359cb5b2c3d640c58bd5d777186561244cddf8 (diff) | |
parent | 149523e89c42cea1cb61c1baa682c623a44e4893 (diff) |
Merge branch 'unconditional-accounts-skip-too-many-transport-checks' into telepathy-mission-control-5.8
Diffstat (limited to 'src')
-rw-r--r-- | src/mcd-master.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/mcd-master.c b/src/mcd-master.c index 8a7ed351..e230bceb 100644 --- a/src/mcd-master.c +++ b/src/mcd-master.c @@ -707,19 +707,30 @@ _mcd_master_account_replace_transport (McdMaster *master, GHashTable *conditions; gboolean connected = FALSE; gboolean unconditional = FALSE; + const gchar *name; + const guint n_plugins = priv->transport_plugins->len; + guint n_conds; guint i; g_return_val_if_fail (MCD_IS_ACCOUNT (account), FALSE); + /* no transport plugins, decision is always "go for it" */ + if (n_plugins == 0) + return TRUE; + + name = mcd_account_get_unique_name (account); + if (_mcd_account_needs_dispatch (account)) { - DEBUG ("Always-dispatchable account %s needs no transport", - mcd_account_get_unique_name (account)); + DEBUG ("Always-dispatchable account %s needs no transport", name); return TRUE; } conditions = mcd_account_get_conditions (account); - unconditional = g_hash_table_size (conditions) == 0; + n_conds = g_hash_table_size (conditions); + unconditional = (n_conds == 0); + + DEBUG ("Checking %s [%u conditions, %u plugins]", name, n_conds, n_plugins); for (i = 0; !connected && i < priv->transport_plugins->len; i++) { |