Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-applets/gweather/ChangeLog,v
retrieving revision 1.270
diff -u -r1.270 ChangeLog
--- ChangeLog	13 Sep 2004 08:12:26 -0000	1.270
+++ ChangeLog	16 Sep 2004 04:41:32 -0000
@@ -1,3 +1,18 @@
+2004-09-16  Frank Solensky  <frank@solensky.org>
+
+	reviewed by: <delete if not using a buddy>
+
+	* gweather-xml.c: (gweather_xml_parse_name),
+	(gweather_xml_parse_location), (gweather_xml_parse_node),
+	(gweather_xml_parse): Add "city" level to XML hierarchy
+	* weather.c: (weather_location_new),
+	(weather_location_config_read), (weather_location_clone): Add
+	city parameters to weather_location_new
+	* weather.h: changed calling sequences
+	* Locations.xml.in: Add 'city' nodes for Ankorage AK, Albuquerque NM,
+	Atlanta GA, Chicago IL, Baltimore MD, Dallas and Houston TX,
+	Boston MA and New York NY
+
 2004-09-13  Shaun McCance  <shaunm@gnome.org>
 
 	* docs/C/gweather-C.omf:
Index: Locations.xml.in
===================================================================
RCS file: /cvs/gnome/gnome-applets/gweather/Locations.xml.in,v
retrieving revision 1.12
diff -u -r1.12 Locations.xml.in
--- Locations.xml.in	22 Aug 2004 10:19:48 -0000	1.12
+++ Locations.xml.in	16 Sep 2004 04:41:36 -0000
@@ -579,19 +579,28 @@
     <zone>AKZ001</zone>
     <radar>alaska</radar>
    </location>
-   <location>
+   <city>
     <_name>Anchorage</_name>
-    <code>PANC</code>
-    <zone>AKZ015</zone>
-    <radar>alaska</radar>
-   </location>
-   <location>
-    <!-- TRANSLATOR: AFB is short for "Air Force Base" -->
-    <_name>Anchorage - Elmendorf AFB</_name>
-    <code>PAED</code>
     <zone>AKZ015</zone>
     <radar>alaska</radar>
-   </location>
+    <location>
+     <_name>Ted Stevens Anchorage Airport</_name>
+     <code>PANC</code>
+    </location>
+    <location>
+     <!-- TRANSLATOR: AFB is short for "Air Force Base" -->
+     <_name>Elmendorf AFB</_name>
+     <code>PAED</code>
+    </location>
+    <location>
+     <_name>Lake Hood Sea Plane Base</_name>
+     <code>PALH</code>
+    </location>
+    <location>
+     <_name>Merrill Field</_name>
+     <code>PAMR</code>
+    </location>
+   </city>
    <location>
     <_name>Aniak</_name>
     <code>PANI</code>
@@ -840,11 +849,6 @@
     <radar>alaska</radar>
    </location>
    <location>
-    <_name>Lake Hood</_name>
-    <code>PALH</code>
-    <radar>alaska</radar>
-   </location>
-   <location>
     <_name>McCarthy</_name>
     <code>PAMX</code>
     <zone>AKZ017</zone>
@@ -863,11 +867,6 @@
     <radar>alaska</radar>
    </location>
    <location>
-    <_name>Merril Field</_name>
-    <code>PAMR</code>
-    <radar>alaska</radar>
-   </location>
-   <location>
     <_name>Middleton Island</_name>
     <code>PAMD</code>
     <radar>alaska</radar>
@@ -2685,12 +2684,23 @@
     <zone>NMZ024</zone>
     <radar>maf</radar>
    </location>
-   <location>
-    <_name>Albuquerque</_name>
-    <code>KABQ</code>
+   <city>
+    <_name>Albuquerque</_name> 
     <zone>NMZ009</zone>
     <radar>abq</radar>
-   </location>
+    <location>
+     <_name>Albuquerque Airport</_name>
+     <code>KABQ</code>
+    </location>
+    <location>
+     <_name>Double Eagle II Airport</_name>
+     <code>KAEG</code>
+    </location>
+    <location>
+     <_name>Nexrad</_name>
+     <code>KABX</code>     
+    </location>
+   </city>
    <location>
     <_name>Carlsbad</_name>
     <code>KCNM</code>
