manager: Only remove connected calendars
The "source-removed" signal can pass any kind of source, including source collections that even have the calendar extension, but are not connected.
This commit is contained in:
@@ -165,11 +165,15 @@ remove_source (GcalManager *self,
|
|||||||
g_return_if_fail (GCAL_IS_MANAGER (self));
|
g_return_if_fail (GCAL_IS_MANAGER (self));
|
||||||
g_return_if_fail (E_IS_SOURCE (source));
|
g_return_if_fail (E_IS_SOURCE (source));
|
||||||
|
|
||||||
|
calendar = g_hash_table_lookup (self->clients, source);
|
||||||
|
|
||||||
|
if (!calendar)
|
||||||
|
return;
|
||||||
|
|
||||||
GCAL_TRACE_MSG ("Removing calendar %s (%s)",
|
GCAL_TRACE_MSG ("Removing calendar %s (%s)",
|
||||||
e_source_get_display_name (source),
|
e_source_get_display_name (source),
|
||||||
e_source_get_uid (source));
|
e_source_get_uid (source));
|
||||||
|
|
||||||
calendar = g_hash_table_lookup (self->clients, source);
|
|
||||||
g_object_ref (calendar);
|
g_object_ref (calendar);
|
||||||
|
|
||||||
e_cal_data_model_remove_client (self->e_data_model,
|
e_cal_data_model_remove_client (self->e_data_model,
|
||||||
|
|||||||
Reference in New Issue
Block a user