manager: get all connected sources
Added ::get_sources_connected API to retrieve a list of every source the application has connected, no matter whether they are enabled or not. Use ::get_sources_connected on calendars menu in GcalWindow to enable disabled sources.
This commit is contained in:
+18
-2
@@ -635,8 +635,7 @@ gcal_manager_new_with_settings (GSettings *settings)
|
||||
*
|
||||
* Retrieve a list of the enabled sources used in the application.
|
||||
*
|
||||
* Returns: (Transfer full) a {@link GList} object
|
||||
* to be freed with g_list_free()
|
||||
* Returns: (Transfer full) a {@link GList} object to be freed with g_list_free()
|
||||
**/
|
||||
GList*
|
||||
gcal_manager_get_sources (GcalManager *manager)
|
||||
@@ -659,6 +658,23 @@ gcal_manager_get_sources (GcalManager *manager)
|
||||
return aux;
|
||||
}
|
||||
|
||||
/**
|
||||
* gcal_manager_get_sources_connected:
|
||||
* @manager:
|
||||
*
|
||||
* Returns a {@link GList} with every source connected on the app, whether they are enabled or not.
|
||||
*
|
||||
* Returns: (Transfer full) a {@link GList} object to be freed with g_list_free()
|
||||
**/
|
||||
GList*
|
||||
gcal_manager_get_sources_connected (GcalManager *manager)
|
||||
{
|
||||
GcalManagerPrivate *priv;
|
||||
|
||||
priv = gcal_manager_get_instance_private (manager);
|
||||
return g_hash_table_get_keys (priv->clients);
|
||||
}
|
||||
|
||||
/**
|
||||
* gcal_manager_get_default_source:
|
||||
* @manager: App singleton {@link GcalManager} instance
|
||||
|
||||
@@ -63,6 +63,8 @@ GcalManager* gcal_manager_new_with_settings (GSettings *setting
|
||||
|
||||
GList* gcal_manager_get_sources (GcalManager *manager);
|
||||
|
||||
GList* gcal_manager_get_sources_connected (GcalManager *manager);
|
||||
|
||||
ESource* gcal_manager_get_default_source (GcalManager *manager);
|
||||
|
||||
icaltimezone* gcal_manager_get_system_timezone (GcalManager *manager);
|
||||
|
||||
+1
-1
@@ -776,7 +776,7 @@ on_calendar_toggled (GSimpleAction *action,
|
||||
|
||||
/* lookup source */
|
||||
source = NULL;
|
||||
l = gcal_manager_get_sources (priv->manager);
|
||||
l = gcal_manager_get_sources_connected (priv->manager);
|
||||
|
||||
for (aux = l; aux != NULL; aux = aux->next)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user