[jana] jana-ecal-utils: If the "system time" gconf key don't use location one



commit acd72f232c72f8692dcacdd885eea756778042c2
Author: Rob Bradford <rob linux intel com>
Date:   Thu May 20 12:46:47 2010 +0100

    jana-ecal-utils: If the "system time" gconf key don't use location one
    
    We only want to use the location gconf key if the use system timezone key is
    set to false.

 libjana-ecal/jana-ecal-utils.c |   14 +++++++++-----
 libjana-ecal/jana-ecal-utils.h |    8 ++++++++
 2 files changed, 17 insertions(+), 5 deletions(-)
---
diff --git a/libjana-ecal/jana-ecal-utils.c b/libjana-ecal/jana-ecal-utils.c
index 101dad4..4035ff9 100644
--- a/libjana-ecal/jana-ecal-utils.c
+++ b/libjana-ecal/jana-ecal-utils.c
@@ -121,11 +121,15 @@ jana_ecal_utils_guess_location ()
 	time_t now_t = time (NULL);
 	struct tm *now = localtime (&now_t);
 
-	/* Check the Evolution timezone key first */
-	tzname = gconf_client_get_string (gconf_client_get_default (),
-		JANA_ECAL_LOCATION_KEY, NULL);
-	if (tzname && icaltimezone_get_builtin_timezone (tzname)) return tzname;
-	g_free (tzname);
+	if (!gconf_client_get_bool (gconf_client_get_default (),
+		JANA_ECAL_SYSTEM_TIMEZONE_KEY, NULL))
+	{
+		/* Check the Evolution timezone key first */
+		tzname = gconf_client_get_string (gconf_client_get_default (),
+			JANA_ECAL_LOCATION_KEY, NULL);
+		if (tzname && icaltimezone_get_builtin_timezone (tzname)) return tzname;
+		g_free (tzname);
+	}
 	
 	/* Debian systems have /etc/timezone */
 	if ((file = fopen ("/etc/timezone", "r"))) {
diff --git a/libjana-ecal/jana-ecal-utils.h b/libjana-ecal/jana-ecal-utils.h
index 528163d..a65f07e 100644
--- a/libjana-ecal/jana-ecal-utils.h
+++ b/libjana-ecal/jana-ecal-utils.h
@@ -36,6 +36,14 @@
 #define JANA_ECAL_LOCATION_KEY "/apps/evolution/calendar/display/timezone"
 
 /**
+ * JANA_ECAL_LOCATION_KEY:
+ *
+ * The GConf key used to determine whether to use the system timezone or to
+ * use the #JANA_ECAL_LOCATION_KEY.
+ */
+#define JANA_ECAL_SYSTEM_TIMEZONE_KEY "/apps/evolution/calendar/display/use_system_timezone"
+
+/**
  * JANA_ECAL_LOCATION_KEY_DIR:
  * @see_also: #JANA_ECAL_LOCATION_KEY
  *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]