[gnome-calendar] manager: implement ::enable/disable methods
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] manager: implement ::enable/disable methods
- Date: Mon, 15 Dec 2014 18:44:25 +0000 (UTC)
commit 069ea90d576f51be526cdcc547aed69c6ffedacf
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Mon Dec 15 13:34:53 2014 -0500
manager: implement ::enable/disable methods
src/gcal-manager.c | 22 ++++++++++++++++++----
1 files changed, 18 insertions(+), 4 deletions(-)
---
diff --git a/src/gcal-manager.c b/src/gcal-manager.c
index 12cf9b5..f082e65 100644
--- a/src/gcal-manager.c
+++ b/src/gcal-manager.c
@@ -658,8 +658,15 @@ void
gcal_manager_enable_source (GcalManager *manager,
ESource *source)
{
- /* TODO: implement me */
- ;
+ GcalManagerPrivate *priv;
+ GcalManagerUnit *unit;
+
+ priv = gcal_manager_get_instance_private (manager);
+ unit = g_hash_table_lookup (priv->clients, source);
+
+ unit->enabled = TRUE;
+ e_cal_data_model_add_client (priv->e_data_model, unit->client);
+ e_cal_data_model_add_client (priv->search_data_model, unit->client);
}
/**
@@ -673,8 +680,15 @@ void
gcal_manager_disable_source (GcalManager *manager,
ESource *source)
{
- /* TODO: implement me */
- ;
+ GcalManagerPrivate *priv;
+ GcalManagerUnit *unit;
+
+ priv = gcal_manager_get_instance_private (manager);
+ unit = g_hash_table_lookup (priv->clients, source);
+
+ unit->enabled = FALSE;
+ e_cal_data_model_remove_client (priv->e_data_model, e_source_get_uid (source));
+ e_cal_data_model_remove_client (priv->search_data_model, e_source_get_uid (source));
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]