@@ -5004,12 +5014,27 @@
     <zone>GAZ036</zone>
     <radar>atl</radar>
    </location>
-   <location>
+   <city>
     <_name>Atlanta</_name>
-    <code>KATL</code>
     <zone>GAZ033</zone>
     <radar>atl</radar>
-   </location>
+    <location>
+     <_name>Hartsfield Airport</_name>
+     <code>KATL</code>
+    </location>
+    <location>
+     <_name>De Kalb-Peachtree Airport</_name>
+     <code>KPDK</code>
+    </location>
+    <location>
+     <_name>Falcon Field</_name>
+     <code>KFFC</code>
+    </location>
+    <location>
+     <_name>Fulton County Airport</_name>
+     <code>KFTY</code>
+    </location>
+   </city>
    <location>
     <_name>Augusta</_name>
     <code>KAGS</code>
@@ -5035,11 +5060,6 @@
     <radar>bhm</radar>
    </location>
    <location>
-    <_name>Dekalb/Peachtree</_name>
-    <code>KPDK</code>
-    <radar>atl</radar>
-   </location>
-   <location>
     <_name>Hinesville</_name>
     <code>KLHW</code>
     <radar>tlh</radar>
@@ -5116,12 +5136,6 @@
     <radar>atl</radar>
    </location>
    <location>
-    <_name>West Atlanta</_name>
-    <code>KFTY</code>
-    <zone>GAZ033</zone>
-    <radar>atl</radar>
-   </location>
-   <location>
     <_name>Waycross</_name>
     <code>KAYS</code>
     <zone>GAZ151</zone>
@@ -5251,30 +5265,41 @@
     <zone>ILZ045</zone>
     <radar>ind</radar>
    </location>
-   <location>
-    <_name>Chicago-DuPage</_name>
-    <code>KDPA</code>
+   <city>
+    <_name>Chicago</_name>
     <zone>ILZ014</zone>
     <radar>ord</radar>
-   </location>
-   <location>
-    <_name>Chicago-O'Hare</_name>
-    <code>KORD</code>
-    <zone>ILZ013</zone>
-    <radar>ord</radar>
-   </location>
-   <location>
-    <_name>Chicago-Lakefront</_name>
-    <code>KCGX</code>
-    <zone>ILZ014</zone>
-    <radar>ord</radar>
-   </location>
-   <location>
-    <_name>Chicago-Midway</_name>
-    <code>KMDW</code>
-    <zone>ILZ014</zone>
-    <radar>ord</radar>
-   </location>
+    <location>
+     <_name>Lakefront</_name>
+     <code>KCGX</code>
+    </location>
+    <location>
+     <_name>Lansing</_name>
+     <code>KIGQ</code>
+    </location>
+    <location>
+     <_name>Midway Airport</_name>
+     <code>KMDW</code>
+    </location>
+    <location>
+     <_name>O'Hare Airport</_name>
+     <code>KORD</code>
+     <zone>ILZ013</zone>
+    </location>
+    <location>
+     <_name>Waukegan</_name>
+     <code>KUGN</code>
+    </location>
+    <location>
+     <_name>West Chicago</_name>
+     <code>KDPA</code>
+    </location>
+    <location>
+     <_name>Wheeling</_name>
+     <code>KPWK</code>
+     <zone>ILZ006</zone>
+    </location>
+   </city>
    <location>
     <_name>Danville</_name>
     <code>KDNV</code>
@@ -5359,12 +5384,6 @@
     <zone>ILZ051</zone>
     <radar>stl</radar>
    </location>
-   <location>
-    <_name>Wheeling</_name>
-    <code>KPWK</code>
-    <zone>ILZ006</zone>
-    <radar>ord</radar>
-   </location>
   </state>
   <state>
    <_name>Indiana</_name>
@@ -5453,18 +5472,24 @@
     <zone>MDZ013</zone>
     <radar>dca</radar>
    </location>
