gnome-panel r10786 - in trunk: . applets/clock
- From: vuntz svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-panel r10786 - in trunk: . applets/clock
- Date: Sat, 9 Feb 2008 13:47:01 +0000 (GMT)
Author: vuntz
Date: Sat Feb 9 13:47:01 2008
New Revision: 10786
URL: http://svn.gnome.org/viewvc/gnome-panel?rev=10786&view=rev
Log:
2008-02-09 Vincent Untz <vuntz gnome org>
* configure.in: require gio for the clock
2008-02-09 Vincent Untz <vuntz gnome org>
Port to gio.
Based on patch by Diego Escalante Urrelo <diegoe gnome org>
Fix part of bug #509756.
* clock-location.c: (monitor_etc_sysconfig_clock): updated for
GFileMonitor changed signal
(zone_from_etc_sysconfig_clock): use GFileMonitor
(clock_location_finalize): free the monitor
Modified:
trunk/ChangeLog
trunk/applets/clock/ChangeLog
trunk/applets/clock/clock-location.c
trunk/configure.in
Modified: trunk/applets/clock/clock-location.c
==============================================================================
--- trunk/applets/clock/clock-location.c (original)
+++ trunk/applets/clock/clock-location.c Sat Feb 9 13:47:01 2008
@@ -14,8 +14,8 @@
#include <math.h>
#include <glib.h>
+#include <gio/gio.h>
#include <libgnome/gnome-i18n.h>
-#include <libgnomevfs/gnome-vfs.h>
#ifdef HAVE_NETWORK_MANAGER
#include <dbus/dbus-glib.h>
@@ -232,7 +232,7 @@
}
static gchar *current_zone = NULL;
-static GnomeVFSMonitorHandle *monitor = NULL;
+static GFileMonitor *monitor = NULL;
static void
parse_etc_sysconfig_clock (void)
@@ -281,10 +281,10 @@
}
static void
-monitor_etc_sysconfig_clock (GnomeVFSMonitorHandle *handle,
- const gchar *monitor_uri,
- const gchar *info_uri,
- GnomeVFSMonitorEventType event_type,
+monitor_etc_sysconfig_clock (GFileMonitor *handle,
+ GFile *file,
+ GFile *other_file,
+ GFileMonitorEvent event,
gpointer user_data)
{
parse_etc_sysconfig_clock ();
@@ -294,13 +294,21 @@
zone_from_etc_sysconfig_clock (void)
{
if (monitor == NULL) {
+ GFile *file;
+
parse_etc_sysconfig_clock ();
+
+ file = g_file_new_for_path ("/etc/sysconfig/clock");
+
+ monitor = g_file_monitor_file (file, G_FILE_MONITOR_NONE,
+ NULL, NULL);
+
+ g_object_unref (file);
- gnome_vfs_monitor_add (&monitor,
- "/etc/sysconfig/clock",
- GNOME_VFS_MONITOR_FILE,
- monitor_etc_sysconfig_clock,
- NULL);
+ if (monitor)
+ g_signal_connect (G_OBJECT (monitor), "changed",
+ G_CALLBACK (monitor_etc_sysconfig_clock),
+ NULL);
}
return current_zone;
@@ -465,6 +473,12 @@
priv->weather_timeout = 0;
}
+ if (monitor) {
+ g_file_monitor_cancel (monitor);
+ g_object_unref (monitor);
+ monitor = NULL;
+ }
+
G_OBJECT_CLASS (clock_location_parent_class)->finalize (g_obj);
}
Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in (original)
+++ trunk/configure.in Sat Feb 9 13:47:01 2008
@@ -51,7 +51,7 @@
LIBGNOME_DESKTOP_REQUIRED=2.11.1
GDK_PIXBUF_REQUIRED=2.7.1
PANGO_REQUIRED=1.15.4
-GLIB_REQUIRED=2.13.0
+GLIB_REQUIRED=2.15.4
GTK_REQUIRED=2.11.3
LIBGLADE_REQUIRED=2.5.0
LIBGNOME_REQUIRED=2.13.0
@@ -111,7 +111,7 @@
AM_CONDITIONAL(HAVE_LIBECAL, test -n "$LIBECAL_REQUIREMENT")
AC_SUBST(CLOCK_EDS_ICONDIR)
-PKG_CHECK_MODULES(CLOCK, pango >= $PANGO_REQUIRED gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED $LIBECAL_REQUIREMENT libglade-2.0 >= $LIBGLADE_REQUIRED librsvg-2.0 dbus-glib-1 gweather libxml-2.0)
+PKG_CHECK_MODULES(CLOCK, pango >= $PANGO_REQUIRED gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED gio-2.0 >= $GLIB_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED $LIBECAL_REQUIREMENT libglade-2.0 >= $LIBGLADE_REQUIRED librsvg-2.0 dbus-glib-1 gweather libxml-2.0)
AC_SUBST(CLOCK_CFLAGS)
AC_SUBST(CLOCK_LIBS)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]