aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-09-26 17:20:35 +0800
committerMilan Crha <mcrha@redhat.com>2011-09-26 17:20:35 +0800
commit41a504dcc1760e4f1265ffb4b070b1db2cec2c5f (patch)
tree1bdbcfed877e5a75da5fb618d392e8e96c3c3d1f /modules
parent75968ca03873003346eb5978b5ce971718b3e664 (diff)
downloadgsoc2013-evolution-41a504dcc1760e4f1265ffb4b070b1db2cec2c5f.tar
gsoc2013-evolution-41a504dcc1760e4f1265ffb4b070b1db2cec2c5f.tar.gz
gsoc2013-evolution-41a504dcc1760e4f1265ffb4b070b1db2cec2c5f.tar.bz2
gsoc2013-evolution-41a504dcc1760e4f1265ffb4b070b1db2cec2c5f.tar.lz
gsoc2013-evolution-41a504dcc1760e4f1265ffb4b070b1db2cec2c5f.tar.xz
gsoc2013-evolution-41a504dcc1760e4f1265ffb4b070b1db2cec2c5f.tar.zst
gsoc2013-evolution-41a504dcc1760e4f1265ffb4b070b1db2cec2c5f.zip
Bug #659932 - 'Use system time zone' in not honored immediately
Diffstat (limited to 'modules')
-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);
}