diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-03-03 23:20:09 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-03-17 20:49:12 +0800 |
commit | 95a0ae4afb72b534c991fbcd774733a93f256514 (patch) | |
tree | 32293990fecd6a4a6401370e2a5aa355c6454022 /calendar | |
parent | 23b89997658a8eb8bd2e1d9d20234a6978880aae (diff) | |
download | gsoc2013-evolution-95a0ae4afb72b534c991fbcd774733a93f256514.tar.gz gsoc2013-evolution-95a0ae4afb72b534c991fbcd774733a93f256514.tar.zst gsoc2013-evolution-95a0ae4afb72b534c991fbcd774733a93f256514.zip |
Remove ECalShellSettings.
EShellSettings predates GSettings and is no longer necessary.
GSettings allows binding GObject properties to GSettings keys,
with optional mapping functions. That fulfills the purpose of
EShellSettings.
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/gui/calendar-config.c | 24 | ||||
-rw-r--r-- | calendar/gui/itip-utils.c | 11 | ||||
-rw-r--r-- | calendar/gui/print.c | 15 | ||||
-rw-r--r-- | calendar/gui/tag-calendar.c | 30 | ||||
-rw-r--r-- | calendar/importers/icalendar-importer.c | 15 |
5 files changed, 46 insertions, 49 deletions
diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c index d5f0691f60..04ca534ca4 100644 --- a/calendar/gui/calendar-config.c +++ b/calendar/gui/calendar-config.c @@ -100,15 +100,15 @@ calendar_config_get_timezone_stored (void) static gchar * calendar_config_get_timezone (void) { - EShell *shell; - EShellSettings *shell_settings; + GSettings *settings; gboolean use_system_timezone; - shell = e_shell_get_default (); - shell_settings = e_shell_get_shell_settings (shell); + settings = g_settings_new ("org.gnome.evolution.calendar"); - use_system_timezone = e_shell_settings_get_boolean ( - shell_settings, "cal-use-system-timezone"); + use_system_timezone = + g_settings_get_boolean (settings, "use-system-timezone"); + + g_object_unref (settings); if (use_system_timezone) return e_cal_util_get_system_timezone_location (); @@ -442,19 +442,17 @@ calendar_config_add_notification_day_second_zone (CalendarConfigChangedFunc func gboolean calendar_config_get_prefer_meeting (void) { - EShell *shell; - EShellSettings *shell_settings; + GSettings *settings; gchar *prefer_new_item; gboolean prefer_meeting; - shell = e_shell_get_default (); - shell_settings = e_shell_get_shell_settings (shell); + settings = g_settings_new ("org.gnome.evolution.calendar"); - prefer_new_item = e_shell_settings_get_string ( - shell_settings, "cal-prefer-new-item"); + prefer_new_item = g_settings_get_string (settings, "prefer-new-item"); prefer_meeting = g_strcmp0 (prefer_new_item, "event-meeting-new") == 0; - g_free (prefer_new_item); + g_object_unref (settings); + return prefer_meeting; } diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index ad5c83cf28..82dc88a37f 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -1653,7 +1653,7 @@ itip_send_comp (ESourceRegistry *registry, gboolean only_new_attendees) { EShell *shell; - EShellSettings *shell_settings; + GSettings *settings; EMsgComposer *composer; EComposerHeaderTable *table; EDestination **destinations; @@ -1670,10 +1670,13 @@ itip_send_comp (ESourceRegistry *registry, /* FIXME Pass this in. */ shell = e_shell_get_default (); - shell_settings = e_shell_get_shell_settings (shell); - use_24_hour_format = e_shell_settings_get_boolean ( - shell_settings, "cal-use-24-hour-format"); + settings = g_settings_new ("org.gnome.evolution.calendar"); + + use_24_hour_format = + g_settings_get_boolean (settings, "use-24hour-format"); + + g_object_unref (settings); default_zone = e_cal_client_get_default_timezone (cal_client); diff --git a/calendar/gui/print.c b/calendar/gui/print.c index 7b9df1578d..9ae8fbf503 100644 --- a/calendar/gui/print.c +++ b/calendar/gui/print.c @@ -637,14 +637,17 @@ titled_box (GtkPrintContext *context, static gboolean get_show_week_numbers (void) { - EShell *shell; - EShellSettings *shell_settings; + GSettings *settings; + gboolean show_week_numbers; + + settings = g_settings_new ("org.gnome.evolution.calendar"); - shell = e_shell_get_default (); - shell_settings = e_shell_get_shell_settings (shell); + show_week_numbers = + g_settings_get_boolean (settings, "show-week-numbers"); + + g_object_unref (settings); - return e_shell_settings_get_boolean ( - shell_settings, "cal-show-week-numbers"); + return show_week_numbers; } enum datefmt { diff --git a/calendar/gui/tag-calendar.c b/calendar/gui/tag-calendar.c index 06e2bb006f..93b6e63597 100644 --- a/calendar/gui/tag-calendar.c +++ b/calendar/gui/tag-calendar.c @@ -29,7 +29,6 @@ #endif #include "shell/e-shell.h" -#include "shell/e-shell-settings.h" #include "calendar-config.h" #include "tag-calendar.h" @@ -129,19 +128,6 @@ tag_calendar_cb (ECalComponent *comp, return TRUE; } -static gboolean -get_recur_events_italic (void) -{ - EShell *shell; - EShellSettings *shell_settings; - - shell = e_shell_get_default (); - shell_settings = e_shell_get_shell_settings (shell); - - return e_shell_settings_get_boolean ( - shell_settings, "cal-recur-events-italic"); -} - /** * tag_calendar_by_client: * @ecal: Calendar widget to tag. @@ -156,6 +142,7 @@ tag_calendar_by_client (ECalendar *ecal, ECalClient *client, GCancellable *cancellable) { + GSettings *settings; struct calendar_tag_closure *closure; g_return_if_fail (E_IS_CALENDAR (ecal)); @@ -172,8 +159,13 @@ tag_calendar_by_client (ECalendar *ecal, return; } + settings = g_settings_new ("org.gnome.evolution.calendar"); + closure->skip_transparent_events = TRUE; - closure->recur_events_italic = get_recur_events_italic (); + closure->recur_events_italic = + g_settings_get_boolean (settings, "recur-events-italic"); + + g_object_unref (settings); e_cal_client_generate_instances ( client, closure->start_time, closure->end_time, cancellable, @@ -235,6 +227,7 @@ tag_calendar_by_comp (ECalendar *ecal, gboolean can_recur_events_italic, GCancellable *cancellable) { + GSettings *settings; struct calendar_tag_closure closure; g_return_if_fail (E_IS_CALENDAR (ecal)); @@ -247,9 +240,14 @@ tag_calendar_by_comp (ECalendar *ecal, if (!prepare_tag (ecal, &closure, display_zone, clear_first)) return; + settings = g_settings_new ("org.gnome.evolution.calendar"); + closure.skip_transparent_events = FALSE; closure.recur_events_italic = - can_recur_events_italic && get_recur_events_italic (); + can_recur_events_italic && + g_settings_get_boolean (settings, "recur-events-italic"); + + g_object_unref (settings); if (comp_is_on_server) { struct calendar_tag_closure *alloced_closure; diff --git a/calendar/importers/icalendar-importer.c b/calendar/importers/icalendar-importer.c index 4d8657df5b..3cda9da6ac 100644 --- a/calendar/importers/icalendar-importer.c +++ b/calendar/importers/icalendar-importer.c @@ -1407,25 +1407,20 @@ static icaltimezone * get_users_timezone (void) { /* more or less copy&paste of calendar_config_get_icaltimezone */ - EShell *shell; - EShellSettings *shell_settings; + GSettings *settings; icaltimezone *zone = NULL; gchar *location; - /* FIXME Pass this in. */ - shell = e_shell_get_default (); - shell_settings = e_shell_get_shell_settings (shell); + settings = g_settings_new ("org.gnome.evolution.calendar"); - if (e_shell_settings_get_boolean (shell_settings, "cal-use-system-timezone")) { + if (g_settings_get_boolean (settings, "use-system-timezone")) { location = e_cal_util_get_system_timezone_location (); } else { - GSettings *settings = g_settings_new ("org.gnome.evolution.calendar"); - location = g_settings_get_string (settings, "timezone"); - - g_object_unref (settings); } + g_object_unref (settings); + if (location) { zone = icaltimezone_get_builtin_timezone (location); |