gnome-panel r10997 - trunk/applets/clock



Author: vuntz
Date: Mon Apr  7 21:10:58 2008
New Revision: 10997
URL: http://svn.gnome.org/viewvc/gnome-panel?rev=10997&view=rev

Log:
2008-04-07  Vincent Untz  <vuntz gnome org>

	* clock-location.c: (clock_location_is_current): emit the set-current
	signal when changing the current location
	* clock.c: (run_prefs_edit_save): set the new location as current if it
	makes sense


Modified:
   trunk/applets/clock/ChangeLog
   trunk/applets/clock/clock-location.c
   trunk/applets/clock/clock.c

Modified: trunk/applets/clock/clock-location.c
==============================================================================
--- trunk/applets/clock/clock-location.c	(original)
+++ trunk/applets/clock/clock-location.c	Mon Apr  7 21:10:58 2008
@@ -653,16 +653,20 @@
 gboolean
 clock_location_is_current (ClockLocation *loc)
 {
-
 	if (current_location == loc)
 		return TRUE;
 	else if (current_location != NULL)
 		return FALSE;
 
 	if (clock_location_is_current_timezone (loc)) {
+		/* Note that some code in clock.c depends on the fact that
+		 * calling this function can set the current location if
+		 * there's none */
 		current_location = loc;
 		g_object_add_weak_pointer (G_OBJECT (current_location), 
 					   (gpointer *)&current_location);
+		g_signal_emit (current_location, location_signals[SET_CURRENT],
+			       0, NULL);
 
 		return TRUE;
 	}

Modified: trunk/applets/clock/clock.c
==============================================================================
--- trunk/applets/clock/clock.c	(original)
+++ trunk/applets/clock/clock.c	Mon Apr  7 21:10:58 2008
@@ -3060,6 +3060,10 @@
 		prefs.speed_unit = cd->speed_unit;
 
                 loc = clock_location_new (name, clock_zoneinfo_get_name (info), lat, lon, weather_code, &prefs);
+		/* has the side-effect of setting the current location if
+		 * there's none and this one can be considered as a current one
+		 */
+		clock_location_is_current (loc);
 
                 cd->locations = g_list_append (cd->locations, loc);
                 locations_changed (cd);



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