aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-09-26 17:20:35 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-09-26 18:56:07 +0800
commit959921759213d931f0bfd0c29ce8274f3fb88f8a (patch)
tree443488c397d284132eb3cd67743af42c183379b1 /modules/calendar
parent21b8d8f7bbe96d298b0202f0f7250dd100e98222 (diff)
downloadgsoc2013-evolution-959921759213d931f0bfd0c29ce8274f3fb88f8a.tar
gsoc2013-evolution-959921759213d931f0bfd0c29ce8274f3fb88f8a.tar.gz
gsoc2013-evolution-959921759213d931f0bfd0c29ce8274f3fb88f8a.tar.bz2
gsoc2013-evolution-959921759213d931f0bfd0c29ce8274f3fb88f8a.tar.lz
gsoc2013-evolution-959921759213d931f0bfd0c29ce8274f3fb88f8a.tar.xz
gsoc2013-evolution-959921759213d931f0bfd0c29ce8274f3fb88f8a.tar.zst
gsoc2013-evolution-959921759213d931f0bfd0c29ce8274f3fb88f8a.zip
Bug #659932 - 'Use system time zone' in not honored immediately
Diffstat (limited to 'modules/calendar')
-rw-r--r--modules/calendar/e-cal-shell-settings.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/modules/calendar/e-cal-shell-settings.c b/modules/calendar/e-cal-shell-settings.c
index 4d105bcf3d..456f95707c 100644
--- a/modules/calendar/e-cal-shell-settings.c
+++ b/modules/calendar/e-cal-shell-settings.c
@@ -69,19 +69,34 @@ transform_icaltimezone_to_string (GBinding *binding,
GValue *target_value,
gpointer user_data)
{
+ EShellSettings *shell_settings;
+ gboolean use_system_timezone;
const gchar *location = NULL;
+ gchar *location_str = NULL;
icaltimezone *timezone;
- timezone = g_value_get_pointer (source_value);
+ shell_settings = E_SHELL_SETTINGS (user_data);
- if (timezone != NULL)
- location = icaltimezone_get_location (timezone);
+ use_system_timezone = e_shell_settings_get_boolean (
+ shell_settings, "cal-use-system-timezone");
+
+ if (use_system_timezone) {
+ location_str = e_shell_settings_get_string (shell_settings, "cal-timezone-string");
+ location = location_str;
+ } else {
+ timezone = g_value_get_pointer (source_value);
+
+ if (timezone != NULL)
+ location = icaltimezone_get_location (timezone);
+ }
if (location == NULL)
location = "UTC";
g_value_set_string (target_value, location);
+ g_free (location_str);
+
return TRUE;
}
@@ -494,6 +509,12 @@ transform_working_days_saturday_to_bitset (GBinding *binding,
return TRUE;
}
+static void
+cal_use_system_timezone_changed_cb (GObject *shell_settings)
+{
+ g_object_notify (shell_settings, "cal-timezone-string");
+}
+
void
e_cal_shell_backend_init_settings (EShell *shell)
{
@@ -872,4 +893,8 @@ e_cal_shell_backend_init_settings (EShell *shell)
transform_working_days_saturday_to_bitset,
g_object_ref (shell_settings),
(GDestroyNotify) g_object_unref);
+
+ g_signal_connect (
+ shell_settings, "notify::cal-use-system-timezone",
+ G_CALLBACK (cal_use_system_timezone_changed_cb), NULL);
}