diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-11-02 23:49:38 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-11-05 02:19:50 +0800 |
commit | 1f17dab6b0d9c5413dea38dcc95e7a7bb5b4bd9b (patch) | |
tree | b8d9f8b56ce226ac15e7cc5efe0e36ad084f41af /plugins/itip-formatter | |
parent | 0ab70ad33c4e22a176e89bb8a935aed8c7848e51 (diff) | |
download | gsoc2013-evolution-1f17dab6b0d9c5413dea38dcc95e7a7bb5b4bd9b.tar.gz gsoc2013-evolution-1f17dab6b0d9c5413dea38dcc95e7a7bb5b4bd9b.tar.zst gsoc2013-evolution-1f17dab6b0d9c5413dea38dcc95e7a7bb5b4bd9b.zip |
Move calendar preferences to the calendar module.
Continue replacing the use of calendar-config functions with GObject
property bindings to EShellSettings properties.
Diffstat (limited to 'plugins/itip-formatter')
-rw-r--r-- | plugins/itip-formatter/itip-formatter.c | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index 3630ec30d0..149d1652c7 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -43,7 +43,6 @@ #include <libedataserver/e-account-list.h> #include <e-util/e-alert-dialog.h> #include <e-util/e-mktemp.h> -#include <calendar/gui/calendar-config.h> #include <calendar/gui/itip-utils.h> #include <calendar/common/authentication.h> #include <shell/e-shell.h> @@ -542,10 +541,15 @@ static ECal * start_calendar_server (struct _itip_puri *pitip, ESource *source, ECalSourceType type, FormatItipOpenFunc func, gpointer data) { ECal *ecal; + EShell *shell; + EShellSettings *shell_settings; icaltimezone *zone = NULL; g_return_val_if_fail (source != NULL, NULL); + shell = e_shell_get_default (); + shell_settings = e_shell_get_shell_settings (shell); + ecal = g_hash_table_lookup (pitip->ecals[type], e_source_peek_uid (source)); if (ecal) { pitip->current_ecal = ecal; @@ -567,7 +571,7 @@ start_calendar_server (struct _itip_puri *pitip, ESource *source, ECalSourceType g_hash_table_insert (pitip->ecals[type], g_strdup (e_source_peek_uid (source)), ecal); - zone = calendar_config_get_icaltimezone (); + zone = e_shell_settings_get_pointer (shell_settings, "cal-timezone"); e_cal_set_default_timezone (ecal, zone, NULL); e_cal_open_async (ecal, TRUE); @@ -1680,6 +1684,8 @@ set_itip_error (struct _itip_puri *pitip, GtkContainer *container, const gchar * static gboolean extract_itip_data (struct _itip_puri *pitip, GtkContainer *container, gboolean *have_alarms) { + EShell *shell; + EShellSettings *shell_settings; icalproperty *prop; icalcomponent_kind kind = ICAL_NO_COMPONENT; icalcomponent *tz_comp; @@ -1687,6 +1693,10 @@ extract_itip_data (struct _itip_puri *pitip, GtkContainer *container, gboolean * icalcomponent *alarm_comp; icalcompiter alarm_iter; ECalComponent *comp; + gboolean use_default_reminder; + + shell = e_shell_get_default (); + shell_settings = e_shell_get_shell_settings (shell); if (!pitip->vcalendar) { set_itip_error (pitip, container, @@ -1886,14 +1896,20 @@ extract_itip_data (struct _itip_puri *pitip, GtkContainer *container, gboolean * }; /* Add default reminder if the config says so */ - if (calendar_config_get_use_default_reminder ()) { + + use_default_reminder = e_shell_settings_get_boolean ( + shell_settings, "cal-use-default-reminder"); + + if (use_default_reminder) { ECalComponentAlarm *acomp; gint interval; EDurationType units; ECalComponentAlarmTrigger trigger; - interval = calendar_config_get_default_reminder_interval (); - units = calendar_config_get_default_reminder_units (); + interval = e_shell_settings_get_int ( + shell_settings, "cal-default-reminder-interval"); + units = e_shell_settings_get_int ( + shell_settings, "cal-default-reminder-units"); acomp = e_cal_component_alarm_new (); @@ -2286,6 +2302,8 @@ in_proper_folder (CamelFolder *folder) static gboolean format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobject) { + EShell *shell; + EShellSettings *shell_settings; struct _itip_puri *info; ECalComponentText text; ECalComponentOrganizer organizer; @@ -2299,6 +2317,9 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject gboolean response_enabled; gboolean have_alarms = FALSE; + shell = e_shell_get_default (); + shell_settings = e_shell_get_shell_settings (shell); + info = (struct _itip_puri *) em_format_find_puri ((EMFormat *)efh, pobject->classid); /* Accounts */ @@ -2498,7 +2519,7 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject g_string_free (gstring, TRUE); } - to_zone = calendar_config_get_icaltimezone (); + to_zone = e_shell_settings_get_pointer (shell_settings, "cal-timezone"); e_cal_component_get_dtstart (info->comp, &datetime); info->start_time = 0; |