-   <location>
+   <city>
     <_name>Baltimore</_name>
-    <code>KMTN</code>
     <zone>MDZ011</zone>
     <radar>dca</radar>
-   </location>
-   <location>
-    <_name>Baltimore-Glen Burnie</_name>
-    <code>KBWI</code>
-    <zone>MDZ014</zone>
-    <radar>dca</radar>
-   </location>
+    <location>
+     <_name>Inner Harbor</_name>
+     <code>KDMH</code>
+    </location>
+    <location>
+     <_name>Martin</_name>
+     <code>KMTN</code>
+    </location>
+    <location>
+     <_name>Glen Burnie</_name>
+     <code>KBWI</code>
+     <zone>MDZ014</zone>
+    </location>
+   </city>
    <location>
     <_name>Cumberland</_name>
     <code>KCBE</code>
@@ -6691,18 +6716,27 @@
     <code>KCXO</code>
     <radar>gls</radar>
    </location>
-   <location>
+   <city>
     <_name>Corpus Christi</_name>
-    <code>KCRP</code>
-    <zone>TXZ243</zone>
-    <radar>bro</radar>
-   </location>
-   <location>
-    <_name>Corpus Christi NAS</_name>
-    <code>KNGP</code>
     <zone>TXZ243</zone>
     <radar>bro</radar>
-   </location>
+    <location>
+     <_name>Airport</_name>
+     <code>KCRP</code>
+    </location>
+    <location>
+     <_name>Cabiness Field</_name>
+     <code>KNGW</code>
+    </location>
+    <location>
+     <_name>Naval Air Station</_name>
+     <code>KNGP</code>
+    </location>
+    <location>
+     <_name>Waldron</_name>
+     <code>KNVT</code>
+    </location>
+   </city>
    <location>
     <_name>Corsicana</_name>
     <code>KCRS</code>
@@ -6721,30 +6755,31 @@
     <zone>TXZ001</zone>
     <radar>ama</radar>
    </location>
-   <location>
-    <_name>Dallas-Addison</_name>
-    <code>KADS</code>
-    <zone>TXZ119</zone>
-    <radar>dfw</radar>
-   </location>
-   <location>
-    <_name>Dallas-Fort Worth</_name>
-    <code>KDFW</code>
+   <city>
+    <_name>Dallas</_name>
     <zone>TXZ119</zone>
     <radar>dfw</radar>
-   </location>
-   <location>
-    <_name>Dallas-Love Field</_name>
-    <code>KDAL</code>
-    <zone>TXZ119</zone>
-    <radar>dfw</radar>
-   </location>
-   <location>
-    <_name>Dallas-Redbird</_name>
-    <code>KRBD</code>
-    <zone>TXZ119</zone>
-    <radar>dfw</radar>
-   </location>
+    <location>
+     <_name>Addison</_name>
+     <code>KADS</code>
+    </location>
+    <location>
+     <_name>Dallas-Fort Worth</_name>
+     <code>KDFW</code>
+    </location>
+    <location>
+     <_name>Love Field</_name>
+     <code>KDAL</code>
+    </location>
+    <location>
+     <_name>NAS</_name>
+     <code>KNBE</code>
+    </location>
+    <location>
+     <_name>Redbird</_name>
+     <code>KRBD</code>
+    </location>
+   </city>
    <location>
     <_name>Del Rio</_name>
     <code>KDRT</code>
@@ -6821,36 +6856,43 @@
     <zone>TXZ204</zone>
     <radar>sat</radar>
    </location>
-   <location>
-    <_name>Houston-Bush</_name>
-    <code>KIAH</code>
-    <zone>TXZ213</zone>
-    <radar>gls</radar>
-   </location>
-   <location>
-    <_name>Houston-Hooks</_name>
-    <code>KDWH</code>
-    <zone>TXZ213</zone>
-    <radar>gls</radar>
-   </location>
-   <location>
-    <_name>Houston-Ellington Field</_name>
-    <code>KEFD</code>
-    <zone>TXZ213</zone>
-    <radar>gls</radar>
-   </location>
-   <location>
-    <_name>Houston-Clover</_name>
-    <code>KT02</code>
+   <city>
+    <_name>Houston</_name>
     <zone>TXZ213</zone>
     <radar>gls</radar>
