manager: initial implementation of GcalManager::save_source method

This commit is contained in:
Georges Basile Stavracas Neto
2015-05-25 12:31:07 -04:00
committed by Erick Pérez Castellanos
parent ec1ad935da
commit 18fa205916
2 changed files with 30 additions and 0 deletions
+27
View File
@@ -1212,6 +1212,33 @@ gcal_manager_disable_source (GcalManager *manager,
g_settings_set_strv (priv->settings, "disabled-sources", (const gchar * const *) priv->disabled_sources);
}
/**
* gcal_manager_save_source:
* @manager: a #GcalManager
* @source: the target ESource
*
* Commit the given ESource.
*/
void
gcal_manager_save_source (GcalManager *manager,
ESource *source)
{
GcalManagerPrivate *priv;
GError *error;
priv = gcal_manager_get_instance_private (manager);
error = NULL;
e_source_registry_commit_source_sync (priv->source_registry, source, NULL, &error);
if (error != NULL)
{
/* FIXME: Notify the user somehow */
g_warning ("Error saving source: %s", error->message);
g_error_free (error);
}
}
gboolean
gcal_manager_source_enabled (GcalManager *manager,
ESource *source)
+3
View File
@@ -113,6 +113,9 @@ void gcal_manager_enable_source (GcalManager *manager
void gcal_manager_disable_source (GcalManager *manager,
ESource *source);
void gcal_manager_save_source (GcalManager *manager,
ESource *source);
gboolean gcal_manager_source_enabled (GcalManager *manager,
ESource *source);