patches/gnome-system-tools-04-tz.diff
author dc144907
Fri, 04 Aug 2006 09:34:07 +0000
changeset 7859 8517272aace0
parent 7858 patches/gnome-system-tools-01-tz.diff@34090e8daea8
child 8027 db169c287197
permissions -rw-r--r--
Unbump gnome-system-tools back to 2.14.0. Other modules need work before it can be bumped.

--- gnome-system-tools-2.13.2/src/time/tz.c-orig	2006-03-03 16:10:56.472348000 +0000
+++ gnome-system-tools-2.13.2/src/time/tz.c	2006-03-03 16:12:46.542427000 +0000
@@ -90,7 +90,25 @@
 		loc->comment = (tmpstrarr[3]) ? g_strdup(tmpstrarr[3]) : NULL;
 		loc->latitude  = convert_pos (latstr, 2);
 		loc->longitude = convert_pos (lngstr, 3);
-
+		if (tmpstrarr[3] && *tmpstrarr[3] == '-' && tmpstrarr[4])
+			loc->comment = g_strdup(tmpstrarr[4]);
+		else if (tmpstrarr[3] && *tmpstrarr[3] != '-' && !islower(loc->zone)) {
+			TzLocation *locgrp;
+			/* duplicate entry */
+			locgrp = g_new (TzLocation, 1);
+			locgrp->country = g_strdup (tmpstrarr[0]);
+			locgrp->zone = g_strdup (tmpstrarr[3]);
+			locgrp->latitude  = convert_pos (latstr, 2);
+			locgrp->longitude = convert_pos (lngstr, 3);
+			if (tmpstrarr[4]) {
+				loc->comment = g_strdup(tmpstrarr[4]);
+				locgrp->comment = g_strdup(tmpstrarr[4]);
+			} else {
+				loc->comment = locgrp->comment = NULL;
+			}
+			g_ptr_array_add (tz_db->locations, (gpointer) locgrp);
+		} else
+			loc->comment = NULL;
 		g_ptr_array_add (tz_db->locations, (gpointer) loc);
 		
 		g_free (latstr);
@@ -213,6 +231,7 @@
 	curtime = time (NULL);
 	curzone = localtime (&curtime);
 
+#ifndef __sun
 	/* Currently this solution doesnt seem to work - I get that */
 	/* America/Phoenix uses daylight savings, which is wrong    */
 	tzinfo->tzname_normal = g_strdup (curzone->tm_zone);
@@ -223,6 +242,12 @@
 		tzinfo->tzname_daylight = NULL;
 
 	tzinfo->utc_offset = curzone->tm_gmtoff;
+#else
+	tzinfo->tzname_normal = NULL;
+	tzinfo->tzname_daylight = NULL;
+	tzinfo->utc_offset = 0;
+#endif
+
 	tzinfo->daylight = curzone->tm_isdst;
 	
 	return tzinfo;