summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVivek Dasmohapatra <vivek@collabora.co.uk>2011-07-20 18:36:55 +0100
committerVivek Dasmohapatra <vivek@collabora.co.uk>2011-07-20 18:36:55 +0100
commit149523e89c42cea1cb61c1baa682c623a44e4893 (patch)
tree135d993e9a94cdba31ea4a9c0d0e7f5fd616f324 /src
parent575e87ff463a2b654bd7c921a6c900b1f9da9006 (diff)
If there are no transport plugins, the decision always has to be "Yes"
Diffstat (limited to 'src')
-rw-r--r--src/mcd-master.c17
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++)
{