diff options
author | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-09-21 23:15:07 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-09-21 23:15:07 +0800 |
commit | d757ba352a135a81cfb2e638b25d66998dbe1eb9 (patch) | |
tree | e0fa4b362ae4b4f0b75669a24e509b9f35143761 /modules/calendar | |
parent | b9a43c056c67bc343748fbd7c1b5385a6457014a (diff) | |
download | gsoc2013-evolution-d757ba352a135a81cfb2e638b25d66998dbe1eb9.tar gsoc2013-evolution-d757ba352a135a81cfb2e638b25d66998dbe1eb9.tar.gz gsoc2013-evolution-d757ba352a135a81cfb2e638b25d66998dbe1eb9.tar.bz2 gsoc2013-evolution-d757ba352a135a81cfb2e638b25d66998dbe1eb9.tar.lz gsoc2013-evolution-d757ba352a135a81cfb2e638b25d66998dbe1eb9.tar.xz gsoc2013-evolution-d757ba352a135a81cfb2e638b25d66998dbe1eb9.tar.zst gsoc2013-evolution-d757ba352a135a81cfb2e638b25d66998dbe1eb9.zip |
Port EMemoShellBackend to GSettings
Diffstat (limited to 'modules/calendar')
-rw-r--r-- | modules/calendar/e-cal-shell-backend.c | 2 | ||||
-rw-r--r-- | modules/calendar/e-memo-shell-backend.c | 43 |
2 files changed, 28 insertions, 17 deletions
diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c index 2a1edb96d2..36af9fd827 100644 --- a/modules/calendar/e-cal-shell-backend.c +++ b/modules/calendar/e-cal-shell-backend.c @@ -910,7 +910,7 @@ e_cal_shell_backend_get_selected_calendars (ECalShellBackend *cal_shell_backend) E_IS_CAL_SHELL_BACKEND (cal_shell_backend), NULL); settings = g_settings_new ("org.gnome.evolution.calendar"); - selected_calendars = g_settings_get_strv (settings, "selected-calendars"); + strv = g_settings_get_strv (settings, "selected-calendars"); g_object_unref (settings); if (strv != NULL) { diff --git a/modules/calendar/e-memo-shell-backend.c b/modules/calendar/e-memo-shell-backend.c index 7edb82d6bb..e9c8233a99 100644 --- a/modules/calendar/e-memo-shell-backend.c +++ b/modules/calendar/e-memo-shell-backend.c @@ -645,34 +645,45 @@ e_memo_shell_backend_get_source_list (EMemoShellBackend *memo_shell_backend) GSList * e_memo_shell_backend_get_selected_memo_lists (EMemoShellBackend *memo_shell_backend) { - GConfClient *client; - GSList *selected_memo_lists; - const gchar *key; + GSettings *settings; + char **strv; + gint i; + GSList *selected_memo_list = NULL; g_return_val_if_fail ( E_IS_MEMO_SHELL_BACKEND (memo_shell_backend), NULL); - client = gconf_client_get_default (); - key = "/apps/evolution/calendar/memos/selected_memos"; - selected_memo_lists = gconf_client_get_list ( - client, key, GCONF_VALUE_STRING, NULL); - g_object_unref (client); + settings = g_settings_new ("org.gnome.evolution.calendar"); + strv = g_settings_get_strv (settings, "selected-memos"); + g_object_unref (settings); + + + if (strv != NULL) { + for (i = 0; strv[i] != NULL; i++) + selected_memo_list = g_slist_append (selected_memo_list, g_strdup (strv[i])); + + g_strfreev (strv); + } - return selected_memo_lists; + return selected_memo_list; } void e_memo_shell_backend_set_selected_memo_lists (EMemoShellBackend *memo_shell_backend, GSList *selected_memo_lists) { - GConfClient *client; - const gchar *key; + GSettings *settings; + GSList *l; + GPtrArray *array = g_ptr_array_new (); g_return_if_fail (E_IS_MEMO_SHELL_BACKEND (memo_shell_backend)); - client = gconf_client_get_default (); - key = "/apps/evolution/calendar/memos/selected_memos"; - gconf_client_set_list ( - client, key, GCONF_VALUE_STRING, selected_memo_lists, NULL); - g_object_unref (client); + for (l = selected_memo_list; l != NULL; l = l->next) + g_ptr_array_add (array, l->data); + + settings = g_settings_new ("org.gnome.evolution.calendar"); + g_settings_set_strv (settings, "selected-memos", array->pdata); + g_object_unref (settings); + + g_ptr_array_free (array, FALSE); } |