gboolean calendar_sources_has_sources (CalendarSources *sources) { g_return_val_if_fail (CALENDAR_IS_SOURCES (sources), FALSE); ensure_appointment_sources (sources); ensure_task_sources (sources); return g_hash_table_size (sources->priv->appointment_sources.clients) > 0 || g_hash_table_size (sources->priv->task_sources.clients) > 0; }
GSList * calendar_sources_get_task_sources (CalendarSources *sources) { g_return_val_if_fail (CALENDAR_IS_SOURCES (sources), NULL); if (!sources->priv->task_sources.loaded) { calendar_sources_load_sources (sources, &sources->priv->task_sources, CALENDAR_SOURCES_TASK_SOURCES_KEY, CALENDAR_SOURCES_SELECTED_TASK_SOURCES_KEY, CALENDAR_SOURCES_SELECTED_TASK_SOURCES_DIR); } return sources->priv->task_sources.clients; }
GList * calendar_sources_get_task_clients (CalendarSources *sources) { GList *list, *link; g_return_val_if_fail (CALENDAR_IS_SOURCES (sources), NULL); ensure_task_sources (sources); list = g_hash_table_get_values (sources->priv->task_sources.clients); for (link = list; link != NULL; link = g_list_next (link)) link->data = ((ClientData *) link->data)->client; return list; }
GSList * calendar_sources_get_appointment_sources (CalendarSources *sources) { g_return_val_if_fail (CALENDAR_IS_SOURCES (sources), NULL); if (!sources->priv->appointment_sources.loaded) { calendar_sources_load_sources (sources, &sources->priv->appointment_sources, CALENDAR_SOURCES_APPOINTMENT_SOURCES_KEY, CALENDAR_SOURCES_SELECTED_APPOINTMENT_SOURCES_KEY, CALENDAR_SOURCES_SELECTED_APPOINTMENT_SOURCES_DIR); } return sources->priv->appointment_sources.clients; }
GList * calendar_sources_get_task_clients (CalendarSources *sources) { GList *list, *link; g_return_val_if_fail (CALENDAR_IS_SOURCES (sources), NULL); if (!sources->priv->task_sources.loaded) { calendar_sources_load_esource_list (sources->priv->registry, &sources->priv->task_sources); sources->priv->task_sources.loaded = TRUE; } list = g_hash_table_get_values (sources->priv->task_sources.clients); for (link = list; link != NULL; link = g_list_next (link)) link->data = ((ClientData *) link->data)->client; return list; }