-   </location>
-   <location>
-    <_name>Houston-Hobby</_name>
-    <code>KHOU</code>
-    <zone>TXZ213</zone>
-    <radar>gls</radar>
-   </location>
+    <location>
+     <_name>Clover</_name>
+     <code>KT02</code>
+    </location>
+    <location>
+     <_name>Ellington Field</_name>
+     <code>KEFD</code>
+    </location>
+    <location>
+     <_name>Galviston Nexrad</_name>
+     <code>KHGX</code>
+    </location>
+    <location>
+     <_name>Hooks Airport</_name>
+     <code>KDWH</code>
+    </location>
+    <location>
+     <_name>Hobby Airport</_name>
+     <code>KHOU</code>
+    </location>
+    <location>
+     <_name>Houston Intercontinental Airport</_name>
+     <code>KIAH</code>
+    </location>
+    <location>
+     <_name>Perland</_name>
+     <code>KLVJ</code>
+    </location>
+    <location>
+     <_name>Sugar Land</_name>
+     <code>KSGR</code>
+    </location>
+   </city>
    <location>
     <_name>Huntsville</_name>
     <code>KUTS</code>
@@ -7541,12 +7583,23 @@
     <zone>MAZ007</zone>
     <radar>bos</radar>
    </location>
-   <location>
+   <city>
     <_name>Boston</_name>
-    <code>KBOS</code>
     <zone>MAZ015</zone>
     <radar>bos</radar>
-   </location>
+    <location>
+     <_name>Hull Coast Guard Light Station</_name>
+     <code>K29B</code>
+    </location>
+    <location>
+     <_name>Logan Airport</_name>
+     <code>KBOS</code>
+    </location>
+    <location>
+     <_name>Nexrad</_name>
+     <code>KBOX</code>
+    </location>
+   </city>
    <location>
     <_name>Chatham</_name>
     <code>KCQX</code>
@@ -7730,18 +7783,23 @@
     <zone>NYZ062</zone>
     <radar>har</radar>
    </location>
-   <location>
-    <_name>New York-JFK Arpt</_name>
-    <code>KJFK</code>
+   <city>
+    <_name>New York</_name>
     <zone>NYZ076</zone>
     <radar>nyc</radar>
-   </location>
-   <location>
-    <_name>New York-La Guardia</_name>
-    <code>KLGA</code>
-    <zone>NYZ076</zone>
-    <radar>nyc</radar>
-   </location>
+    <location>
+     <_name>Central Park</_name>
+     <code>KNYC</code>
+    </location>
+    <location>
+     <_name>Kennedy Airport</_name>
+     <code>KJFK</code>
+    </location>
+    <location>
+     <_name>La Guardia Airport</_name>
+     <code>KLGA</code>
+    </location>
+   </city>
    <location>
     <_name>Newburgh</_name>
     <code>KSWF</code>
Index: gweather-xml.c
===================================================================
RCS file: /cvs/gnome/gnome-applets/gweather/gweather-xml.c,v
retrieving revision 1.1
diff -u -r1.1 gweather-xml.c
--- gweather-xml.c	20 Jun 2004 20:56:14 -0000	1.1
+++ gweather-xml.c	16 Sep 2004 04:41:36 -0000
@@ -19,8 +19,10 @@
 
 
 /* There is very little error checking in the parsing code below, it relies 
- * heavily on the locations file being in the correct format.  The format is
- * as follows: 
+ * heavily on the locations file being in the correct format.
+ * It also does not enforce a limit on the frequency or ordering of
+ * the elements within a particular element.
+ * The format is as follows: 
  * 
  * <gweather format="1.0">
  * <region>
@@ -37,6 +39,14 @@
  *     <location>
  *       ....
  *     </location>
+ *     <city>
+ *      <name>Name of city with multiple locations</city>
+ *      <zone>Forecast code</zone>
+ *      <radar>Radar Map code</radar>
+ *      <location>
+ *        ...
+ *      </location>
+ *     </city>
  *   </state>
  *  </country>
  * </region>
@@ -71,13 +81,13 @@
 #define GWEATHER_XML_NODE_REGION     "region"
 #define GWEATHER_XML_NODE_COUNTRY    "country"
 #define GWEATHER_XML_NODE_STATE      "state"
+#define GWEATHER_XML_NODE_CITY       "city"
 #define GWEATHER_XML_NODE_LOC        "location"
 #define GWEATHER_XML_NODE_NAME       "name"
 #define GWEATHER_XML_NODE_CODE       "code"
 #define GWEATHER_XML_NODE_ZONE       "zone"
 #define GWEATHER_XML_NODE_RADAR      "radar"
 
-
 /* XML Attributes */
 #define GWEATHER_XML_ATTR_FORMAT    "format"
 
