libmbca r37 - in trunk/src: . gnome-panel



Author: kaijanma
Date: Thu Aug 21 11:54:07 2008
New Revision: 37
URL: http://svn.gnome.org/viewvc/libmbca?rev=37&view=rev

Log:
get the timezone directly

Modified:
   trunk/src/gnome-panel/system-timezone.c
   trunk/src/gnome-panel/system-timezone.h
   trunk/src/provider_thread.c

Modified: trunk/src/gnome-panel/system-timezone.c
==============================================================================
--- trunk/src/gnome-panel/system-timezone.c	(original)
+++ trunk/src/gnome-panel/system-timezone.c	Thu Aug 21 11:54:07 2008
@@ -129,7 +129,7 @@
                                              GFile *other_file,
                                              GFileMonitorEvent event,
                                              gpointer user_data);
-static char *system_timezone_find (void);
+char *system_timezone_find (void);
 
 #define PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SYSTEM_TIMEZONE_TYPE, SystemTimezonePrivate))
 
@@ -843,7 +843,7 @@
         return TRUE;
 }
 
-static char *
+char *
 system_timezone_find (void)
 {
         char *tz;

Modified: trunk/src/gnome-panel/system-timezone.h
==============================================================================
--- trunk/src/gnome-panel/system-timezone.h	(original)
+++ trunk/src/gnome-panel/system-timezone.h	Thu Aug 21 11:54:07 2008
@@ -83,5 +83,13 @@
 gboolean system_timezone_set (const char  *tz,
                               GError     **error);
 
+
+/*******************************/
+/*******************************/
+/* added for libmbca */
+/*********************/
+char* system_timezone_find (void);
+
+
 G_END_DECLS
 #endif /* __SYSTEM_TIMEZONE_H__ */

Modified: trunk/src/provider_thread.c
==============================================================================
--- trunk/src/provider_thread.c	(original)
+++ trunk/src/provider_thread.c	Thu Aug 21 11:54:07 2008
@@ -543,13 +543,11 @@
 mbca_get_system_country (GtkTreeModel* gweather_database, 
 					volatile gboolean* abort)
 {
-	SystemTimezone* tz;
-	const gchar* timezone;
+	gchar* timezone;
 	GtkTreeIter region;
 	const gchar* code = NULL;
-		
-	tz = system_timezone_new ();
-	timezone = system_timezone_get (tz);
+
+	timezone = system_timezone_find ();
 	
 	gtk_tree_model_get_iter_first (gweather_database, &region);
 	do
@@ -571,7 +569,7 @@
 								   abort);
 			if (code)
 			{
-				g_object_unref (tz);
+				g_free (timezone);
 				return code;
 			}
 
@@ -589,7 +587,7 @@
 				 timezone);
 	}
 	
-	g_object_unref (tz);
+	g_free (timezone);
 	return NULL;
 }
 



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