manager: improved ESource/EClient connection flow
This commit is contained in:
+12
-13
@@ -187,12 +187,6 @@ load_source (GcalManager *manager,
|
||||
unit = g_new0 (GcalManagerUnit, 1);
|
||||
|
||||
g_hash_table_insert (priv->clients, source, unit);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning ("Skipping already loaded source: %s",
|
||||
e_source_get_uid (source));
|
||||
}
|
||||
|
||||
/* NULL: because maybe the operation cannot be really cancelled */
|
||||
e_cal_client_connect (source,
|
||||
@@ -200,6 +194,12 @@ load_source (GcalManager *manager,
|
||||
on_client_connected,
|
||||
manager);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning ("Skipping already loaded source: %s",
|
||||
e_source_get_uid (source));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
on_client_connected (GObject *source_object,
|
||||
@@ -229,20 +229,20 @@ on_client_connected (GObject *source_object,
|
||||
/* FIXME: user should be able to disable sources */
|
||||
unit->enabled = TRUE;
|
||||
|
||||
g_debug ("Source %s connected",
|
||||
e_source_get_display_name (source));
|
||||
g_debug ("Source %s (%s) connected",
|
||||
e_source_get_display_name (source),
|
||||
e_source_get_uid (source));
|
||||
|
||||
/* setting view */
|
||||
recreate_view (GCAL_MANAGER (user_data), unit);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (error != NULL)
|
||||
{
|
||||
g_warning ("%s", error->message);
|
||||
|
||||
/* handling error */
|
||||
if (g_error_matches (error, E_CLIENT_ERROR,
|
||||
if (g_error_matches (error,
|
||||
E_CLIENT_ERROR,
|
||||
E_CLIENT_ERROR_BUSY))
|
||||
{
|
||||
RetryOpenData *rod;
|
||||
@@ -269,7 +269,6 @@ on_client_connected (GObject *source_object,
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
retry_connect_on_timeout (gpointer user_data)
|
||||
@@ -613,7 +612,7 @@ gcal_manager_constructed (GObject *object)
|
||||
return;
|
||||
}
|
||||
|
||||
sources = e_source_registry_list_sources (priv->source_registry,
|
||||
sources = e_source_registry_list_enabled (priv->source_registry,
|
||||
E_SOURCE_EXTENSION_CALENDAR);
|
||||
|
||||
for (l = sources; l != NULL; l = l->next)
|
||||
|
||||
Reference in New Issue
Block a user