@@ -158,11 +168,15 @@
  *      *loc:           currently selected location
  *      reader:         xml text reader
  *      *iter:          iterator to named node
+ *      *untrans_city   untranslated city name or NULL
+ *      *trans_city     translated city name
  *      **untrans_name: returns untranslated name
  *      **trans_name:   returns translated name
  *      *pref:          the preference of the current translation, the smaller the better 
  */
-static void gweather_xml_parse_name (const GList *locale, GtkTreeStore *tree, GtkTreeIter* iter, xmlTextReaderPtr reader, xmlChar **untrans_name, xmlChar **trans_name, gint *pref)
+static void gweather_xml_parse_name (const GList *locale, GtkTreeStore *tree, xmlTextReaderPtr reader, GtkTreeIter* iter,
+				     xmlChar **untrans_name, xmlChar **trans_name,
+				     xmlChar *untransCity, xmlChar *transCity, gint *pref)
 {
     int ret, type;
     xmlChar *lang;
@@ -182,7 +196,7 @@
         if ( lang == NULL ) {
             *untrans_name = xmlTextReaderValue (reader);
             /* set the column entry, incase there is no translation */
-            gtk_tree_store_set (tree, iter, GWEATHER_PREF_COL_LOC, *untrans_name, -1);
+	    gtk_tree_store_set (tree, iter, GWEATHER_PREF_COL_LOC, *untrans_name, -1);
         } else {
             found_locale = g_list_find_custom((GList*)locale, lang, gweather_xml_compare_locale);
             if (found_locale) {
@@ -216,10 +230,14 @@
  *      *loc:           currently selected location
  *      reader:         xml text reader
  *      *iter:          Changed to iterator for this node
- *      *p_iter:        parent node's iterator 
- *      *s_iter:        sibling node's iterator (who this node appears after)
+ *      *r_iter:        parent node's iterator 
+ *      *c_iter:        sibling node's iterator (who this node appears after)
+ *      *dfltZone       default forecast zone for the enclosing element
+ *      *dfltRadar      default radar map code
  */
-static void gweather_xml_parse_location (const GList* locale, GtkTreeView *tree, WeatherLocation *loc, xmlTextReaderPtr reader, GtkTreeIter* iter, GtkTreeIter* r_iter, GtkTreeIter* c_iter)
+static void gweather_xml_parse_location (const GList* locale, GtkTreeView *tree, WeatherLocation *loc, xmlTextReaderPtr reader,
+					 GtkTreeIter* iter, GtkTreeIter* r_iter, GtkTreeIter* c_iter,
+					 xmlChar *dfltZone, xmlChar *dfltRadar, xmlChar *untransCity, xmlChar *transCity)
 {
     int ret, type;
     xmlChar *name, *untrans_name, *trans_name, *code, *zone, *radar;
@@ -237,17 +255,16 @@
     untrans_name = NULL; 
     trans_name = NULL;
     code = NULL;
-    zone = NULL;
-    radar = NULL;
+    zone = dfltZone;
+    radar = dfltRadar;
     pref = -1;
 
     /* create a node in the tree for this region */
     gtk_tree_store_insert_after(store, iter, r_iter, c_iter);
 
     /* Loop through any sub elements (ie until we get to a close for this element */
-    ret = xmlTextReaderRead(reader);
     type = XML_READER_TYPE_ELEMENT;
-    while ( (ret == 1) && (type != XML_READER_TYPE_END_ELEMENT) ) {
+    while ( (xmlTextReaderRead(reader) == 1) && (type != XML_READER_TYPE_END_ELEMENT) ) {
                
         type = xmlTextReaderNodeType (reader);
         
@@ -256,32 +273,34 @@
             name = xmlTextReaderName (reader);
             
             if ( strcmp (name, GWEATHER_XML_NODE_NAME) == 0 ) {
-                gweather_xml_parse_name (locale, store, iter, reader, &untrans_name, &trans_name, &pref);
+                gweather_xml_parse_name (locale, store, reader, iter,
+					 &untrans_name, &trans_name, untransCity, transCity, &pref);
             } else if ( strcmp (name, GWEATHER_XML_NODE_CODE) == 0 ) {
                 code = gweather_xml_get_value (reader);
             } else if ( strcmp (name, GWEATHER_XML_NODE_ZONE) == 0 ) {
                 zone = gweather_xml_get_value (reader);
             } else if ( strcmp (name, GWEATHER_XML_NODE_RADAR) == 0 ) {
                 radar = gweather_xml_get_value (reader);
-            }
+	    } else {
+	        xmlFree (gweather_xml_get_value (reader) );
+	    }
             
             xmlFree (name);
         }
-        
-        ret = xmlTextReaderRead(reader);
-
     }
     
     /* Add an entry in the tree for the location */
-    new_loc = weather_location_new(untrans_name, trans_name, code, zone, radar);
+    new_loc = weather_location_new(untrans_name, trans_name, untransCity, transCity, code, zone, radar);
     gtk_tree_store_set (store, iter, GWEATHER_PREF_COL_POINTER, new_loc, -1);
 
     /* Free xml attributes */
     xmlFree(untrans_name);
     xmlFree(trans_name);
     xmlFree(code);
-    xmlFree(zone);
-    xmlFree(radar);
+    if (zone != dfltZone)
+        xmlFree(zone);
+    if (radar != dfltRadar)
+        xmlFree(radar);
 
     /* If this location is actually the currently selected one, select it */
     if ( loc && weather_location_equal (new_loc, loc) ) {
@@ -296,9 +315,10 @@
     }
 }
 
+
 /*****************************************************************************
  * Func:    gweather_xml_parse_node()
- * Desc:    Parse a region/country/state node, creating a leaf for it in the tree
+ * Desc:    Parse a region/country/state/city node, creating a leaf for it in the tree
  *          then parsing any sub-nodes.
  *          This is called recursively as each node parses it's sub-nodes
  * Parm:
@@ -309,16 +329,21 @@
  *      *iter:          Changed to iterator for this node
  *      *p_iter:        iterator to parent node
  *      *s_iter:        iterator to last sibling node
+ *      *dfltZone       default forecast zone for the enclosing element
+ *      *dfltRadar      default radar map code
  */
-static void gweather_xml_parse_node (const GList *locale, GtkTreeView *tree, WeatherLocation *loc, xmlTextReaderPtr reader, GtkTreeIter* iter, GtkTreeIter* p_iter, GtkTreeIter* s_iter)
+static void gweather_xml_parse_node (const GList *locale, GtkTreeView *tree, WeatherLocation *loc,
+				     xmlTextReaderPtr reader, GtkTreeIter* iter, GtkTreeIter* p_iter, GtkTreeIter* s_iter,
+				     xmlChar *defZone, xmlChar *defRadar, xmlChar *untransCity, xmlChar *transCity)
 {
-    int ret, type;
+    int type;
     xmlChar *name, *untrans_name, *trans_name;
     GtkTreeStore *model;
     GtkTreeIter last_child;
-    gboolean first;
+    gboolean first, isCity;
     gint pref;
-
+    xmlChar *zone, *radar;
+    
     /* check for an empty element */
     if ( xmlTextReaderIsEmptyElement (reader) ) {
         return;
@@ -328,44 +353,60 @@
     model = GTK_TREE_STORE (gtk_tree_view_get_model (tree));
     first = TRUE;
     pref = -1;
+    untrans_name = NULL;
+    trans_name = NULL;
+    zone = defZone;
+    radar = defRadar;
     
     /* create a node in the tree for this region */
     gtk_tree_store_insert_after(model, iter, p_iter, s_iter);
-    
-    ret = xmlTextReaderRead(reader);
+
     type = XML_READER_TYPE_ELEMENT;
-    while ( (ret == 1) && (type != XML_READER_TYPE_END_ELEMENT) ) {
+    while ( xmlTextReaderRead(reader) == 1 && (type != XML_READER_TYPE_END_ELEMENT) ) {
 
         type = xmlTextReaderNodeType (reader);
 
         /* skip non-element types */
         if ( type == XML_READER_TYPE_ELEMENT ) {
             name = xmlTextReaderName (reader);
-            if ( strcmp (name, GWEATHER_XML_NODE_NAME) == 0 ) {
-                gweather_xml_parse_name (locale, model, iter, reader, &untrans_name, &trans_name, &pref);
-            } else if ( strcmp (name, GWEATHER_XML_NODE_COUNTRY) == 0 || 
-                        strcmp (name, GWEATHER_XML_NODE_STATE)   == 0 ) {
-                if (first) {
-                    gweather_xml_parse_node (locale, tree, loc, reader, &last_child, iter , NULL);
-                    first = FALSE;
-                } else {
-                    gweather_xml_parse_node (locale, tree, loc, reader, &last_child, iter, &last_child);
-                }
-                
+	    if ( first ) {
+	      
+	        if ( strcmp (name, GWEATHER_XML_NODE_NAME) == 0 ) {
+	            gweather_xml_parse_name (locale, model, reader, iter,
+					     &untrans_name, &trans_name, untransCity, transCity, &pref);
+	        } else if (zone == defZone && strcmp (name, GWEATHER_XML_NODE_ZONE) == 0) {
+	            zone = gweather_xml_get_value (reader);
+	        } else if (radar == defRadar && strcmp (name, GWEATHER_XML_NODE_RADAR) == 0 ) {
+		    radar = gweather_xml_get_value (reader);
+		}
+		
+            }
+	    if ( (isCity = strcmp (name, GWEATHER_XML_NODE_CITY) == 0) ||
+		 strcmp (name, GWEATHER_XML_NODE_COUNTRY) == 0 || 
+		 strcmp (name, GWEATHER_XML_NODE_STATE)   == 0)  {
+
+		gweather_xml_parse_node (locale, tree, loc, reader, &last_child, iter,
+					 (first ? NULL : &last_child),
+					 zone, radar,
+					 (isCity ? untrans_name : untransCity),
+					 (isCity ? trans_name   : transCity));
+		first = FALSE;
+
             } else if ( strcmp (name, GWEATHER_XML_NODE_LOC) == 0 ) {
-                if (first) {
-                    gweather_xml_parse_location (locale, tree, loc, reader, &last_child, iter, NULL);
-                    first = FALSE;
-                } else {
-                    gweather_xml_parse_location (locale, tree, loc, reader, &last_child, iter, &last_child);
-                }
+	        gweather_xml_parse_location (locale, tree, loc, reader, &last_child, iter,
+					     (first ? NULL : &last_child), zone, radar,
+					     untrans_name, trans_name);
+		first = FALSE;
             }
             
             xmlFree (name);
         }
-        
-        ret = xmlTextReaderRead (reader);
-    }    
+    }
+
+    if (zone != defZone)
+        xmlFree (zone);
+    if (radar != defRadar)
+        xmlFree (radar);
 }
 
 /*****************************************************************************
@@ -393,13 +434,9 @@
         if (type == XML_READER_TYPE_ELEMENT) {
             name = xmlTextReaderName (reader);
             if ( strcmp(name, GWEATHER_XML_NODE_REGION) == 0 ) {
-                if (first) {
-                    gweather_xml_parse_node (locale, tree, loc, reader, &iter, NULL, NULL);
-                    first = FALSE;
-                }
-                else {
-                    gweather_xml_parse_node (locale, tree, loc, reader, &iter, NULL, &iter);
-                }
+	        gweather_xml_parse_node (locale, tree, loc, reader, &iter, NULL,
+					 (first ? &iter : NULL), NULL, NULL, NULL, NULL);
+		first = FALSE;
             }
             xmlFree (name);
         }
Index: weather.c
===================================================================
RCS file: /cvs/gnome/gnome-applets/gweather/weather.c,v
retrieving revision 1.93
diff -u -r1.93 weather.c
--- weather.c	24 Aug 2004 03:32:21 -0000	1.93
+++ weather.c	16 Sep 2004 04:41:36 -0000
@@ -67,21 +67,30 @@
 #define VISIBILITY_SM_TO_M(sm)   (VISIBILITY_SM_TO_KM(sm) * 1000)
 
 
-WeatherLocation *weather_location_new (const gchar *untrans_name, const gchar *trans_name, const gchar *code, const gchar *zone, const gchar *radar)
+WeatherLocation *weather_location_new (const gchar *untrans_name, const gchar *trans_name,
+				       const gchar *untransCity, const gchar *transCity,
+				       const gchar *code, const gchar *zone, const gchar *radar)
 {
     WeatherLocation *location;
 
     location = g_new(WeatherLocation, 1);
   
     /* untransalted name and metar code must be set */
-    location->untrans_name = g_strdup(untrans_name);
+    if (untransCity) {
+        /* TRANSLATOR: This is 'city' / 'location' */
+        location->untrans_name = g_strdup_printf(_("%s / %s"), untransCity, untrans_name);
+    } else {
+        location->untrans_name = g_strdup(untrans_name);
+    }
     location->code = g_strdup(code);
 
     /* if there is no translated name, then use the untranslated version */
-    if (trans_name) {
-        location->trans_name = g_strdup(trans_name);    
+    if (trans_name && transCity) {
+        location->trans_name = g_strdup_printf(_("%s / %s"), transCity, trans_name);
+    } else if (trans_name) {
+        location->trans_name = g_strdup(trans_name);
     } else {
-        location->trans_name = g_strdup(untrans_name);
+        location->trans_name = g_strdup(location->untrans_name);
     }
     
     if (zone) {    
@@ -178,7 +187,7 @@
         radar = g_strdup ("pit");
     }
 
-    location = weather_location_new(untrans_name, trans_name, code, zone, radar);
+    location = weather_location_new(untrans_name, trans_name, NULL, NULL, code, zone, radar);
     g_free (untrans_name);
     g_free (trans_name);
     g_free (code);
@@ -192,8 +201,8 @@
 {
     WeatherLocation *clone;
 
-    clone = weather_location_new (location->untrans_name, location->trans_name, 
-                                                   location->code, location->zone, location->radar);
+    clone = weather_location_new (location->untrans_name, location->trans_name, NULL, NULL,
+				  location->code, location->zone, location->radar);
     return clone;
 }
 
Index: weather.h
===================================================================
RCS file: /cvs/gnome/gnome-applets/gweather/weather.h,v
retrieving revision 1.25
diff -u -r1.25 weather.h
--- weather.h	26 Jun 2004 12:18:43 -0000	1.25
+++ weather.h	16 Sep 2004 04:41:36 -0000
@@ -38,7 +38,9 @@
 
 
 
-extern WeatherLocation *weather_location_new (const gchar *untrans_name, const gchar *trans_name, const gchar *code, const gchar *zone, const gchar *radar);
+extern WeatherLocation *weather_location_new (const gchar *untrans_name, const gchar *trans_name,
+					      const gchar *untransCity, const gchar *transCity,
+					      const gchar *code, const gchar *zone, const gchar *radar);
 extern WeatherLocation *weather_location_clone (const WeatherLocation *location);
 extern void weather_location_free (WeatherLocation *location);
 extern gboolean weather_location_equal (const WeatherLocation *location1, const WeatherLocation *location2);
