r39559 - in /desktop/unstable/gnome-panel/debian: changelog control control.in gnome-panel-data.install patches/20_eds-api.patch patches/clock-applet-modern-gnome-tech.patch patches/clock-schema.patch patches/drop-gweather-xml-include.patch patches/series

ah at users.alioth.debian.org ah at users.alioth.debian.org
Tue Sep 17 14:32:48 UTC 2013


Author: ah
Date: Tue Sep 17 14:32:48 2013
New Revision: 39559

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=39559
Log:
* Add debian/patches/20_eds-api.patch
* Update build-dependencies for above patch:
  - Drop libedataserverui-3.0-dev (>= 2.91.2),
  - Bump libecal1.2-dev to >= 3.5.3
  - Bump libedataserver1.2-dev to >= 3.5.3
  - Bump evolution-data-server-dev to >= 3.5.3
* Add debian/patches/clock-schema.patch
  - missing schema from the tarball?! Needed by next patch....
* Add debian/patches/clock-applet-modern-gnome-tech.patch
  - ports to gsettings, newer gweather, etc...
* debian/gnome-panel-data.install: don't install etc/gconf
* Bump build dependency on libgweather-3-dev to >= 3.5.1 for above patch
* Add debian/patches/drop-gweather-xml-include.patch
* Above changes closes #722022

Added:
    desktop/unstable/gnome-panel/debian/patches/20_eds-api.patch
    desktop/unstable/gnome-panel/debian/patches/clock-applet-modern-gnome-tech.patch
    desktop/unstable/gnome-panel/debian/patches/clock-schema.patch
    desktop/unstable/gnome-panel/debian/patches/drop-gweather-xml-include.patch
Modified:
    desktop/unstable/gnome-panel/debian/changelog
    desktop/unstable/gnome-panel/debian/control
    desktop/unstable/gnome-panel/debian/control.in
    desktop/unstable/gnome-panel/debian/gnome-panel-data.install
    desktop/unstable/gnome-panel/debian/patches/series

Modified: desktop/unstable/gnome-panel/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-panel/debian/changelog?rev=39559&op=diff
==============================================================================
--- desktop/unstable/gnome-panel/debian/changelog	[utf-8] (original)
+++ desktop/unstable/gnome-panel/debian/changelog	[utf-8] Tue Sep 17 14:32:48 2013
@@ -1,3 +1,22 @@
+gnome-panel (3.4.2.1-6) UNRELEASED; urgency=low
+
+  * Add debian/patches/20_eds-api.patch
+  * Update build-dependencies for above patch:
+    - Drop libedataserverui-3.0-dev (>= 2.91.2),
+    - Bump libecal1.2-dev to >= 3.5.3
+    - Bump libedataserver1.2-dev to >= 3.5.3
+    - Bump evolution-data-server-dev to >= 3.5.3
+  * Add debian/patches/clock-schema.patch
+    - missing schema from the tarball?! Needed by next patch....
+  * Add debian/patches/clock-applet-modern-gnome-tech.patch
+    - ports to gsettings, newer gweather, etc...
+  * debian/gnome-panel-data.install: don't install etc/gconf
+  * Bump build dependency on libgweather-3-dev to >= 3.5.1 for above patch
+  * Add debian/patches/drop-gweather-xml-include.patch
+  * Above changes closes #722022
+
+ -- Andreas Henriksson <andreas at fatal.se>  Tue, 17 Sep 2013 15:12:37 +0200
+
 gnome-panel (3.4.2.1-5) unstable; urgency=low
 
   * debian/patches/19_dconf_api_changes.patch: Adjust to DConf API changes.

Modified: desktop/unstable/gnome-panel/debian/control
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-panel/debian/control?rev=39559&op=diff
==============================================================================
--- desktop/unstable/gnome-panel/debian/control	[utf-8] (original)
+++ desktop/unstable/gnome-panel/debian/control	[utf-8] Tue Sep 17 14:32:48 2013
@@ -7,7 +7,7 @@
 Section: gnome
 Priority: optional
 Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers at lists.alioth.debian.org>
-Uploaders: Josselin Mouette <joss at debian.org>, Michael Biebl <biebl at debian.org>
+Uploaders: Andreas Henriksson <andreas at fatal.se>, Michael Biebl <biebl at debian.org>
 Standards-Version: 3.9.3
 Build-Depends: cdbs (>= 0.4.41),
                debhelper (>= 8),
@@ -27,12 +27,11 @@
                libgconf2-dev (>= 2.6.1),
                libgnome-menu-3-dev (>= 3.1.4),
                libdconf-dev (>= 0.13.4),
-               libecal1.2-dev (>= 2.91.2),
-               libedataserver1.2-dev (>= 2.91.2),
-               libedataserverui-3.0-dev (>= 2.91.2),
-               evolution-data-server-dev,
+               libecal1.2-dev (>= 3.5.3),
+               libedataserver1.2-dev (>= 3.5.3),
+               evolution-data-server-dev (>= 3.5.3),
                libcairo2-dev (>= 1.10.0),
-               libgweather-3-dev (>= 2.91.0),
+               libgweather-3-dev (>= 3.5.1),
                libice-dev,
                libsm-dev,
                libtelepathy-glib-dev (>= 0.14.0),

Modified: desktop/unstable/gnome-panel/debian/control.in
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-panel/debian/control.in?rev=39559&op=diff
==============================================================================
--- desktop/unstable/gnome-panel/debian/control.in	[utf-8] (original)
+++ desktop/unstable/gnome-panel/debian/control.in	[utf-8] Tue Sep 17 14:32:48 2013
@@ -22,12 +22,11 @@
                libgconf2-dev (>= 2.6.1),
                libgnome-menu-3-dev (>= 3.1.4),
                libdconf-dev (>= 0.13.4),
-               libecal1.2-dev (>= 2.91.2),
-               libedataserver1.2-dev (>= 2.91.2),
-               libedataserverui-3.0-dev (>= 2.91.2),
-               evolution-data-server-dev,
+               libecal1.2-dev (>= 3.5.3),
+               libedataserver1.2-dev (>= 3.5.3),
+               evolution-data-server-dev (>= 3.5.3),
                libcairo2-dev (>= 1.10.0),
-               libgweather-3-dev (>= 2.91.0),
+               libgweather-3-dev (>= 3.5.1),
                libice-dev,
                libsm-dev,
                libtelepathy-glib-dev (>= 0.14.0),

Modified: desktop/unstable/gnome-panel/debian/gnome-panel-data.install
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-panel/debian/gnome-panel-data.install?rev=39559&op=diff
==============================================================================
--- desktop/unstable/gnome-panel/debian/gnome-panel-data.install	[utf-8] (original)
+++ desktop/unstable/gnome-panel/debian/gnome-panel-data.install	[utf-8] Tue Sep 17 14:32:48 2013
@@ -1,4 +1,3 @@
-etc/gconf
 usr/share/glib-2.0
 usr/share/gnome-panel
 usr/share/gnome

Added: desktop/unstable/gnome-panel/debian/patches/20_eds-api.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-panel/debian/patches/20_eds-api.patch?rev=39559&op=file
==============================================================================
--- desktop/unstable/gnome-panel/debian/patches/20_eds-api.patch	(added)
+++ desktop/unstable/gnome-panel/debian/patches/20_eds-api.patch	[utf-8] Tue Sep 17 14:32:48 2013
@@ -0,0 +1,1273 @@
+From 66ef9bf9941b940d21c9b6e904820067b13026b6 Mon Sep 17 00:00:00 2001
+From: Matthew Barnes <mbarnes at redhat.com>
+Date: Thu, 26 Apr 2012 04:23:35 +0000
+Subject: clock: Adapt to Evolution-Data-Server API changes
+
+Adapt the clock applet to some major API changes in E-D-S 3.5.3.
+
+More details about the breakage:
+http://mbarnes.livejournal.com/4631.html
+
+Requires E-D-S >= 3.5.3 and drops the dependency on libedataserverui.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=677392
+---
+--- a/applets/clock/calendar-client.c
++++ b/applets/clock/calendar-client.c
+@@ -30,18 +30,13 @@
+ #include <libintl.h>
+ #include <string.h>
+ #define HANDLE_LIBICAL_MEMORY
+-#include <libecal/e-cal.h>
+-#include <libecal/e-cal-time-util.h>
+-#include <libecal/e-cal-recur.h>
++#include <libecal/libecal.h>
+ 
+ #include "calendar-sources.h"
+ 
+ #undef CALENDAR_ENABLE_DEBUG
+ #include "calendar-debug.h"
+ 
+-#define CALENDAR_CONFIG_PREFIX   "/apps/evolution/calendar"
+-#define CALENDAR_CONFIG_TIMEZONE CALENDAR_CONFIG_PREFIX "/display/timezone"
+-
+ #ifndef _
+ #define _(x) gettext(x)
+ #endif
+@@ -85,7 +80,7 @@
+   icaltimezone        *zone;
+ 
+   guint                zone_listener;
+-  GConfClient         *gconf_client;
++  GSettings           *calendar_settings;
+ 
+   guint                day;
+   guint                month;
+@@ -106,7 +101,7 @@
+ 
+ static GSList *calendar_client_update_sources_list         (CalendarClient       *client,
+ 							    GSList               *sources,
+-							    GSList               *esources,
++							    GList                *esources,
+ 							    guint                 changed_signal_id);
+ static void    calendar_client_appointment_sources_changed (CalendarClient       *client);
+ static void    calendar_client_task_sources_changed        (CalendarClient       *client);
+@@ -236,24 +231,18 @@
+ /* The current timezone, e.g. "Europe/London". It may be NULL, in which case
+    you should assume UTC. */
+ static gchar *
+-calendar_client_config_get_timezone (GConfClient *gconf_client)
++calendar_client_config_get_timezone (GSettings *calendar_settings)
+ {
+-  char *location;
+-
+-  location = gconf_client_get_string (gconf_client,
+-                                      CALENDAR_CONFIG_TIMEZONE,
+-                                      NULL);
+-
+-  return location;
++  return g_settings_get_string (calendar_settings, "timezone");
+ }
+ 
+ static icaltimezone *
+-calendar_client_config_get_icaltimezone (GConfClient *gconf_client)
++calendar_client_config_get_icaltimezone (GSettings *calendar_settings)
+ {
+   char         *location;
+   icaltimezone *zone = NULL;
+ 	
+-  location = calendar_client_config_get_timezone (gconf_client);
++  location = calendar_client_config_get_timezone (calendar_settings);
+   if (!location)
+     return icaltimezone_get_utc_timezone ();
+ 
+@@ -266,23 +255,23 @@
+ static void
+ calendar_client_set_timezone (CalendarClient *client) 
+ {
+-  GSList *l;
+-  GSList *esources;
++  GList *list, *link;
+ 
+-  client->priv->zone = calendar_client_config_get_icaltimezone (client->priv->gconf_client);
++  client->priv->zone = calendar_client_config_get_icaltimezone (client->priv->calendar_settings);
+ 
+-  esources = calendar_sources_get_appointment_sources (client->priv->calendar_sources);
+-  for (l = esources; l; l = l->next) {
+-    ECal *source = l->data;
+-			
+-    e_cal_set_default_timezone (source, client->priv->zone, NULL);
+-  }
++  list = calendar_sources_get_appointment_clients (client->priv->calendar_sources);
++  for (link = list; link != NULL; link = g_list_next (link))
++    {
++      ECal *cal = E_CAL (link->data);
++
++      e_cal_set_default_timezone (cal, client->priv->zone, NULL);
++    }
++  g_list_free (list);
+ }
+ 
+ static void
+-calendar_client_timezone_changed_cb (GConfClient    *gconf_client,
+-                                     guint           id,
+-                                     GConfEntry     *entry,
++calendar_client_timezone_changed_cb (GSettings      *calendar_settings,
++                                     const gchar    *key,
+                                      CalendarClient *client)
+ {
+   calendar_client_set_timezone (client);
+@@ -365,20 +354,22 @@
+ static void
+ calendar_client_init (CalendarClient *client)
+ {
+-  GSList *esources;
++  GList *list;
+ 
+   client->priv = CALENDAR_CLIENT_GET_PRIVATE (client);
+ 
+   client->priv->calendar_sources = calendar_sources_get ();
+-  client->priv->gconf_client = gconf_client_get_default ();
++  client->priv->calendar_settings = g_settings_new ("org.gnome.evolution.calendar");
+ 
+-  esources = calendar_sources_get_appointment_sources (client->priv->calendar_sources);
++  list = calendar_sources_get_appointment_clients (client->priv->calendar_sources);
+   client->priv->appointment_sources =
+-    calendar_client_update_sources_list (client, NULL, esources, signals [APPOINTMENTS_CHANGED]);
++    calendar_client_update_sources_list (client, NULL, list, signals [APPOINTMENTS_CHANGED]);
++  g_list_free (list);
+ 
+-  esources = calendar_sources_get_task_sources (client->priv->calendar_sources);
++  list = calendar_sources_get_task_clients (client->priv->calendar_sources);
+   client->priv->task_sources =
+-    calendar_client_update_sources_list (client, NULL, esources, signals [TASKS_CHANGED]);
++    calendar_client_update_sources_list (client, NULL, list, signals [TASKS_CHANGED]);
++  g_list_free (list);
+  
+   /* set the timezone before loading the clients */ 
+   calendar_client_set_timezone (client);
+@@ -394,15 +385,10 @@
+ 			    G_CALLBACK (calendar_client_task_sources_changed),
+ 			    client);
+ 
+-  gconf_client_add_dir (client->priv->gconf_client,
+-			CALENDAR_CONFIG_PREFIX,
+-			GCONF_CLIENT_PRELOAD_NONE,
+-			NULL);
+-
+-  client->priv->zone_listener = gconf_client_notify_add (client->priv->gconf_client,
+-                                                         CALENDAR_CONFIG_TIMEZONE,
+-                                                         (GConfClientNotifyFunc) calendar_client_timezone_changed_cb,
+-                                                         client, NULL, NULL);
++  client->priv->zone_listener = g_signal_connect (client->priv->calendar_settings,
++                                                  "changed::timezone",
++                                                  G_CALLBACK (calendar_client_timezone_changed_cb),
++                                                  client);
+ 
+   client->priv->day   = -1;
+   client->priv->month = -1;
+@@ -417,18 +403,14 @@
+ 
+   if (client->priv->zone_listener)
+     {
+-      gconf_client_notify_remove (client->priv->gconf_client,
+-                                  client->priv->zone_listener);
++      g_signal_handler_disconnect (client->priv->calendar_settings,
++                                   client->priv->zone_listener);
+       client->priv->zone_listener = 0;
+     }
+ 
+-  gconf_client_remove_dir (client->priv->gconf_client,
+-                           CALENDAR_CONFIG_PREFIX,
+-                           NULL);
+-
+-  if (client->priv->gconf_client)
+-    g_object_unref (client->priv->gconf_client);
+-  client->priv->gconf_client = NULL;
++  if (client->priv->calendar_settings)
++    g_object_unref (client->priv->calendar_settings);
++  client->priv->calendar_settings = NULL;
+ 
+   for (l = client->priv->appointment_sources; l; l = l->next)
+     {
+@@ -737,37 +719,60 @@
+ get_source_color (ECal *esource)
+ {
+   ESource *source;
++  ECalSourceType source_type;
++  ESourceSelectable *extension;
++  const gchar *extension_name;
+ 
+   g_return_val_if_fail (E_IS_CAL (esource), NULL);
+ 
+   source = e_cal_get_source (esource);
++  source_type = e_cal_get_source_type (esource);
++
++  switch (source_type)
++    {
++      case E_CAL_SOURCE_TYPE_EVENT:
++        extension_name = E_SOURCE_EXTENSION_CALENDAR;
++        break;
++      case E_CAL_SOURCE_TYPE_TODO:
++        extension_name = E_SOURCE_EXTENSION_TASK_LIST;
++        break;
++      default:
++        g_return_val_if_reached (NULL);
++    }
++
++  extension = e_source_get_extension (source, extension_name);
+ 
+-  return g_strdup (e_source_peek_color_spec (source));
++  return e_source_selectable_dup_color (extension);
+ }
+ 
+ static gchar *
+-get_source_uri (ECal *esource)
++get_source_backend_name (ECal *esource)
+ {
+-    ESource *source;
+-    gchar   *string;
+-    gchar  **list;
+-
+-    g_return_val_if_fail (E_IS_CAL (esource), NULL);
+-
+-    source = e_cal_get_source (esource);
+-    string = g_strdup (e_source_get_uri (source));
+-    if (string) {
+-        list = g_strsplit (string, ":", 2);
+-        g_free (string);
+-
+-        if (list[0]) {
+-            string = g_strdup (list[0]);
+-            g_strfreev (list);
+-            return string;
+-        }
+-	g_strfreev (list);
++  ESource *source;
++  ECalSourceType source_type;
++  ESourceBackend *extension;
++  const gchar *extension_name;
++
++  g_return_val_if_fail (E_IS_CAL (esource), NULL);
++
++  source = e_cal_get_source (esource);
++  source_type = e_cal_get_source_type (esource);
++
++  switch (source_type)
++    {
++      case E_CAL_SOURCE_TYPE_EVENT:
++        extension_name = E_SOURCE_EXTENSION_CALENDAR;
++        break;
++      case E_CAL_SOURCE_TYPE_TODO:
++        extension_name = E_SOURCE_EXTENSION_TASK_LIST;
++        break;
++      default:
++        g_return_val_if_reached (NULL);
+     }
+-    return NULL;
++
++  extension = e_source_get_extension (source, extension_name);
++
++  return e_source_backend_dup_backend_name (extension);
+ }
+ 
+ static inline int
+@@ -798,7 +803,7 @@
+ 
+   return
+     null_safe_strcmp (a->uid,          b->uid)          == 0 &&
+-    null_safe_strcmp (a->uri,          b->uri)          == 0 &&
++    null_safe_strcmp (a->backend_name, b->backend_name) == 0 &&
+     null_safe_strcmp (a->summary,      b->summary)      == 0 &&
+     null_safe_strcmp (a->description,  b->description)  == 0 &&
+     null_safe_strcmp (a->color_string, b->color_string) == 0 &&
+@@ -830,7 +835,7 @@
+     }
+ 
+   appointment_copy->uid          = g_strdup (appointment->uid);
+-  appointment_copy->uri          = g_strdup (appointment->uri);
++  appointment_copy->backend_name = g_strdup (appointment->backend_name);
+   appointment_copy->summary      = g_strdup (appointment->summary);
+   appointment_copy->description  = g_strdup (appointment->description);
+   appointment_copy->color_string = g_strdup (appointment->color_string);
+@@ -855,8 +860,8 @@
+   g_free (appointment->rid);
+   appointment->rid = NULL;
+ 
+-  g_free (appointment->uri);
+-  appointment->uri = NULL;
++  g_free (appointment->backend_name);
++  appointment->backend_name = NULL;
+ 
+   g_free (appointment->summary);
+   appointment->summary = NULL;
+@@ -879,7 +884,7 @@
+ {
+   appointment->uid          = get_ical_uid (ical);
+   appointment->rid          = get_ical_rid (ical);
+-  appointment->uri          = get_source_uri (source->source);
++  appointment->backend_name = get_source_backend_name (source->source);
+   appointment->summary      = get_ical_summary (ical);
+   appointment->description  = get_ical_description (ical);
+   appointment->color_string = get_source_color (source->source);
+@@ -1686,19 +1691,20 @@
+ static GSList *
+ calendar_client_update_sources_list (CalendarClient *client,
+ 				     GSList         *sources,
+-				     GSList         *esources,
++				     GList          *esources,
+ 				     guint           changed_signal_id)
+ {
++  GList *link;
+   GSList *retval, *l;
+ 
+   retval = NULL;
+ 
+-  for (l = esources; l; l = l->next)
++  for (link = esources; link != NULL; link = g_list_next (link->next))
+     {
+       CalendarClientSource  dummy_source;
+       CalendarClientSource *new_source;
+       GSList               *s;
+-      ECal                 *esource = l->data;
++      ECal                 *esource = link->data;
+ 
+       dummy_source.source = esource;
+ 
+@@ -1743,39 +1749,43 @@
+ static void
+ calendar_client_appointment_sources_changed (CalendarClient  *client)
+ {
+-  GSList *esources;
++  GList *list;
+ 
+   dprintf ("appointment_sources_changed: updating ...\n");
+ 
+-  esources = calendar_sources_get_appointment_sources (client->priv->calendar_sources);
++  list = calendar_sources_get_appointment_clients (client->priv->calendar_sources);
+ 
+   client->priv->appointment_sources = 
+     calendar_client_update_sources_list (client,
+ 					 client->priv->appointment_sources,
+-					 esources,
++					 list,
+ 					 signals [APPOINTMENTS_CHANGED]);
+ 
+   load_calendars (client, CALENDAR_EVENT_APPOINTMENT);
+   calendar_client_update_appointments (client);
++
++  g_list_free (list);
+ }
+ 
+ static void
+ calendar_client_task_sources_changed (CalendarClient  *client)
+ {
+-  GSList *esources;
++  GList *list;
+ 
+   dprintf ("task_sources_changed: updating ...\n");
+ 
+-  esources = calendar_sources_get_task_sources (client->priv->calendar_sources);
++  list = calendar_sources_get_task_clients (client->priv->calendar_sources);
+ 
+   client->priv->task_sources = 
+     calendar_client_update_sources_list (client,
+ 					 client->priv->task_sources,
+-					 esources,
++					 list,
+ 					 signals [TASKS_CHANGED]);
+ 
+   load_calendars (client, CALENDAR_EVENT_TASK);
+   calendar_client_update_tasks (client);
++
++  g_list_free (list);
+ }
+ 
+ void
+--- a/applets/clock/calendar-client.h
++++ b/applets/clock/calendar-client.h
+@@ -73,7 +73,7 @@
+ {
+   char   *uid;
+   char   *rid;
+-  char   *uri;
++  char   *backend_name;
+   char   *summary;
+   char   *description;
+   char   *color_string;
+--- a/applets/clock/calendar-sources.c
++++ b/applets/clock/calendar-sources.c
+@@ -29,11 +29,8 @@
+ 
+ #include <libintl.h>
+ #include <string.h>
+-#include <gconf/gconf-client.h>
+ #define HANDLE_LIBICAL_MEMORY
+-#include <libecal/e-cal.h>
+-#include <libedataserver/e-source-list.h>
+-#include <libedataserverui/e-passwords.h>
++#include <libecal/libecal.h>
+ 
+ #undef CALENDAR_ENABLE_DEBUG
+ #include "calendar-debug.h"
+@@ -48,28 +45,23 @@
+ 
+ #define CALENDAR_SOURCES_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CALENDAR_TYPE_SOURCES, CalendarSourcesPrivate))
+ 
+-#define CALENDAR_SOURCES_EVO_DIR                          "/apps/evolution"
+-#define CALENDAR_SOURCES_APPOINTMENT_SOURCES_KEY          CALENDAR_SOURCES_EVO_DIR "/calendar/sources"
+-#define CALENDAR_SOURCES_SELECTED_APPOINTMENT_SOURCES_DIR CALENDAR_SOURCES_EVO_DIR "/calendar/display"
+-#define CALENDAR_SOURCES_SELECTED_APPOINTMENT_SOURCES_KEY CALENDAR_SOURCES_SELECTED_APPOINTMENT_SOURCES_DIR "/selected_calendars"
+-#define CALENDAR_SOURCES_TASK_SOURCES_KEY                 CALENDAR_SOURCES_EVO_DIR "/tasks/sources"
+-#define CALENDAR_SOURCES_SELECTED_TASK_SOURCES_DIR        CALENDAR_SOURCES_EVO_DIR "/calendar/tasks"
+-#define CALENDAR_SOURCES_SELECTED_TASK_SOURCES_KEY        CALENDAR_SOURCES_SELECTED_TASK_SOURCES_DIR "/selected_tasks"
+-
++typedef struct _ClientData ClientData;
+ typedef struct _CalendarSourceData CalendarSourceData;
+ 
++struct _ClientData
++{
++  ECal *client;
++  gulong backend_died_id;
++};
++
+ struct _CalendarSourceData
+ {
+   ECalSourceType   source_type;
+   CalendarSources *sources;
+   guint            changed_signal;
+ 
+-  GSList          *clients;
+-  GSList          *selected_sources;
+-  ESourceList     *esource_list;
+-
+-  guint            selected_sources_listener;
+-  char            *selected_sources_dir;
++  /* ESource -> EClient */
++  GHashTable      *clients;
+ 
+   guint            timeout_id;
+ 
+@@ -78,10 +70,13 @@
+ 
+ struct _CalendarSourcesPrivate
+ {
++  ESourceRegistry    *registry;
++  gulong              source_added_id;
++  gulong              source_changed_id;
++  gulong              source_removed_id;
++
+   CalendarSourceData  appointment_sources;
+   CalendarSourceData  task_sources;
+-
+-  GConfClient        *gconf_client;
+ };
+ 
+ static void calendar_sources_class_init (CalendarSourcesClass *klass);
+@@ -89,8 +84,12 @@
+ static void calendar_sources_finalize   (GObject             *object);
+ 
+ static void backend_died_cb (ECal *client, CalendarSourceData *source_data);
+-static void calendar_sources_esource_list_changed (ESourceList        *source_list,
+-                                                   CalendarSourceData *source_data);
++static void calendar_sources_registry_source_changed_cb (ESourceRegistry *registry,
++                                                         ESource         *source,
++                                                         CalendarSources *sources);
++static void calendar_sources_registry_source_removed_cb (ESourceRegistry *registry,
++                                                         ESource         *source,
++                                                         CalendarSources *sources);
+ 
+ enum
+ {
+@@ -103,6 +102,14 @@
+ static GObjectClass    *parent_class = NULL;
+ static CalendarSources *calendar_sources_singleton = NULL;
+ 
++static void
++client_data_free (ClientData *data)
++{
++  g_signal_handler_disconnect (data->client, data->backend_died_id);
++  g_object_unref (data->client);
++  g_slice_free (ClientData, data);
++}
++
+ GType
+ calendar_sources_get_type (void)
+ {
+@@ -170,19 +177,49 @@
+ static void
+ calendar_sources_init (CalendarSources *sources)
+ {
++  GError *error = NULL;
++
+   sources->priv = CALENDAR_SOURCES_GET_PRIVATE (sources);
+ 
++  /* XXX Not sure what to do if this fails.
++   *     Should this class implement GInitable or pass the
++   *     registry in as a G_PARAM_CONSTRUCT_ONLY property? */
++  sources->priv->registry = e_source_registry_new_sync (NULL, &error);
++  if (error != NULL) {
++    g_critical ("%s: %s", G_STRFUNC, error->message);
++    g_error_free (error);
++  }
++
++  sources->priv->source_added_id   = g_signal_connect (sources->priv->registry,
++                                                       "source-added",
++                                                       G_CALLBACK (calendar_sources_registry_source_changed_cb),
++                                                       sources);
++  sources->priv->source_changed_id = g_signal_connect (sources->priv->registry,
++                                                       "source-changed",
++                                                       G_CALLBACK (calendar_sources_registry_source_changed_cb),
++                                                       sources);
++  sources->priv->source_removed_id = g_signal_connect (sources->priv->registry,
++                                                       "source-removed",
++                                                       G_CALLBACK (calendar_sources_registry_source_removed_cb),
++                                                       sources);
++
+   sources->priv->appointment_sources.source_type    = E_CAL_SOURCE_TYPE_EVENT;
+   sources->priv->appointment_sources.sources        = sources;
+   sources->priv->appointment_sources.changed_signal = signals [APPOINTMENT_SOURCES_CHANGED];
++  sources->priv->appointment_sources.clients        = g_hash_table_new_full ((GHashFunc) e_source_hash,
++                                                                             (GEqualFunc) e_source_equal,
++                                                                             (GDestroyNotify) g_object_unref,
++                                                                             (GDestroyNotify) client_data_free);
+   sources->priv->appointment_sources.timeout_id     = 0;
+ 
+   sources->priv->task_sources.source_type    = E_CAL_SOURCE_TYPE_TODO;
+   sources->priv->task_sources.sources        = sources;
+   sources->priv->task_sources.changed_signal = signals [TASK_SOURCES_CHANGED];
++  sources->priv->task_sources.clients        = g_hash_table_new_full ((GHashFunc) e_source_hash,
++                                                                      (GEqualFunc) e_source_equal,
++                                                                      (GDestroyNotify) g_object_unref,
++                                                                      (GDestroyNotify) client_data_free);
+   sources->priv->task_sources.timeout_id     = 0;
+-
+-  sources->priv->gconf_client = gconf_client_get_default ();
+ }
+ 
+ static void
+@@ -191,49 +228,9 @@
+ {
+   if (source_data->loaded)
+     {
+-      GSList *l;
+-
+-      if (source_data->selected_sources_dir)
+-	{
+-	  gconf_client_remove_dir (sources->priv->gconf_client,
+-				   source_data->selected_sources_dir,
+-				   NULL);
+-
+-	  g_free (source_data->selected_sources_dir);
+-	  source_data->selected_sources_dir = NULL;
+-	}
+-
+-      if (source_data->selected_sources_listener)
+-	{
+-	  gconf_client_notify_remove (sources->priv->gconf_client,
+-				      source_data->selected_sources_listener);
+-	  source_data->selected_sources_listener = 0;
+-	}
+-
+-      for (l = source_data->clients; l; l = l->next)
+-        {
+-          g_signal_handlers_disconnect_by_func (G_OBJECT (l->data),
+-                                                G_CALLBACK (backend_died_cb),
+-                                                source_data);
+-          g_object_unref (l->data);
+-        }
+-      g_slist_free (source_data->clients);
++      g_hash_table_destroy (source_data->clients);
+       source_data->clients = NULL;
+ 
+-      if (source_data->esource_list)
+-        {
+-          g_signal_handlers_disconnect_by_func (source_data->esource_list,
+-                                                G_CALLBACK (calendar_sources_esource_list_changed),
+-                                                source_data);
+-          g_object_unref (source_data->esource_list);
+-	}
+-      source_data->esource_list = NULL;
+-
+-      for (l = source_data->selected_sources; l; l = l->next)
+-	g_free (l->data);
+-      g_slist_free (source_data->selected_sources);
+-      source_data->selected_sources = NULL;
+-
+       if (source_data->timeout_id != 0)
+         {
+           g_source_remove (source_data->timeout_id);
+@@ -249,13 +246,21 @@
+ {
+   CalendarSources *sources = CALENDAR_SOURCES (object);
+ 
++  if (sources->priv->registry)
++    {
++      g_signal_handler_disconnect (sources->priv->registry,
++                                   sources->priv->source_added_id);
++      g_signal_handler_disconnect (sources->priv->registry,
++                                   sources->priv->source_changed_id);
++      g_signal_handler_disconnect (sources->priv->registry,
++                                   sources->priv->source_removed_id);
++      g_object_unref (sources->priv->registry);
++    }
++  sources->priv->registry = NULL;
++
+   calendar_sources_finalize_source_data (sources, &sources->priv->appointment_sources);
+   calendar_sources_finalize_source_data (sources, &sources->priv->task_sources);
+ 
+-  if (sources->priv->gconf_client)
+-    g_object_unref (sources->priv->gconf_client);
+-  sources->priv->gconf_client = NULL;
+-
+   if (G_OBJECT_CLASS (parent_class)->finalize)
+     G_OBJECT_CLASS (parent_class)->finalize (object);
+ }
+@@ -275,150 +280,68 @@
+   return calendar_sources_singleton;
+ }
+ 
+-static gboolean
+-is_source_selected (ESource *esource,
+-		    GSList  *selected_sources)
+-{
+-  const char *uid;
+-  GSList     *l;
+-
+-  uid = e_source_peek_uid (esource);
+-
+-  for (l = selected_sources; l; l = l->next)
+-    {
+-      const char *source = l->data;
+-
+-      if (!strcmp (source, uid))
+-	return TRUE;
+-    }
+-
+-  return FALSE;
+-}
+-
+-static char *
+-auth_func_cb (ECal       *ecal,
+-	      const char *prompt,
+-	      const char *key,
+-	      gpointer    user_data)
+-{
+-	ESource *source;
+-	const gchar *auth_domain;
+-	const gchar *component_name;
+-
+-	source = e_cal_get_source (ecal);
+-	auth_domain = e_source_get_property (source, "auth-domain");
+-	component_name = auth_domain ? auth_domain : "Calendar";
+-
+-	return e_passwords_get_password (component_name, key);
+-}
+-
+ /* The clients are just created here but not loaded */
+-static ECal *
+-get_ecal_from_source (ESource        *esource,
+-		      ECalSourceType  source_type,
+-		      GSList         *existing_clients)
+-{
+-  ECal *retval;
+-
+-  if (existing_clients)
+-    {
+-      GSList *l;
+-
+-      for (l = existing_clients; l; l = l->next)
+-	{
+-	  ECal *client = E_CAL (l->data);
+-
+-	  if (e_source_equal (esource, e_cal_get_source (client)))
+-	    {
+-	      dprintf ("        load_esource: found existing source ... returning that\n");
+-
+-	      return g_object_ref (client);
+-	    }
+-	}
+-    }
+-
+-  retval = e_cal_new (esource, source_type);
+-  if (!retval)
+-    {
+-      g_warning ("Could not load source '%s' from '%s'\n",
+-		 e_source_peek_name (esource),
+-		 e_source_peek_relative_uri (esource));
+-      return NULL;
+-    }
+-
+-  e_cal_set_auth_func (retval, auth_func_cb, NULL);
+-
+-  return retval;
+-}
+-
+-/* - Order doesn't matter
+- * - Can just compare object pointers since we
+- *   re-use client connections
+- */
+-static gboolean
+-compare_ecal_lists (GSList *a,
+-		    GSList *b)
++static void
++create_client_for_source (ESource            *source,
++		          ECalSourceType      source_type,
++		          CalendarSourceData *source_data)
+ {
+-  GSList *l;
++  ClientData *data;
++  ECal *client;
+ 
+-  if (g_slist_length (a) != g_slist_length (b))
+-    return FALSE;
++  client = g_hash_table_lookup (source_data->clients, source);
++  g_return_if_fail (client == NULL);
+ 
+-  for (l = a; l; l = l->next)
++  client = e_cal_new (source, source_type);
++  if (!client)
+     {
+-      if (!g_slist_find (b, l->data))
+-	return FALSE;
++      g_warning ("Could not load source '%s'\n",
++		 e_source_get_uid (source));
++      return;
+     }
+ 
+-  return TRUE;
+-}
+-
+-static inline void
+-debug_dump_selected_sources (GSList *selected_sources)
+-{
+-#ifdef CALENDAR_ENABLE_DEBUG
+-  GSList *l;
+-
+-  dprintf ("Selected sources:\n");
+-  for (l = selected_sources; l; l = l->next)
+-    {
+-      char *source = l->data;
++  data = g_slice_new0 (ClientData);
++  data->client = client;  /* takes ownership */
++  data->backend_died_id = g_signal_connect (client,
++                                            "backend-died",
++                                            G_CALLBACK (backend_died_cb),
++                                            source_data);
+ 
+-      dprintf ("  %s\n", source);
+-    }
+-  dprintf ("\n");
+-#endif
++  g_hash_table_insert (source_data->clients, g_object_ref (source), data);
+ }
+ 
+ static inline void
+-debug_dump_ecal_list (GSList *ecal_list)
++debug_dump_ecal_list (GHashTable *clients)
+ {
+ #ifdef CALENDAR_ENABLE_DEBUG
+-  GSList *l;
++  GList *list, *link;
+ 
+   dprintf ("Loaded clients:\n");
+-  for (l = ecal_list; l; l = l->next)
++  list = g_hash_table_get_keys (clients);
++  for (link = list; link != NULL; link = g_list_next (link))
+     {
+-      ECal    *client = l->data;
+-      ESource *source = e_cal_get_source (client);
++      ESource *source = E_SOURCE (link->data);
+ 
+-      dprintf ("  %s %s %s\n",
+-	       e_source_peek_uid (source),
+-	       e_source_peek_name (source),
+-	       e_cal_get_uri (client));
++      dprintf ("  %s %s\n",
++	       e_source_get_uid (source),
++	       e_source_get_display_name (source));
+     }
+ #endif
+ }
+ 
+ static void
+-calendar_sources_load_esource_list (CalendarSourceData *source_data);
++calendar_sources_load_esource_list (ESourceRegistry *registry,
++                                    CalendarSourceData *source_data);
+ 
+ static gboolean
+ backend_restart (gpointer data)
+ {
+   CalendarSourceData *source_data = data;
++  ESourceRegistry *registry;
+ 
+-  calendar_sources_load_esource_list (source_data);
++  registry = source_data->sources->priv->registry;
++  calendar_sources_load_esource_list (registry, source_data);
++  g_signal_emit (source_data->sources, source_data->changed_signal, 0);
+ 
+   source_data->timeout_id = 0;
+     
+@@ -428,16 +351,13 @@
+ static void
+ backend_died_cb (ECal *client, CalendarSourceData *source_data)
+ {
+-  const char *uristr;
++  ESource *source;
++  const char *display_name;
+ 
+-  source_data->clients = g_slist_remove (source_data->clients, client);
+-  if (g_slist_length (source_data->clients) < 1) 
+-    {
+-      g_slist_free (source_data->clients);
+-      source_data->clients = NULL;
+-    }
+-  uristr = e_cal_get_uri (client);
+-  g_warning ("The calendar backend for %s has crashed.", uristr);
++  source = e_cal_get_source (client);
++  display_name = e_source_get_display_name (source);
++  g_warning ("The calendar backend for '%s' has crashed.", display_name);
++  g_hash_table_remove (source_data->clients, source);
+ 
+   if (source_data->timeout_id != 0)
+     {
+@@ -450,209 +370,162 @@
+ }
+ 
+ static void
+-calendar_sources_load_esource_list (CalendarSourceData *source_data)
++calendar_sources_load_esource_list (ESourceRegistry *registry,
++                                    CalendarSourceData *source_data)
+ {
+-  GSList  *clients = NULL;
+-  GSList  *groups, *l;
+-  gboolean emit_signal = FALSE;
+-
+-  g_return_if_fail (source_data->esource_list != NULL);
++  GList *list, *link;
++  const gchar *extension_name;
+ 
+-  debug_dump_selected_sources (source_data->selected_sources);
+-
+-  dprintf ("Source groups:\n");
+-  groups = e_source_list_peek_groups (source_data->esource_list);
+-  for (l = groups; l; l = l->next)
++  switch (source_data->source_type)
+     {
+-      GSList *esources, *s;
+-
+-      dprintf ("  %s\n", e_source_group_peek_uid (l->data));
+-      dprintf ("    sources:\n");
+-
+-      esources = e_source_group_peek_sources (l->data);
+-      for (s = esources; s; s = s->next)
+-	{
+-	  ESource *esource = E_SOURCE (s->data);
+-	  ECal    *client;
+-
+-	  dprintf ("      type = '%s' uid = '%s', name = '%s', relative uri = '%s': \n",
+-                   source_data->source_type == E_CAL_SOURCE_TYPE_EVENT ? "appointment" : "task",
+-		   e_source_peek_uid (esource),
+-		   e_source_peek_name (esource),
+-		   e_source_peek_relative_uri (esource));
+-
+-	  if (is_source_selected (esource, source_data->selected_sources) &&
+-	      (client = get_ecal_from_source (esource, source_data->source_type, source_data->clients)))
+-	    {
+-	      clients = g_slist_prepend (clients, client);
+-	    }
+-	}
++      case E_CAL_SOURCE_TYPE_EVENT:
++        extension_name = E_SOURCE_EXTENSION_CALENDAR;
++        break;
++      case E_CAL_SOURCE_TYPE_TODO:
++        extension_name = E_SOURCE_EXTENSION_TASK_LIST;
++        break;
++      default:
++        g_return_if_reached ();
+     }
+-  dprintf ("\n");
+ 
+-  if (source_data->loaded && 
+-      !compare_ecal_lists (source_data->clients, clients))
+-    emit_signal = TRUE;
++  list = e_source_registry_list_sources (registry, extension_name);
+ 
+-  for (l = source_data->clients; l; l = l->next)
++  for (link = list; link != NULL; link = g_list_next (link))
+     {
+-      g_signal_handlers_disconnect_by_func (G_OBJECT (l->data),
+-                                            G_CALLBACK (backend_died_cb),
+-                                            source_data);
+-
+-      g_object_unref (l->data);
+-    }
+-  g_slist_free (source_data->clients);
+-  source_data->clients = g_slist_reverse (clients);
++      ESource *source = E_SOURCE (link->data);
++      ESourceSelectable *extension;
++      gboolean show_source;
+ 
+-  /* connect to backend_died after we disconnected the previous signal
+-   * handlers. If we do it before, we'll lose some handlers (for clients that
+-   * were already there before) */
+-  for (l = source_data->clients; l; l = l->next)
+-    {
+-      g_signal_connect (G_OBJECT (l->data), "backend_died",
+-                        G_CALLBACK (backend_died_cb), source_data);
+-    }
++      extension = e_source_get_extension (source, extension_name);
++      show_source = e_source_get_enabled (source) && e_source_selectable_get_selected (extension);
+ 
+-  if (emit_signal) 
+-    {
+-      dprintf ("Emitting %s-sources-changed signal\n",
+-	       source_data->source_type == E_CAL_SOURCE_TYPE_EVENT ? "appointment" : "task");
+-      g_signal_emit (source_data->sources, source_data->changed_signal, 0);
++      if (show_source)
++        create_client_for_source (source, source_data->source_type, source_data);
+     }
+ 
+   debug_dump_ecal_list (source_data->clients);
+-}
+ 
+-static void
+-calendar_sources_esource_list_changed (ESourceList        *source_list,
+-				       CalendarSourceData *source_data)
+-				       
+-{
+-  dprintf ("ESourceList changed, reloading\n");
+-
+-  calendar_sources_load_esource_list (source_data);
++  g_list_free_full (list, g_object_unref);
+ }
+ 
+ static void
+-calendar_sources_selected_sources_notify (GConfClient        *client,
+-					  guint               cnx_id,
+-					  GConfEntry         *entry,
+-					  CalendarSourceData *source_data)
+-{
+-  GSList *l;
+-
+-  if (!entry->value ||
+-      entry->value->type != GCONF_VALUE_LIST ||
+-      gconf_value_get_list_type (entry->value) != GCONF_VALUE_STRING)
+-    return;
+-
+-  dprintf ("Selected sources key (%s) changed, reloading\n", entry->key);
++calendar_sources_registry_source_changed_cb (ESourceRegistry *registry,
++                                             ESource         *source,
++                                             CalendarSources *sources)
++{
++  if (e_source_has_extension (source, E_SOURCE_EXTENSION_CALENDAR))
++    {
++      CalendarSourceData *source_data;
++      ESourceSelectable *extension;
++      gboolean have_client;
++      gboolean show_source;
++
++      source_data = &sources->priv->appointment_sources;
++      extension = e_source_get_extension (source, E_SOURCE_EXTENSION_CALENDAR);
++      have_client = (g_hash_table_lookup (source_data->clients, source) != NULL);
++      show_source = e_source_get_enabled (source) && e_source_selectable_get_selected (extension);
+ 
+-  for (l = source_data->selected_sources; l; l = l->next)
+-    g_free (l->data);
+-  source_data->selected_sources = NULL;
++      if (!show_source && have_client)
++        {
++          g_hash_table_remove (source_data->clients, source);
++          g_signal_emit (sources, source_data->changed_signal, 0);
++        }
++      if (show_source && !have_client)
++        {
++          create_client_for_source (source, source_data->source_type, source_data);
++          g_signal_emit (sources, source_data->changed_signal, 0);
++        }
++    }
+ 
+-  for (l = gconf_value_get_list (entry->value); l; l = l->next)
++  if (e_source_has_extension (source, E_SOURCE_EXTENSION_TASK_LIST))
+     {
+-      const char *source = gconf_value_get_string (l->data);
++      CalendarSourceData *source_data;
++      ESourceSelectable *extension;
++      gboolean have_client;
++      gboolean show_source;
++
++      source_data = &sources->priv->task_sources;
++      extension = e_source_get_extension (source, E_SOURCE_EXTENSION_TASK_LIST);
++      have_client = (g_hash_table_lookup (source_data->clients, source) != NULL);
++      show_source = e_source_get_enabled (source) && e_source_selectable_get_selected (extension);
+ 
+-      source_data->selected_sources = 
+-	g_slist_prepend (source_data->selected_sources,
+-			 g_strdup (source));
++      if (!show_source && have_client)
++        {
++          g_hash_table_remove (source_data->clients, source);
++          g_signal_emit (sources, source_data->changed_signal, 0);
++        }
++      if (show_source && !have_client)
++        {
++          create_client_for_source (source, source_data->source_type, source_data);
++          g_signal_emit (sources, source_data->changed_signal, 0);
++        }
+     }
+-  source_data->selected_sources =
+-    g_slist_reverse (source_data->selected_sources);
+-
+-  calendar_sources_load_esource_list (source_data);
+ }
+ 
+ static void
+-calendar_sources_load_sources (CalendarSources    *sources,
+-			       CalendarSourceData *source_data,
+-			       const char         *sources_key,
+-			       const char         *selected_sources_key,
+-			       const char         *selected_sources_dir)
++calendar_sources_registry_source_removed_cb (ESourceRegistry *registry,
++                                             ESource         *source,
++                                             CalendarSources *sources)
+ {
+-  GConfClient *gconf_client;
+-  GError      *error;
+-
+-  dprintf ("---------------------------\n");
+-  dprintf ("Loading sources:\n");
+-  dprintf ("  sources_key: %s\n", sources_key);
+-  dprintf ("  selected_sources_key: %s\n", selected_sources_key);
+-  dprintf ("  selected_sources_dir: %s\n", selected_sources_dir);
+-
+-  gconf_client = sources->priv->gconf_client;
+-
+-  error = NULL;
+-  source_data->selected_sources = gconf_client_get_list (gconf_client,
+-							 selected_sources_key,
+-							 GCONF_VALUE_STRING,
+-							 &error);
+-  if (error)
++  if (e_source_has_extension (source, E_SOURCE_EXTENSION_CALENDAR))
+     {
+-      g_warning ("Failed to get selected sources from '%s': %s\n",
+-		 selected_sources_key,
+-		 error->message);
+-      g_error_free (error);
+-      return;
+-    }
++      CalendarSourceData *source_data;
+ 
+-  gconf_client_add_dir (gconf_client,
+-			selected_sources_dir,
+-			GCONF_CLIENT_PRELOAD_NONE,
+-			NULL);
+-  source_data->selected_sources_dir = g_strdup (selected_sources_dir);
+-
+-  source_data->selected_sources_listener =
+-    gconf_client_notify_add (gconf_client,
+-			     selected_sources_dir,
+-			     (GConfClientNotifyFunc) calendar_sources_selected_sources_notify,
+-			     source_data, NULL, NULL);
+-
+-  source_data->esource_list = e_source_list_new_for_gconf (gconf_client, sources_key);
+-  g_signal_connect (source_data->esource_list, "changed",
+-		    G_CALLBACK (calendar_sources_esource_list_changed),
+-		    source_data);
+-
+-  calendar_sources_load_esource_list (source_data);
++      source_data = &sources->priv->appointment_sources;
++      g_hash_table_remove (source_data->clients, source);
++      g_signal_emit (sources, source_data->changed_signal, 0);
++    }
+ 
+-  source_data->loaded = TRUE;
++  if (e_source_has_extension (source, E_SOURCE_EXTENSION_TASK_LIST))
++    {
++      CalendarSourceData *source_data;
+ 
+-  dprintf ("---------------------------\n");
++      source_data = &sources->priv->task_sources;
++      g_hash_table_remove (source_data->clients, source);
++      g_signal_emit (sources, source_data->changed_signal, 0);
++    }
+ }
+ 
+-GSList *
+-calendar_sources_get_appointment_sources (CalendarSources *sources)
++GList *
++calendar_sources_get_appointment_clients (CalendarSources *sources)
+ {
++  GList *list, *link;
++
+   g_return_val_if_fail (CALENDAR_IS_SOURCES (sources), NULL);
+ 
+   if (!sources->priv->appointment_sources.loaded)
+     {
+-      calendar_sources_load_sources (sources,
+-				     &sources->priv->appointment_sources,
+-				     CALENDAR_SOURCES_APPOINTMENT_SOURCES_KEY,
+-				     CALENDAR_SOURCES_SELECTED_APPOINTMENT_SOURCES_KEY,
+-				     CALENDAR_SOURCES_SELECTED_APPOINTMENT_SOURCES_DIR);
++      calendar_sources_load_esource_list (sources->priv->registry,
++                                          &sources->priv->appointment_sources);
++      sources->priv->appointment_sources.loaded = TRUE;
+     }
+-  
+-  return sources->priv->appointment_sources.clients;
++
++  list = g_hash_table_get_values (sources->priv->appointment_sources.clients);
++
++  for (link = list; link != NULL; link = g_list_next (link))
++    link->data = ((ClientData *) link->data)->client;
++
++  return list;
+ }
+ 
+-GSList *
+-calendar_sources_get_task_sources (CalendarSources *sources)
++GList *
++calendar_sources_get_task_clients (CalendarSources *sources)
+ {
++  GList *list, *link;
++
+   g_return_val_if_fail (CALENDAR_IS_SOURCES (sources), NULL);
+ 
+   if (!sources->priv->task_sources.loaded)
+     {
+-      calendar_sources_load_sources (sources,
+-				     &sources->priv->task_sources,
+-				     CALENDAR_SOURCES_TASK_SOURCES_KEY,
+-				     CALENDAR_SOURCES_SELECTED_TASK_SOURCES_KEY,
+-				     CALENDAR_SOURCES_SELECTED_TASK_SOURCES_DIR);
++      calendar_sources_load_esource_list (sources->priv->registry,
++                                          &sources->priv->task_sources);
++      sources->priv->task_sources.loaded = TRUE;
+     }
+ 
+-  return sources->priv->task_sources.clients;
++  list = g_hash_table_get_values (sources->priv->task_sources.clients);
++
++  for (link = list; link != NULL; link = g_list_next (link))
++    link->data = ((ClientData *) link->data)->client;
++
++  return list;
+ }
+--- a/applets/clock/calendar-sources.h
++++ b/applets/clock/calendar-sources.h
+@@ -58,8 +58,8 @@
+ 
+ GType            calendar_sources_get_type                (void) G_GNUC_CONST;
+ CalendarSources *calendar_sources_get                     (void);
+-GSList          *calendar_sources_get_appointment_sources (CalendarSources *sources);
+-GSList          *calendar_sources_get_task_sources        (CalendarSources *sources);
++GList           *calendar_sources_get_appointment_clients (CalendarSources *sources);
++GList           *calendar_sources_get_task_clients        (CalendarSources *sources);
+ 
+ G_END_DECLS
+ 
+--- a/applets/clock/calendar-window.c
++++ b/applets/clock/calendar-window.c
+@@ -961,9 +961,9 @@
+                                                   appointment->start_time,
+                                                   year, month, day);
+ 
+-                if (g_ascii_strcasecmp (appointment->uri, "weather") == 0)
++                if (g_ascii_strcasecmp (appointment->backend_name, "weather") == 0)
+                         type = APPOINTMENT_TYPE_WEATHER;
+-                else if (g_ascii_strcasecmp (appointment->uri, "contacts") == 0)
++                else if (g_ascii_strcasecmp (appointment->backend_name, "contacts") == 0)
+                         type = APPOINTMENT_TYPE_BIRTHDAY;
+                 else
+                         type = APPOINTMENT_TYPE_APPOINTMENT;
+--- a/applets/clock/clock.c
++++ b/applets/clock/clock.c
+@@ -57,10 +57,6 @@
+ #include <libgweather/location-entry.h>
+ #include <libgweather/timezone-menu.h>
+ 
+-#ifdef HAVE_LIBECAL
+-#include <libedataserverui/e-passwords.h>
+-#endif
+-
+ #include "clock.h"
+ 
+ #include "calendar-window.h"
+@@ -190,10 +186,6 @@
+ 	guint listeners [N_GCONF_PREFS];
+ };
+ 
+-/* Used to count the number of clock instances. It's there to know when we
+- * should free resources that are shared. */
+-static int clock_numbers = 0;
+-
+ static void  update_clock (ClockData * cd);
+ static void  update_tooltip (ClockData * cd);
+ static void  update_panel_weather (ClockData *cd);
+@@ -791,13 +783,6 @@
+ 	}
+ 
+ 	g_free (cd);
+-
+-#ifdef HAVE_LIBECAL
+-	if (clock_numbers > 0) {
+-		e_passwords_shutdown ();
+-		clock_numbers--;
+-	}
+-#endif
+ }
+ 
+ static gboolean
+@@ -1384,11 +1369,6 @@
+ static void
+ create_clock_widget (ClockData *cd)
+ {
+-#ifdef HAVE_LIBECAL
+-	clock_numbers++;
+-	e_passwords_init ();
+-#endif
+-
+         /* Main toggle button */
+         cd->panel_button = create_main_clock_button ();
+ 	g_signal_connect (cd->panel_button, "button_press_event",
+--- a/configure.ac
++++ b/configure.ac
+@@ -72,9 +72,8 @@
+ GCONF_REQUIRED=2.6.1
+ LIBGNOME_MENU_REQUIRED=3.1.4
+ TELEPATHY_GLIB_REQUIRED=0.14.0
+-LIBECAL_REQUIRED=2.91.2
+-LIBEDATASERVER_REQUIRED=2.91.2
+-LIBEDATASERVERUI_REQUIRED=2.91.2
++LIBECAL_REQUIRED=3.5.3
++LIBEDATASERVER_REQUIRED=3.5.3
+ CAIRO_REQUIRED=1.0.0
+ GWEATHER_REQUIRED=2.91.0
+ DBUS_GLIB_REQUIRED=0.80
+@@ -124,14 +123,14 @@
+ LIBECAL_REQUIREMENT=
+ HAVE_EDS=no
+ if test "x$enable_eds" = "xyes"; then
+-  LIBECAL_REQUIREMENT="libecal-1.2 >= $LIBECAL_REQUIRED libedataserver-1.2 >= $LIBEDATASERVER_REQUIRED libedataserverui-3.0 >= $LIBEDATASERVERUI_REQUIRED gnome-desktop-3.0 >= $LIBGNOME_DESKTOP_REQUIRED"
++  LIBECAL_REQUIREMENT="libecal-1.2 >= $LIBECAL_REQUIRED libedataserver-1.2 >= $LIBEDATASERVER_REQUIRED gnome-desktop-3.0 >= $LIBGNOME_DESKTOP_REQUIRED"
+   CLOCK_EDS_ICONDIR=`$PKG_CONFIG --variable=datadir evolution-data-server-1.2`/pixmaps/evolution-data-server
+ else
+   if test "x$enable_eds" != "xno"; then
+     AC_MSG_CHECKING(for evolution-data-server)
+-    if $PKG_CONFIG --exists libecal-1.2 libedataserverui-3.0 evolution-data-server-1.2; then
++    if $PKG_CONFIG --exists libecal-1.2 evolution-data-server-1.2; then
+        AC_MSG_RESULT(yes)
+-       LIBECAL_REQUIREMENT="libecal-1.2 >= $LIBECAL_REQUIRED libedataserver-1.2 >= $LIBEDATASERVER_REQUIRED libedataserverui-3.0 >= $LIBEDATASERVERUI_REQUIRED gnome-desktop-3.0 >= $LIBGNOME_DESKTOP_REQUIRED"
++       LIBECAL_REQUIREMENT="libecal-1.2 >= $LIBECAL_REQUIRED libedataserver-1.2 >= $LIBEDATASERVER_REQUIRED gnome-desktop-3.0 >= $LIBGNOME_DESKTOP_REQUIRED"
+        CLOCK_EDS_ICONDIR=`$PKG_CONFIG --variable=datadir evolution-data-server-1.2`/pixmaps/evolution-data-server
+        HAVE_EDS=yes
+     else
+@@ -141,7 +140,7 @@
+ fi
+ if test -n "$LIBECAL_REQUIREMENT"; then
+   AC_DEFINE([HAVE_LIBECAL], 1,
+-            [Defined when evolution-data-server libecal-1.2 and libedataserverui-3.0 are detected])
++            [Defined when evolution-data-server and libecal-1.2 are detected])
+ fi
+ AM_CONDITIONAL(HAVE_LIBECAL, test -n "$LIBECAL_REQUIREMENT")
+ AC_SUBST(CLOCK_EDS_ICONDIR)

Added: desktop/unstable/gnome-panel/debian/patches/clock-applet-modern-gnome-tech.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-panel/debian/patches/clock-applet-modern-gnome-tech.patch?rev=39559&op=file
==============================================================================
--- desktop/unstable/gnome-panel/debian/patches/clock-applet-modern-gnome-tech.patch	(added)
+++ desktop/unstable/gnome-panel/debian/patches/clock-applet-modern-gnome-tech.patch	[utf-8] Tue Sep 17 14:32:48 2013
@@ -0,0 +1,4577 @@
+From cd1a0db671b6eb57efcf2770287882e625ae1753 Mon Sep 17 00:00:00 2001
+From: Giovanni Campagna <gcampagna at src.gnome.org>
+Date: Mon, 05 Mar 2012 21:44:35 +0000
+Subject: Clock Applet: port to modern GNOME technologies
+
+This is a big commit that updates the Clock Applet to use modern
+libraries. This includes using GSettings instead of GConf, using
+GDateTime instead of the equivalents from libc and using the new
+API in libgweather.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=677512
+---
+--- a/applets/clock/Makefile.am
++++ b/applets/clock/Makefile.am
+@@ -169,28 +169,8 @@
+ clock-resources.h: clock.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/clock.gresource.xml)
+ 	$(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate --c-name clock $<
+ 
+-schemasdir       = $(GCONF_SCHEMA_FILE_DIR)
+-schemas_in_files = clock.schemas.in
+-schemas_DATA     = $(schemas_in_files:.schemas.in=.schemas)
+-
+- at INTLTOOL_SCHEMAS_RULE@
+-
+-if GCONF_SCHEMAS_INSTALL
+-install-data-local:
+-	if test -z "$(DESTDIR)" ; then \
+-		for p in $(schemas_DATA) ; do \
+-			GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(top_builddir)/applets/clock/$$p ; \
+-		done \
+-	fi
+-uninstall-local:
+-	for p in $(schema_DATA) ; do \
+-		GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-uninstall-rule $(top_builddir)/applets/clock/$$p ; \
+-	done
+-endif
+-
+ EXTRA_DIST =						\
+ 	org.gnome.panel.ClockApplet.panel-applet.in.in	\
+-	$(schemas_in_files)				\
+ 	$(ui_FILES)					\
+ 	clock.gresource.xml				\
+ 	clock-marshallers.list				\
+@@ -201,7 +181,6 @@
+ 	$(applet_DATA) 		\
+ 	$(applet_DATA).in	\
+ 	$(service_DATA)		\
+-	$(schemas_DATA)		\
+ 	$(polkit_DATA)		\
+ 	$(dbus_services_DATA)
+ 
+--- a/applets/clock/calendar-window.c
++++ b/applets/clock/calendar-window.c
+@@ -40,7 +40,7 @@
+ #include <string.h>
+ 
+ #include <glib/gi18n.h>
+-#include <gconf/gconf-client.h>
++#include <gio/gio.h>
+ 
+ #define GNOME_DESKTOP_USE_UNSTABLE_API
+ #include <libgnome-desktop/gnome-desktop-utils.h>
+@@ -56,19 +56,15 @@
+ 
+ #define CALENDAR_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CALENDAR_TYPE_WINDOW, CalendarWindowPrivate))
+ 
+-#define KEY_LOCATIONS_EXPANDED      "expand_locations"
++#define KEY_LOCATIONS_EXPANDED      "expand-locations"
+ #ifdef HAVE_LIBECAL
+-/* For the following value, take into account the KEY_* that are not inside this #ifdef! */
+-#  define N_CALENDAR_WINDOW_GCONF_PREFS 5
+-#  define KEY_APPOINTMENTS_EXPANDED "expand_appointments"
+-#  define KEY_BIRTHDAYS_EXPANDED    "expand_birthdays"
+-#  define KEY_TASKS_EXPANDED        "expand_tasks"
+-#  define KEY_WEATHER_EXPANDED      "expand_weather"
++#  define KEY_APPOINTMENTS_EXPANDED "expand-appointments"
++#  define KEY_BIRTHDAYS_EXPANDED    "expand-birthdays"
++#  define KEY_TASKS_EXPANDED        "expand-tasks"
++#  define KEY_WEATHER_EXPANDED      "expand-weather"
+ 
+ #  define SCHEMA_CALENDAR_APP       "org.gnome.desktop.default-applications.office.calendar"
+ #  define SCHEMA_TASKS_APP          "org.gnome.desktop.default-applications.office.tasks"
+-#else
+-#  define N_CALENDAR_WINDOW_GCONF_PREFS 1
+ #endif
+ 
+ enum {
+@@ -81,18 +77,17 @@
+ struct _CalendarWindowPrivate {
+ 	GtkWidget  *calendar;
+ 
+-	char       *prefs_dir;
++	GSettings  *settings;
+ 
+ 	gboolean     invert_order;
+ 	gboolean     show_weeks;
+-	time_t      *current_time;
+ 
+ 	gboolean     locked_down;
+ 
+ 	GtkWidget *locations_list;
+ 
+ #ifdef HAVE_LIBECAL
+-	ClockFormat  time_format;
++	GDesktopClockFormat time_format;
+ 
+         CalendarClient *client;
+ 
+@@ -110,8 +105,6 @@
+         GtkTreeModelFilter *birthdays_filter;
+         GtkTreeModelFilter *tasks_filter;
+         GtkTreeModelFilter *weather_filter;
+-
+-	GConfClient *gconfclient;
+ #endif /* HAVE_LIBECAL */
+ };
+ 
+@@ -121,20 +114,13 @@
+ 	PROP_0,
+ 	PROP_INVERTORDER,
+ 	PROP_SHOWWEEKS,
+-#ifdef HAVE_LIBECAL
+-	PROP_TIMEFORMAT,
+-#endif
+-	PROP_CURRENTTIMEP,
+-	PROP_PREFSDIR,
++	PROP_SETTINGS,
+ 	PROP_LOCKEDDOWN
+ };
+ 
+-static time_t *calendar_window_get_current_time_p (CalendarWindow *calwin);
+-static void    calendar_window_set_current_time_p (CalendarWindow *calwin,
+-						   time_t         *current_time);
+-static const char *calendar_window_get_prefs_dir  (CalendarWindow *calwin);
+-static void    calendar_window_set_prefs_dir      (CalendarWindow *calwin,
+-						   const char     *prefs_dir);
++static GSettings *calendar_window_get_settings   (CalendarWindow *calwin);
++static void    calendar_window_set_settings      (CalendarWindow *calwin,
++						  GSettings      *settings);
+ static gboolean calendar_window_get_locked_down   (CalendarWindow *calwin);
+ static void    calendar_window_set_locked_down    (CalendarWindow *calwin,
+ 						   gboolean        locked_down);
+@@ -296,7 +282,7 @@
+ };
+ 
+ static char *
+-format_time (ClockFormat format,
++format_time (GDesktopClockFormat format,
+              time_t      t,
+              guint       year,
+              guint       month,
+@@ -316,7 +302,7 @@
+         if (year  == (tm->tm_year + 1900) &&
+             month == tm->tm_mon &&
+             day   == tm->tm_mday) {
+-                if (format == CLOCK_FORMAT_12)
++                if (format == G_DESKTOP_CLOCK_FORMAT_12H)
+ 			/* Translators: This is a strftime format string.
+ 			 * It is used to display the time in 12-hours format
+ 			 * (eg, like in the US: 8:10 am). The %p expands to
+@@ -479,23 +465,30 @@
+ {
+         gint64   start_time64;
+         gint64   completed_time64;
+-        time_t   start_time;
+-        time_t   completed_time;
+-        time_t   one_day_ago;
++	GDateTime *start_time;
++	GDateTime *completed_time;
++	GDateTime *one_day_ago;
++	GDateTime *current_time;
+         gboolean visible;
+ 
+         gtk_tree_model_get (model, iter,
+                             TASK_COLUMN_START_TIME,     &start_time64,
+                             TASK_COLUMN_COMPLETED_TIME, &completed_time64,
+                             -1);
+-        start_time = start_time64;
+-        completed_time = completed_time64;
+ 
+-        one_day_ago = *(calwin->priv->current_time) - (24 * 60 * 60);
++	current_time = g_date_time_new_now_local ();
++        start_time = g_date_time_new_from_unix_local (start_time64);
++        completed_time = g_date_time_new_from_unix_local (completed_time64);
++        one_day_ago = g_date_time_add_days (completed_time, -1);
+ 
+-        visible = !start_time || start_time <= *(calwin->priv->current_time);
++        visible = g_date_time_compare (start_time, current_time) <= 0;
+         if (visible)
+-                visible = !completed_time || completed_time >= one_day_ago;
++		visible = g_date_time_compare (completed_time, one_day_ago) >= 0;
++
++	g_date_time_unref (start_time);
++	g_date_time_unref (completed_time);
++	g_date_time_unref (one_day_ago);
++	g_date_time_unref (current_time);
+ 
+         return visible;
+ }
+@@ -509,6 +502,7 @@
+ {
+         gint64          due_time64;
+         time_t          due_time;
++	time_t          current_time;
+         PangoAttrList  *attr_list;
+         PangoAttribute *attr;
+         GtkTreeIter     child_iter;
+@@ -530,7 +524,8 @@
+                             -1);
+         due_time = due_time64;
+ 
+-        if (due_time && due_time > *(calwin->priv->current_time))
++	current_time = time(NULL);
++        if (due_time && due_time > current_time)
+                 return;
+ 
+         attr_list = pango_attr_list_new ();
+@@ -1305,78 +1300,6 @@
+ 	gtk_widget_set_size_request (widget, req.width, req_height);
+ }
+ 
+-static void
+-expander_activated (GtkExpander    *expander,
+-		    CalendarWindow *calwin)
+-{
+-	const char *key;
+-
+-	key = (const gchar*)g_object_get_data (G_OBJECT (expander), "gconf-key");
+-
+-	if (gconf_client_key_is_writable (calwin->priv->gconfclient,
+-					  key, NULL)) {
+-		gconf_client_set_bool (calwin->priv->gconfclient, key,
+-				       gtk_expander_get_expanded (expander),
+-				       NULL);
+-	}
+-}
+-
+-static void
+-expanded_changed (GConfClient  *client,
+-		  guint         cnxn_id,
+-		  GConfEntry   *entry,
+-		  GtkExpander  *expander)
+-{
+-	gboolean value;
+-
+-	if (!entry->value || entry->value->type != GCONF_VALUE_BOOL)
+-		return;
+-
+-	value = gconf_value_get_bool (entry->value);
+-
+-	gtk_expander_set_expanded (expander, value);
+-}
+-
+-static void
+-remove_listener (gpointer data)
+-{
+-	GConfClient *client;
+-
+-	client = gconf_client_get_default ();
+-	gconf_client_notify_remove (client, GPOINTER_TO_UINT (data));
+-	g_object_unref (client);
+-}
+-
+-static void
+-connect_expander_with_gconf (CalendarWindow *calwin,
+-			     GtkWidget      *expander,
+-			     const char     *relative_key)
+-{
+-	char     *key;
+-	gboolean  expanded;
+-	guint      listener;
+-
+-	key = g_strdup_printf ("%s/%s",
+-			       calwin->priv->prefs_dir, relative_key);
+-
+-	g_object_set_data_full (G_OBJECT (expander), "gconf-key", (gpointer)key, g_free);
+-
+-	expanded = gconf_client_get_bool (calwin->priv->gconfclient, key,
+-					  NULL);
+-	gtk_expander_set_expanded (GTK_EXPANDER (expander), expanded);
+-
+-	g_signal_connect_after (expander, "activate",
+-				G_CALLBACK (expander_activated),
+-				calwin);
+-
+-	listener = gconf_client_notify_add (
+-				calwin->priv->gconfclient, key,
+-				(GConfClientNotifyFunc) expanded_changed,
+-				expander, NULL, NULL);
+-
+-        g_object_set_data_full (G_OBJECT (expander), "listener-id",
+-                                GUINT_TO_POINTER (listener), remove_listener);
+-}
+ #endif /* HAVE_LIBECAL */
+ 
+ static void
+@@ -1490,7 +1413,7 @@
+ {
+ 	GtkWidget                 *calendar;
+ 	GtkCalendarDisplayOptions  options;
+-        struct tm                 *tm;
++	GDateTime                 *now;
+ 
+ 	calendar = gtk_calendar_new ();
+ 	options = gtk_calendar_get_display_options (GTK_CALENDAR (calendar));
+@@ -1500,12 +1423,15 @@
+ 		options &= ~(GTK_CALENDAR_SHOW_WEEK_NUMBERS);
+ 	gtk_calendar_set_display_options (GTK_CALENDAR (calendar), options);
+ 
+-	tm = localtime (calwin->priv->current_time);
++	now = g_date_time_new_now_local ();
+ 
+         gtk_calendar_select_month (GTK_CALENDAR (calendar),
+-                                   tm->tm_mon,
+-                                   tm->tm_year + 1900);
+-        gtk_calendar_select_day (GTK_CALENDAR (calendar), tm->tm_mday);
++                                   g_date_time_get_month (now),
++                                   g_date_time_get_year (now));
++        gtk_calendar_select_day (GTK_CALENDAR (calendar),
++				 g_date_time_get_day_of_month (now));
++
++	g_date_time_unref (now);
+ 
+ 	return calendar;
+ }
+@@ -1605,7 +1531,8 @@
+         }
+ 
+ #ifdef HAVE_LIBECAL
+-	connect_expander_with_gconf (calwin, expander, key);
++	g_settings_bind (calwin->priv->settings, key, expander, "expanded",
++			 G_SETTINGS_BIND_DEFAULT);
+ #endif
+ 
+         return vbox;
+@@ -1687,8 +1614,7 @@
+ 
+ 	calwin = CALENDAR_WINDOW (obj);
+ 
+-	g_assert (calwin->priv->current_time != NULL);
+-	g_assert (calwin->priv->prefs_dir != NULL);
++	g_assert (calwin->priv->settings != NULL);
+ 
+ 	calendar_window_fill (calwin);
+ 
+@@ -1716,19 +1642,9 @@
+ 		g_value_set_boolean (value,
+ 				     calendar_window_get_show_weeks (calwin));
+ 		break;
+-#ifdef HAVE_LIBECAL
+-	case PROP_TIMEFORMAT:
+-		g_value_set_enum (value,
+-				  calendar_window_get_time_format (calwin));
+-		break;
+-#endif
+-	case PROP_CURRENTTIMEP:
+-		g_value_set_pointer (value,
+-				     calendar_window_get_current_time_p (calwin));
+-		break;
+-	case PROP_PREFSDIR:
+-		g_value_set_string (value,
+-				    calendar_window_get_prefs_dir (calwin));
++	case PROP_SETTINGS:
++		g_value_set_object (value,
++				    calendar_window_get_settings (calwin));
+ 		break;
+ 	case PROP_LOCKEDDOWN:
+ 		g_value_set_boolean (value,
+@@ -1761,19 +1677,9 @@
+ 		calendar_window_set_show_weeks (calwin,
+ 						g_value_get_boolean (value));
+ 		break;
+-#ifdef HAVE_LIBECAL
+-	case PROP_TIMEFORMAT:
+-		calendar_window_set_time_format (calwin,
+-						 g_value_get_enum (value));
+-		break;
+-#endif
+-	case PROP_CURRENTTIMEP:
+-		calendar_window_set_current_time_p (calwin,
+-						    g_value_get_pointer (value));
+-		break;
+-	case PROP_PREFSDIR:
+-		calendar_window_set_prefs_dir (calwin,
+-					       g_value_get_string (value));
++	case PROP_SETTINGS:
++		calendar_window_set_settings (calwin,
++					      g_value_get_object (value));
+ 		break;
+ 	case PROP_LOCKEDDOWN:
+ 		calendar_window_set_locked_down (calwin,
+@@ -1821,9 +1727,7 @@
+                 g_object_unref (calwin->priv->weather_filter);
+         calwin->priv->weather_filter = NULL;
+ 
+-	if (calwin->priv->gconfclient)
+-		g_object_unref (calwin->priv->gconfclient);
+-	calwin->priv->gconfclient = NULL;
++	g_clear_object (&calwin->priv->settings);
+ #endif /* HAVE_LIBECAL */
+ 
+ 	G_OBJECT_CLASS (calendar_window_parent_class)->dispose (object);
+@@ -1868,33 +1772,13 @@
+ 				      FALSE,
+ 				      G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+ 
+-#ifdef HAVE_LIBECAL
+-	g_object_class_install_property (
+-		gobject_class,
+-		PROP_TIMEFORMAT,
+-		g_param_spec_enum ("time-format",
+-				   "Time Format",
+-				   "Time format used to display time",
+-				   CLOCK_TYPE_FORMAT,
+-				   clock_locale_format (),
+-				   G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+-#endif
+-
+ 	g_object_class_install_property (
+ 		gobject_class,
+-		PROP_CURRENTTIMEP,
+-		g_param_spec_pointer ("current-time",
+-				      "Current Time",
+-				      "Pointer to a variable containing the current time",
+-				      G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+-
+-	g_object_class_install_property (
+-		gobject_class,
+-		PROP_PREFSDIR,
+-		g_param_spec_string ("prefs-dir",
+-				     "Preferences Directory",
+-				     "Preferences directory in GConf",
+-				     NULL,
++		PROP_SETTINGS,
++		g_param_spec_object ("settings",
++				     "Applet settings",
++				     "",
++				     G_TYPE_SETTINGS,
+ 				     G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ 
+ 	g_object_class_install_property (
+@@ -1924,22 +1808,19 @@
+ 
+ #ifdef HAVE_LIBECAL
+ 	calwin->priv->previous_selection = NULL;
+-	calwin->priv->gconfclient = gconf_client_get_default ();
+ #endif
+ }
+ 
+ GtkWidget *
+-calendar_window_new (time_t     *static_current_time,
+-		     const char *prefs_dir,
++calendar_window_new (GSettings  *applet_settings,
+ 		     gboolean    invert_order)
+ {
+ 	CalendarWindow *calwin;
+ 
+ 	calwin = g_object_new (CALENDAR_TYPE_WINDOW,
+ 			       "type", GTK_WINDOW_TOPLEVEL,
+-			       "current-time", static_current_time,
+ 			       "invert-order", invert_order,
+-			       "prefs-dir", prefs_dir,
++			       "settings", applet_settings,
+ 			       NULL);
+ 
+ 	return GTK_WIDGET (calwin);
+@@ -2021,27 +1902,28 @@
+ 	g_object_notify (G_OBJECT (calwin), "show-weeks");
+ }
+ 
+-ClockFormat
++GDesktopClockFormat
+ calendar_window_get_time_format (CalendarWindow *calwin)
+ {
+ 	g_return_val_if_fail (CALENDAR_IS_WINDOW (calwin),
+-			      CLOCK_FORMAT_INVALID);
++			      G_DESKTOP_CLOCK_FORMAT_24H);
+ 
+ #ifdef HAVE_LIBECAL
+ 	return calwin->priv->time_format;
+ #else
+-	return CLOCK_FORMAT_INVALID;
++	return G_DESKTOP_CLOCK_FORMAT_24H;
+ #endif
+ }
+ 
+ void
+-calendar_window_set_time_format (CalendarWindow *calwin,
+-				 ClockFormat     time_format)
++calendar_window_set_time_format (CalendarWindow      *calwin,
++				 GDesktopClockFormat  time_format)
+ {
+ 	g_return_if_fail (CALENDAR_IS_WINDOW (calwin));
+ 
+ #ifdef HAVE_LIBECAL
+-	if (time_format != CLOCK_FORMAT_12 && time_format != CLOCK_FORMAT_24)
++	if (time_format != G_DESKTOP_CLOCK_FORMAT_12H &&
++	    time_format != G_DESKTOP_CLOCK_FORMAT_24H)
+ 		time_format = clock_locale_format ();
+ 
+ 	if (time_format == calwin->priv->time_format)
+@@ -2051,62 +1933,26 @@
+ 	/* Time to display for appointments has changed */
+ 	if (calwin->priv->appointments_model)
+ 		handle_appointments_changed (calwin);
+-
+-	g_object_notify (G_OBJECT (calwin), "time-format");
+ #endif
+ }
+ 
+-static time_t *
+-calendar_window_get_current_time_p (CalendarWindow *calwin)
+-{
+-	g_return_val_if_fail (CALENDAR_IS_WINDOW (calwin), NULL);
+-
+-	return calwin->priv->current_time;
+-}
+-
+-static void
+-calendar_window_set_current_time_p (CalendarWindow *calwin,
+-				    time_t         *current_time)
+-{
+-	g_return_if_fail (CALENDAR_IS_WINDOW (calwin));
+-
+-	if (current_time == calwin->priv->current_time)
+-		return;
+-
+-	calwin->priv->current_time = current_time;
+-
+-	g_object_notify (G_OBJECT (calwin), "current-time");
+-}
+-
+-static const char *
+-calendar_window_get_prefs_dir (CalendarWindow *calwin)
++static GSettings *
++calendar_window_get_settings (CalendarWindow *calwin)
+ {
+ 	g_return_val_if_fail (CALENDAR_IS_WINDOW (calwin), NULL);
+ 
+-	return calwin->priv->prefs_dir;
++	return calwin->priv->settings;
+ }
+ 
+ static void
+-calendar_window_set_prefs_dir (CalendarWindow *calwin,
+-			       const char     *prefs_dir)
++calendar_window_set_settings (CalendarWindow *calwin,
++			      GSettings      *settings)
+ {
+ 	g_return_if_fail (CALENDAR_IS_WINDOW (calwin));
+ 
+-	if (!calwin->priv->prefs_dir && (!prefs_dir || !prefs_dir [0]))
+-		return;
+-
+-	if (calwin->priv->prefs_dir && prefs_dir && prefs_dir [0] &&
+-	    !strcmp (calwin->priv->prefs_dir, prefs_dir))
+-		return;
+-
+-	if (calwin->priv->prefs_dir)
+-		g_free (calwin->priv->prefs_dir);
+-	calwin->priv->prefs_dir = NULL;
+-
+-	if (prefs_dir && prefs_dir [0])
+-		calwin->priv->prefs_dir = g_strdup (prefs_dir);
+-
+-	g_object_notify (G_OBJECT (calwin), "prefs-dir");
++	/* This only ever called once, so we can ignore the previous
++	   value. */
++	calwin->priv->settings = g_object_ref (settings);
+ }
+ 
+ static gboolean
+--- a/applets/clock/calendar-window.h
++++ b/applets/clock/calendar-window.h
+@@ -29,6 +29,9 @@
+ #define CALENDAR_WINDOW_H
+ 
+ #include <gtk/gtk.h>
++#include <gio/gio.h>
++#include <gdesktop-enums.h>
++
+ #include "clock-utils.h"
+ 
+ G_BEGIN_DECLS
+@@ -57,8 +60,7 @@
+ };
+ 
+ GType      calendar_window_get_type (void) G_GNUC_CONST;
+-GtkWidget *calendar_window_new      (time_t     *static_current_time,
+-				     const char *prefs_dir,
++GtkWidget *calendar_window_new      (GSettings  *applet_settings,
+ 				     gboolean    invert_order);
+ 
+ void       calendar_window_refresh  (CalendarWindow *calwin);
+@@ -71,9 +73,9 @@
+ gboolean   calendar_window_get_show_weeks   (CalendarWindow *calwin);
+ void       calendar_window_set_show_weeks   (CalendarWindow *calwin,
+ 					     gboolean        show_weeks);
+-ClockFormat calendar_window_get_time_format (CalendarWindow *calwin);
+-void       calendar_window_set_time_format  (CalendarWindow *calwin,
+-					     ClockFormat     time_format);
++GDesktopClockFormat calendar_window_get_time_format (CalendarWindow      *calwin);
++void                calendar_window_set_time_format (CalendarWindow      *calwin,
++						     GDesktopClockFormat  time_format);
+ 
+ G_END_DECLS
+ 
+--- a/applets/clock/clock-face.c
++++ b/applets/clock/clock-face.c
+@@ -51,7 +51,7 @@
+ 
+ struct _ClockFacePrivate
+ {
+-        struct tm time; /* the time on the clock face */
++	GDateTime *time; /* the time on the clock face */
+         int minute_offset; /* the offset of the minutes hand */
+ 
+         ClockFaceSize size;
+@@ -137,9 +137,9 @@
+         }
+ 
+         /* clock hands */
+-        hours = priv->time.tm_hour;
+-        minutes = priv->time.tm_min + priv->minute_offset;
+-        seconds = priv->time.tm_sec;
++        hours = g_date_time_get_hour (priv->time);
++        minutes = g_date_time_get_minute (priv->time) + priv->minute_offset;
++        seconds = g_date_time_get_seconds (priv->time);
+ 
+         cairo_set_line_width (cr, 1);
+ 
+@@ -280,17 +280,17 @@
+ {
+         ClockFacePrivate *priv;
+ 	ClockFaceTimeOfDay timeofday;
++	int hour;
+ 
+         priv = this->priv;
+ 
++	if (priv->time)
++		g_date_time_unref (priv->time);
+         /* update the time */
+-        if (priv->location) {
+-                clock_location_localtime (priv->location, &priv->time);
+-        } else {
+-                time_t timet;
+-                time (&timet);
+-                localtime_r (&timet, &priv->time);
+-        }
++        if (priv->location)
++                priv->time = clock_location_localtime (priv->location);
++	else
++		priv->time = g_date_time_new_now_local ();
+ 
+ 	/* FIXME  this should be a gconf setting
+          * Or we could use some code from clock-sun.c?
+@@ -300,13 +300,14 @@
+          * evening 17-22
+          * night 22-7
+          */
+-	if (priv->time.tm_hour < 7)
++	hour = g_date_time_get_hour (priv->time);
++	if (hour < 7)
+ 		timeofday = CLOCK_FACE_NIGHT;
+-	else if (priv->time.tm_hour < 9)
++	else if (hour < 9)
+ 		timeofday = CLOCK_FACE_MORNING;
+-	else if (priv->time.tm_hour < 17)
++	else if (hour < 17)
+ 		timeofday = CLOCK_FACE_DAY;
+-	else if (priv->time.tm_hour < 22)
++	else if (hour < 22)
+ 		timeofday = CLOCK_FACE_EVENING;
+ 	else
+ 		timeofday = CLOCK_FACE_NIGHT;
+--- a/applets/clock/clock-location-tile.c
++++ b/applets/clock/clock-location-tile.c
+@@ -30,7 +30,7 @@
+ typedef struct {
+         ClockLocation *location;
+ 
+-        struct tm last_refresh;
++        GDateTime *last_refresh;
+ 	long last_offset;
+ 
+         ClockFaceSize size;
+@@ -57,7 +57,7 @@
+ #define PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CLOCK_LOCATION_TILE_TYPE, ClockLocationTilePrivate))
+ 
+ static void clock_location_tile_fill (ClockLocationTile *this);
+-static void update_weather_icon (ClockLocation *loc, WeatherInfo *info, gpointer data);
++static void update_weather_icon (ClockLocation *loc, GWeatherInfo *info, gpointer data);
+ static gboolean weather_tooltip (GtkWidget *widget,
+                                  gint x, gint y,
+ 		                 gboolean    keyboard_mode,
+@@ -124,7 +124,7 @@
+ 
+         priv->location = NULL;
+ 
+-        memset (&(priv->last_refresh), 0, sizeof (struct tm));
++	priv->last_refresh = NULL;
+ 	priv->last_offset = 0;
+ 
+         priv->size = CLOCK_FACE_SMALL;
+@@ -139,6 +139,11 @@
+ {
+         ClockLocationTilePrivate *priv = PRIVATE (g_obj);
+ 
++	if (priv->last_refresh) {
++		g_date_time_unref (priv->last_refresh);
++		priv->last_refresh = NULL;
++	}
++
+         if (priv->location) {
+ 		g_signal_handler_disconnect (priv->location, priv->location_weather_updated_id);
+ 		priv->location_weather_updated_id = 0;
+@@ -361,80 +366,74 @@
+ clock_needs_face_refresh (ClockLocationTile *this)
+ {
+         ClockLocationTilePrivate *priv = PRIVATE (this);
+-        struct tm now;
++        GDateTime *now;
++	gboolean retval;
+ 
+-        clock_location_localtime (priv->location, &now);
++	if (!priv->last_refresh)
++		return TRUE;
+ 
+-        if (now.tm_year > priv->last_refresh.tm_year
+-            || now.tm_mon > priv->last_refresh.tm_mon
+-            || now.tm_mday > priv->last_refresh.tm_mday
+-            || now.tm_hour > priv->last_refresh.tm_hour
+-            || now.tm_min > priv->last_refresh.tm_min) {
+-                return TRUE;
++        now = clock_location_localtime (priv->location);
++
++	retval = FALSE;
++        if (g_date_time_get_year (now) > g_date_time_get_year (priv->last_refresh)
++            || g_date_time_get_month (now) > g_date_time_get_month (priv->last_refresh)
++            || g_date_time_get_day_of_month (now) > g_date_time_get_day_of_month (priv->last_refresh)
++            || g_date_time_get_hour (now) > g_date_time_get_hour (priv->last_refresh)
++            || g_date_time_get_minute (now) > g_date_time_get_minute (priv->last_refresh)) {
++		retval = TRUE;
+         }
+ 
+         if ((priv->size == CLOCK_FACE_LARGE)
+-            && now.tm_sec > priv->last_refresh.tm_sec) {
+-                return TRUE;
++            && g_date_time_get_second (now) > g_date_time_get_second (priv->last_refresh)) {
++                retval = TRUE;
+         }
+ 
+-        return FALSE;
++	g_date_time_unref (now);
++	return retval;
+ }
+ 
+ static gboolean
+ clock_needs_label_refresh (ClockLocationTile *this)
+ {
+         ClockLocationTilePrivate *priv = PRIVATE (this);
+-        struct tm now;
++	GDateTime *now;
+ 	long offset;
++	gboolean retval;
+ 
+-        clock_location_localtime (priv->location, &now);
++        now = clock_location_localtime (priv->location);
+ 	offset = clock_location_get_offset (priv->location);
+ 
+-        if (now.tm_year > priv->last_refresh.tm_year
+-            || now.tm_mon > priv->last_refresh.tm_mon
+-            || now.tm_mday > priv->last_refresh.tm_mday
+-            || now.tm_hour > priv->last_refresh.tm_hour
+-            || now.tm_min > priv->last_refresh.tm_min
++	retval = FALSE;
++        if (g_date_time_get_year (now) > g_date_time_get_year (priv->last_refresh)
++            || g_date_time_get_month (now) > g_date_time_get_month (priv->last_refresh)
++            || g_date_time_get_day_of_month (now) > g_date_time_get_day_of_month (priv->last_refresh)
++            || g_date_time_get_hour (now) > g_date_time_get_hour (priv->last_refresh)
++            || g_date_time_get_minute (now) > g_date_time_get_minute (priv->last_refresh)
+ 	    || offset != priv->last_offset) {
+-                return TRUE;
++		retval = TRUE;
+         }
+ 
+-        return FALSE;
+-}
+-
+-static void
+-copy_tm (struct tm *from, struct tm *to)
+-{
+-        to->tm_sec = from->tm_sec;
+-        to->tm_min = from->tm_min;
+-        to->tm_hour = from->tm_hour;
+-        to->tm_mday = from->tm_mday;
+-        to->tm_mon = from->tm_mon;
+-        to->tm_year = from->tm_year;
+-        to->tm_wday = from->tm_wday;
+-        to->tm_yday = from->tm_yday;
++	g_date_time_unref (now);
++        return retval;
+ }
+ 
+ static char *
+-format_time (struct tm   *now, 
+-             char        *tzname,
+-             ClockFormat  clock_format,
++format_time (GDateTime   *now, 
++             const char  *tzname,
++             GDesktopClockFormat  clock_format,
+ 	     long         offset)
+ {
+-	char buf[256];
+-	char *format;
+-	time_t local_t;
+-	struct tm local_now;
+-	char *utf8;	
++	const char *format;
++	GDateTime *local_now;
++	char *buf;	
+ 	char *tmp;	
+ 	long hours, minutes;
+ 
+-	time (&local_t);
+-	localtime_r (&local_t, &local_now);
++	local_now = g_date_time_new_now_local ();
+ 
+-	if (local_now.tm_wday != now->tm_wday) {
+-		if (clock_format == CLOCK_FORMAT_12) {
++	if (g_date_time_get_day_of_week (local_now) !=
++	    g_date_time_get_day_of_week (now)) {
++		if (clock_format == G_DESKTOP_CLOCK_FORMAT_12H) {
+ 			/* Translators: This is a strftime format string.
+ 			 * It is used to display the time in 12-hours format
+ 			 * (eg, like in the US: 8:10 am), when the local
+@@ -453,7 +452,7 @@
+ 		}
+ 	}
+ 	else {
+-		if (clock_format == CLOCK_FORMAT_12) {
++		if (clock_format == G_DESKTOP_CLOCK_FORMAT_12H) {
+ 			/* Translators: This is a strftime format string.
+ 			 * It is used to display the time in 12-hours format
+ 			 * (eg, like in the US: 8:10 am). The %p expands to
+@@ -468,10 +467,9 @@
+ 		}
+ 	}
+ 
+-	if (strftime (buf, sizeof (buf), format, now) <= 0) {
+-		strcpy (buf, "???");
+-	}
++        g_date_time_unref (local_now);
+ 
++        buf = g_date_time_format (now, format);
+         hours = offset / 3600;
+         minutes = labs (offset % 3600) / 60;
+ 
+@@ -485,21 +483,19 @@
+ 		tmp = g_strdup_printf ("%s <small>%s</small>", buf, tzname);
+ 	}
+ 
+-	utf8 = g_locale_to_utf8 (tmp, -1, NULL, NULL, NULL);
+-
+-	g_free (tmp);
+-
+-	return utf8;
++	g_free (buf);
++	return tmp;
+ }
+ 
+ static char *
+-convert_time_to_str (time_t now, ClockFormat clock_format)
++convert_time_to_str (time_t now, GDesktopClockFormat clock_format, const char *timezone)
+ {
+ 	const gchar *format;
+-	struct tm *tm;
+-	gchar buf[128];
++	GTimeZone *tz;
++	GDateTime *utc, *local;
++	char *ret;
+ 
+-	if (clock_format == CLOCK_FORMAT_12) {
++	if (clock_format == G_DESKTOP_CLOCK_FORMAT_12H) {
+                 /* Translators: This is a strftime format string.
+                  * It is used to display the time in 12-hours format (eg, like
+                  * in the US: 8:10 am). The %p expands to am/pm.
+@@ -514,18 +510,27 @@
+ 		format = _("%H:%M");
+ 	}
+ 
+-	tm = localtime (&now);
+-	strftime (buf, sizeof (buf) - 1, format, tm);
++	tz = g_time_zone_new (timezone);
++
++	utc = g_date_time_new_from_unix_utc (now);
++	local = g_date_time_to_timezone (utc, tz);
++
++	ret = g_date_time_format (local, format);
++
++	g_date_time_unref (utc);
++	g_date_time_unref (local);
++	g_time_zone_unref (tz);
+ 
+-	return g_locale_to_utf8 (buf, -1, NULL, NULL, NULL);
++	return ret;
+ }
+ 
+ void
+ clock_location_tile_refresh (ClockLocationTile *this, gboolean force_refresh)
+ {
+         ClockLocationTilePrivate *priv = PRIVATE (this);
+-        gchar *tmp, *tzname;
+-        struct tm now;
++        gchar *tmp;
++	const char *tzname;
++	GDateTime *now;
+ 	long offset;
+ 	int format;
+ 
+@@ -552,14 +557,16 @@
+                 return;
+         }
+ 
+-        clock_location_localtime (priv->location, &now);
++        now = clock_location_localtime (priv->location);
+         tzname = clock_location_get_tzname (priv->location);
+ 
+-        copy_tm (&now, &(priv->last_refresh));
++	if (priv->last_refresh)
++		g_date_time_unref (priv->last_refresh);
++	priv->last_refresh = g_date_time_ref (now);
+ 	priv->last_offset = clock_location_get_offset (priv->location);
+ 
+         tmp = g_strdup_printf ("<big><b>%s</b></big>",
+-                               clock_location_get_display_name (priv->location));
++                               clock_location_get_name (priv->location));
+         gtk_label_set_markup (GTK_LABEL (priv->city_label), tmp);
+         g_free (tmp);
+ 
+@@ -567,7 +574,7 @@
+ 
+ 	offset = - priv->last_offset;
+ 
+-	tmp = format_time (&now, tzname, format, offset);
++	tmp = format_time (now, tzname, format, offset);
+ 
+         gtk_label_set_markup (GTK_LABEL (priv->time_label), tmp);
+ 
+@@ -575,41 +582,43 @@
+ }
+ 
+ void
+-weather_info_setup_tooltip (WeatherInfo *info, ClockLocation *location, GtkTooltip *tooltip,
+-			    ClockFormat clock_format)
++weather_info_setup_tooltip (GWeatherInfo *info, ClockLocation *location, GtkTooltip *tooltip,
++			    GDesktopClockFormat clock_format)
+ {
+         GdkPixbuf *pixbuf = NULL;
+         GtkIconTheme *theme = NULL;
+-	const gchar *conditions, *wind;
++	gchar *conditions, *sky, *wind;
+ 	gchar *temp, *apparent;
+ 	gchar *line1, *line2, *line3, *line4, *tip;
+ 	const gchar *icon_name;
+-	const gchar *sys_timezone;
+ 	time_t sunrise_time, sunset_time;
+ 	gchar *sunrise_str, *sunset_str;
++	const char *timezone;
++	gdouble unused;
++	GWeatherWindDirection unused2;
+ 
+-       	icon_name = weather_info_get_icon_name (info);
++       	icon_name = gweather_info_get_icon_name (info);
+         theme = gtk_icon_theme_get_default ();
+         pixbuf = gtk_icon_theme_load_icon (theme, icon_name, 48,
+                                            GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
+         if (pixbuf)
+                 gtk_tooltip_set_icon (tooltip, pixbuf);
+ 
+-	conditions = weather_info_get_conditions (info);
+-	if (strcmp (conditions, "-") != 0)
++	conditions = gweather_info_get_conditions (info);
++	sky = gweather_info_get_sky (info);
++	if (strcmp (conditions, "-") != 0) {
+ 		line1 = g_strdup_printf (_("%s, %s"),
+-					 conditions,
+-					 weather_info_get_sky (info));
+-	else
+-		line1 = g_strdup (weather_info_get_sky (info));
++					 conditions, sky);
++		g_free (sky);
++	} else {
++		line1 = sky;
++	}
++	g_free (conditions);
+ 
+-	/* we need to g_strdup() since both functions return the same address
+-	 * of a static buffer */
+-	temp = g_strdup (weather_info_get_temp (info));
+-	apparent = g_strdup (weather_info_get_apparent (info));
++	temp = gweather_info_get_temp (info);
++	apparent = gweather_info_get_apparent (info);
+ 	if (strcmp (apparent, temp) != 0 &&
+-	    /* FMQ: it's broken to read from another module's translations; add some API to libgweather. */
+-            strcmp (apparent, dgettext ("gnome-applets-2.0", "Unknown")) != 0)
++	    gweather_info_get_value_apparent (info, GWEATHER_TEMP_UNIT_DEFAULT, &unused))
+ 		/* Translators: The two strings are temperatures. */
+ 		line2 = g_strdup_printf (_("%s, feels like %s"), temp, apparent);
+ 	else
+@@ -617,21 +626,19 @@
+ 	g_free (temp);
+ 	g_free (apparent);
+ 
+-	wind = weather_info_get_wind (info);
+-        if (strcmp (apparent, dgettext ("gnome-applets-2.0", "Unknown")) != 0)
++	wind = gweather_info_get_wind (info);
++        if (gweather_info_get_value_wind (info, GWEATHER_SPEED_UNIT_DEFAULT, &unused, &unused2))
+ 		line3 = g_strdup_printf ("%s\n", wind);
+ 	else
+ 		line3 = g_strdup ("");
+ 
+-	sys_timezone = getenv ("TZ");
+-	setenv ("TZ", clock_location_get_timezone (location), 1);
+-	tzset ();
+-	if (weather_info_get_value_sunrise (info, &sunrise_time))
+-		sunrise_str = convert_time_to_str (sunrise_time, clock_format);
++	timezone = clock_location_get_timezone (location);
++	if (gweather_info_get_value_sunrise (info, &sunrise_time))
++		sunrise_str = convert_time_to_str (sunrise_time, clock_format, timezone);
+ 	else
+ 		sunrise_str = g_strdup ("???");
+-	if (weather_info_get_value_sunset (info, &sunset_time))
+-		sunset_str = convert_time_to_str (sunset_time, clock_format);
++	if (gweather_info_get_value_sunset (info, &sunset_time))
++		sunset_str = convert_time_to_str (sunset_time, clock_format, timezone);
+ 	else
+ 		sunset_str = g_strdup ("???");
+ 	line4 = g_strdup_printf (_("Sunrise: %s / Sunset: %s"),
+@@ -639,12 +646,6 @@
+ 	g_free (sunrise_str);
+ 	g_free (sunset_str);
+ 
+-	if (sys_timezone)
+-		setenv ("TZ", sys_timezone, 1);
+-	else
+-		unsetenv ("TZ");
+-	tzset ();
+-
+ 	tip = g_strdup_printf ("<b>%s</b>\n%s\n%s%s", line1, line2, line3, line4);
+ 	gtk_tooltip_set_markup (tooltip, tip);
+ 	g_free (line1);
+@@ -664,12 +665,12 @@
+ {
+         ClockLocationTile *tile = data;
+         ClockLocationTilePrivate *priv = PRIVATE (tile);
+-	WeatherInfo *info;
++	GWeatherInfo *info;
+ 	int clock_format;
+ 
+ 	info = clock_location_get_weather_info (priv->location);
+ 
+-	if (!info || !weather_info_is_valid (info))
++	if (!info || !gweather_info_is_valid (info))
+ 		return FALSE;
+ 
+ 	g_signal_emit (tile, signals[NEED_CLOCK_FORMAT], 0, &clock_format);
+@@ -680,7 +681,7 @@
+ }
+ 
+ static void
+-update_weather_icon (ClockLocation *loc, WeatherInfo *info, gpointer data)
++update_weather_icon (ClockLocation *loc, GWeatherInfo *info, gpointer data)
+ {
+         ClockLocationTile *tile = data;
+         ClockLocationTilePrivate *priv = PRIVATE (tile);
+@@ -688,10 +689,10 @@
+         GtkIconTheme *theme = NULL;
+         const gchar *icon_name;
+ 
+-        if (!info || !weather_info_is_valid (info))
++        if (!info || !gweather_info_is_valid (info))
+                 return;
+ 
+-        icon_name = weather_info_get_icon_name (info);
++        icon_name = gweather_info_get_icon_name (info);
+         theme = gtk_icon_theme_get_default ();
+         pixbuf = gtk_icon_theme_load_icon (theme, icon_name, 16,
+                                            GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
+--- a/applets/clock/clock-location-tile.h
++++ b/applets/clock/clock-location-tile.h
+@@ -37,8 +37,8 @@
+ 
+ ClockLocation *clock_location_tile_get_location (ClockLocationTile *this);
+ 
+-void weather_info_setup_tooltip (WeatherInfo *info, ClockLocation *location, GtkTooltip *tip,
+-				 ClockFormat clock_format);
++void weather_info_setup_tooltip (GWeatherInfo *info, ClockLocation *location, GtkTooltip *tip,
++				 GDesktopClockFormat clock_format);
+ 
+ void clock_location_tile_refresh (ClockLocationTile *this,
+                                   gboolean           force_refresh);
+--- a/applets/clock/clock-location.c
++++ b/applets/clock/clock-location.c
+@@ -29,24 +29,18 @@
+ 
+ typedef struct {
+         gchar *name;
+-        gchar *city;
+ 
+-        SystemTimezone *systz;
+-
+-        gchar *timezone;
+-
+-        gchar *tzname;
++	GWeatherLocation *world;
++	GWeatherLocation *loc;
+ 
+-        gfloat latitude;
+-        gfloat longitude;
++        SystemTimezone *systz;
+ 
+-        gchar *weather_code;
+-        WeatherInfo *weather_info;
+-        guint weather_timeout;
+-        guint weather_retry_time;
++        gdouble latitude;
++        gdouble longitude;
+ 
+-	TempUnit temperature_unit;
+-	SpeedUnit speed_unit;
++        GWeatherInfo *weather_info;
++	gint          weather_timeout;
++	gint          weather_retry_time;
+ } ClockLocationPrivate;
+ 
+ #define WEATHER_TIMEOUT_BASE 30
+@@ -62,51 +56,19 @@
+ static guint location_signals[LAST_SIGNAL] = { 0 };
+ 
+ static void clock_location_finalize (GObject *);
+-static void clock_location_set_tz (ClockLocation *this);
+-static void clock_location_unset_tz (ClockLocation *this);
+ static void setup_weather_updates (ClockLocation *loc);
+ static void add_to_network_monitor (ClockLocation *loc);
+ static void remove_from_network_monitor (ClockLocation *loc);
+ 
+-static gchar *clock_location_get_valid_weather_code (const gchar *code);
+-
+ #define PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CLOCK_LOCATION_TYPE, ClockLocationPrivate))
+ 
+ ClockLocation *
+-clock_location_find_and_ref (GList       *locations,
+-                             const gchar *name,
+-                             const gchar *city,
+-                             const gchar *timezone,
+-                             gfloat       latitude,
+-                             gfloat       longitude,
+-                             const gchar *code)
+-{
+-        GList *l;
+-        ClockLocationPrivate *priv;
+-
+-        for (l = locations; l != NULL; l = l->next) {
+-                priv = PRIVATE (l->data);
+-
+-                if (priv->latitude == latitude &&
+-                    priv->longitude == longitude &&
+-                    g_strcmp0 (priv->weather_code, code) == 0 &&
+-                    g_strcmp0 (priv->timezone, timezone) == 0 &&
+-                    g_strcmp0 (priv->city, city) == 0 &&
+-                    g_strcmp0 (priv->name, name) == 0)
+-                        break;
+-        }
+-
+-        if (l != NULL)
+-                return g_object_ref (CLOCK_LOCATION (l->data));
+-        else
+-                return NULL;
+-}
+-
+-ClockLocation *
+-clock_location_new (const gchar *name, const gchar *city,
+-		    const gchar *timezone,
+-		    gfloat latitude, gfloat longitude,
+-		    const gchar *code, WeatherPrefs *prefs)
++clock_location_new (GWeatherLocation *world,
++		    const char       *name,
++		    const char       *metar_code,
++		    gboolean          override_latlon,
++		    gdouble           latitude,
++		    gdouble           longitude)
+ {
+         ClockLocation *this;
+         ClockLocationPrivate *priv;
+@@ -114,22 +76,21 @@
+         this = g_object_new (CLOCK_LOCATION_TYPE, NULL);
+         priv = PRIVATE (this);
+ 
+-        priv->name = g_strdup (name);
+-        priv->city = g_strdup (city);
+-        priv->timezone = g_strdup (timezone);
++	priv->world = gweather_location_ref (world);
++	priv->loc = gweather_location_find_by_station_code (priv->world,
++							    metar_code);
+ 
+-        /* initialize priv->tzname */
+-        clock_location_set_tz (this);
+-        clock_location_unset_tz (this);
+-
+-        priv->latitude = latitude;
+-        priv->longitude = longitude;
+-
+-        priv->weather_code = clock_location_get_valid_weather_code (code);
++	if (name && *name) {
++		priv->name = g_strdup (name);
++	} else {
++		priv->name = g_strdup (gweather_location_get_name (priv->loc));
++	}
+ 
+-	if (prefs) {
+-		priv->temperature_unit = prefs->temperature_unit;
+-		priv->speed_unit = prefs->speed_unit;
++	if (override_latlon) {
++		priv->latitude = latitude;
++		priv->longitude = longitude;
++	} else {
++		gweather_location_get_coords (priv->loc, &priv->latitude, &priv->longitude);
+ 	}
+ 
+         setup_weather_updates (this);
+@@ -172,20 +133,10 @@
+ {
+         ClockLocationPrivate *priv = PRIVATE (this);
+ 
+-        priv->name = NULL;
+-        priv->city = NULL;
+-
+         priv->systz = system_timezone_new ();
+ 
+-        priv->timezone = NULL;
+-
+-        priv->tzname = NULL;
+-
+         priv->latitude = 0;
+         priv->longitude = 0;
+-
+-	priv->temperature_unit = TEMP_UNIT_CENTIGRADE;
+-	priv->speed_unit = SPEED_UNIT_MS;
+ }
+ 
+ static void
+@@ -195,61 +146,28 @@
+ 
+ 	remove_from_network_monitor (CLOCK_LOCATION (g_obj));
+ 
+-        if (priv->name) {
+-                g_free (priv->name);
+-                priv->name = NULL;
+-        }
++	g_free (priv->name);
+ 
+-        if (priv->city) {
+-                g_free (priv->city);
+-                priv->city = NULL;
+-        }
++	gweather_location_unref (priv->world);
++	gweather_location_unref (priv->loc);
++
++	if (priv->weather_timeout)
++		g_source_remove (priv->weather_timeout);
+ 
+         if (priv->systz) {
+                 g_object_unref (priv->systz);
+                 priv->systz = NULL;
+         }
+ 
+-        if (priv->timezone) {
+-                g_free (priv->timezone);
+-                priv->timezone = NULL;
+-        }
+-
+-        if (priv->tzname) {
+-                g_free (priv->tzname);
+-                priv->tzname = NULL;
+-        }
+-
+-        if (priv->weather_code) {
+-                g_free (priv->weather_code);
+-                priv->weather_code = NULL;
+-        }
+-
+         if (priv->weather_info) {
+-                weather_info_free (priv->weather_info);
++                g_object_unref (priv->weather_info);
+                 priv->weather_info = NULL;
+         }
+ 
+-        if (priv->weather_timeout) {
+-                g_source_remove (priv->weather_timeout);
+-                priv->weather_timeout = 0;
+-        }
+-
+         G_OBJECT_CLASS (clock_location_parent_class)->finalize (g_obj);
+ }
+ 
+ const gchar *
+-clock_location_get_display_name (ClockLocation *loc)
+-{
+-        ClockLocationPrivate *priv = PRIVATE (loc);
+-
+-        if (priv->name && priv->name[0])
+-                return priv->name;
+-        else
+-                return priv->city;
+-}
+-
+-const gchar *
+ clock_location_get_name (ClockLocation *loc)
+ {
+         ClockLocationPrivate *priv = PRIVATE (loc);
+@@ -270,59 +188,38 @@
+         priv->name = g_strdup (name);
+ }
+ 
+-const gchar *
++gchar *
+ clock_location_get_city (ClockLocation *loc)
+ {
+         ClockLocationPrivate *priv = PRIVATE (loc);
+ 
+-        return priv->city;
++        return gweather_location_get_city_name (priv->loc);
+ }
+ 
+-void
+-clock_location_set_city (ClockLocation *loc, const gchar *city)
+-{
+-        ClockLocationPrivate *priv = PRIVATE (loc);
+-
+-        if (priv->city) {
+-                g_free (priv->city);
+-                priv->city = NULL;
+-        }
+-
+-        priv->city = g_strdup (city);
+-}
+-
+-gchar *
++const gchar *
+ clock_location_get_timezone (ClockLocation *loc)
+ {
+         ClockLocationPrivate *priv = PRIVATE (loc);
++	GWeatherTimezone *tz;
+ 
+-        return priv->timezone;
+-}
+-
+-void
+-clock_location_set_timezone (ClockLocation *loc, const gchar *timezone)
+-{
+-        ClockLocationPrivate *priv = PRIVATE (loc);
+-
+-        if (priv->timezone) {
+-                g_free (priv->timezone);
+-                priv->timezone = NULL;
+-        }
+-
+-        priv->timezone = g_strdup (timezone);
++	tz = gweather_location_get_timezone (priv->loc);
++        return gweather_timezone_get_name (tz);
+ }
+ 
+-gchar *
++const gchar *
+ clock_location_get_tzname (ClockLocation *loc)
+ {
+         ClockLocationPrivate *priv = PRIVATE (loc);
++	GWeatherTimezone *tz;
+ 
+-        return priv->tzname;
++	tz = gweather_location_get_timezone (priv->loc);
++        return gweather_timezone_get_tzid (tz);
+ }
+ 
+ void
+-clock_location_get_coords (ClockLocation *loc, gfloat *latitude,
+-                               gfloat *longitude)
++clock_location_get_coords (ClockLocation *loc,
++			   gdouble *latitude,
++			   gdouble *longitude)
+ {
+         ClockLocationPrivate *priv = PRIVATE (loc);
+ 
+@@ -330,105 +227,36 @@
+         *longitude = priv->longitude;
+ }
+ 
+-void
+-clock_location_set_coords (ClockLocation *loc, gfloat latitude,
+-                               gfloat longitude)
++GDateTime *
++clock_location_localtime (ClockLocation *loc)
+ {
+         ClockLocationPrivate *priv = PRIVATE (loc);
++	GWeatherTimezone *wtz;
++	GTimeZone *tz;
++	GDateTime *dt;
+ 
+-        priv->latitude = latitude;
+-        priv->longitude = longitude;
+-}
+-
+-static void
+-clock_location_set_tzname (ClockLocation *this, const char *tzname)
+-{
+-        ClockLocationPrivate *priv = PRIVATE (this);
+-
+-        if (priv->tzname) {
+-                if (strcmp (priv->tzname, tzname) == 0) {
+-                        return;
+-                }
++	wtz = gweather_location_get_timezone (priv->loc);
+ 
+-                g_free (priv->tzname);
+-                priv->tzname = NULL;
+-        }
+-
+-        if (tzname) {
+-                priv->tzname = g_strdup (tzname);
+-        } else {
+-                priv->tzname = NULL;
+-        }
+-}
+-
+-static void
+-clock_location_set_tz (ClockLocation *this)
+-{
+-        ClockLocationPrivate *priv = PRIVATE (this);
+-
+-        time_t now_t;
+-        struct tm now;
+-
+-        if (priv->timezone == NULL) {
+-                return;
+-        }
+-
+-        setenv ("TZ", priv->timezone, 1);
+-        tzset();
+-
+-        now_t = time (NULL);
+-        localtime_r (&now_t, &now);
+-
+-        if (now.tm_isdst > 0) {
+-                clock_location_set_tzname (this, tzname[1]);
+-        } else {
+-                clock_location_set_tzname (this, tzname[0]);
+-        }
+-}
+-
+-static void
+-clock_location_unset_tz (ClockLocation *this)
+-{
+-        ClockLocationPrivate *priv = PRIVATE (this);
+-        const char *env_timezone;
+-
+-        if (priv->timezone == NULL) {
+-                return;
+-        }
++	tz = g_time_zone_new (gweather_timezone_get_tzid (wtz));
++	dt = g_date_time_new_now (tz);
+ 
+-        env_timezone = system_timezone_get_env (priv->systz);
+-
+-        if (env_timezone) {
+-                setenv ("TZ", env_timezone, 1);
+-        } else {
+-                unsetenv ("TZ");
+-        }
+-        tzset();
+-}
+-
+-void
+-clock_location_localtime (ClockLocation *loc, struct tm *tm)
+-{
+-        time_t now;
+-
+-        clock_location_set_tz (loc);
+-
+-        time (&now);
+-        localtime_r (&now, tm);
+-
+-        clock_location_unset_tz (loc);
++	g_time_zone_unref (tz);
++	return dt;
+ }
+ 
+ gboolean
+ clock_location_is_current_timezone (ClockLocation *loc)
+ {
+         ClockLocationPrivate *priv = PRIVATE (loc);
++	GWeatherTimezone *wtz;
+ 	const char *zone;
+ 
++	wtz = gweather_location_get_timezone (priv->loc);
++
+ 	zone = system_timezone_get (priv->systz);
+ 
+ 	if (zone)
+-		return strcmp (zone, priv->timezone) == 0;
++		return strcmp (zone, gweather_timezone_get_tzid (wtz)) == 0;
+ 	else
+ 		return clock_location_get_offset (loc) == 0;
+ }
+@@ -462,34 +290,10 @@
+ clock_location_get_offset (ClockLocation *loc)
+ {
+         ClockLocationPrivate *priv = PRIVATE (loc);
+-        glong sys_timezone, local_timezone;
+-	glong offset;
+-	time_t t;
+-	struct tm *tm;
+-
+-	t = time (NULL);
+-	
+-        unsetenv ("TZ");
+-        tm = localtime (&t);
+-        sys_timezone = timezone;
+-
+-	if (tm->tm_isdst > 0) {
+-		sys_timezone -= 3600;
+-	}
++	GWeatherTimezone *wtz;
+ 
+-        setenv ("TZ", priv->timezone, 1);
+-        tm = localtime (&t);
+-	local_timezone = timezone;
+-
+-	if (tm->tm_isdst > 0) {
+-		local_timezone -= 3600;
+-	}
+-
+-        offset = local_timezone - sys_timezone;
+-
+-        clock_location_unset_tz (loc);
+-
+-        return offset;
++	wtz = gweather_location_get_timezone (priv->loc);
++	return gweather_timezone_get_offset (wtz);
+ }
+ 
+ typedef struct {
+@@ -540,6 +344,7 @@
+ {
+         ClockLocationPrivate *priv = PRIVATE (loc);
+ 	MakeCurrentData *mcdata;
++	GWeatherTimezone *wtz;
+ 
+         if (loc == current_location) {
+                 if (destroy)
+@@ -570,40 +375,21 @@
+ 	mcdata->data = data;
+ 	mcdata->destroy = destroy;
+ 
+-        set_system_timezone_async (priv->timezone,
++	wtz = gweather_location_get_timezone (priv->loc);
++        set_system_timezone_async (gweather_timezone_get_tzid (wtz),
+                                    make_current_cb,
+                                    mcdata);
+ }
+ 
+-static gchar *
+-clock_location_get_valid_weather_code (const gchar *code)
+-{
+-	if (!code || code[0] == '\0')
+-		return g_strdup (WEATHER_EMPTY_CODE);
+-	else
+-		return g_strdup (code);
+-}
+-
+ const gchar *
+ clock_location_get_weather_code (ClockLocation *loc)
+ {
+         ClockLocationPrivate *priv = PRIVATE (loc);
+ 
+-	return priv->weather_code;
++	return gweather_location_get_code (priv->loc);
+ }
+ 
+-void
+-clock_location_set_weather_code (ClockLocation *loc, const gchar *code)
+-{
+-        ClockLocationPrivate *priv = PRIVATE (loc);
+-
+-	g_free (priv->weather_code);
+-	priv->weather_code = clock_location_get_valid_weather_code (code);
+-
+-	setup_weather_updates (loc);
+-}
+-
+-WeatherInfo *
++GWeatherInfo *
+ clock_location_get_weather_info (ClockLocation *loc)
+ {
+         ClockLocationPrivate *priv = PRIVATE (loc);
+@@ -619,7 +405,7 @@
+ 	ClockLocationPrivate *priv = PRIVATE (loc);
+ 	guint timeout;
+ 
+-	if (!weather_info_network_error (priv->weather_info)) {
++	if (!gweather_info_network_error (priv->weather_info)) {
+ 		/* The last update succeeded; set the next update to
+ 		 * happen in half an hour, and reset the retry timer.
+ 		 */
+@@ -643,7 +429,7 @@
+ }
+ 
+ static void
+-weather_info_updated (WeatherInfo *info, gpointer data)
++weather_info_updated (GWeatherInfo *info, gpointer data)
+ {
+ 	ClockLocation *loc = data;
+ 	ClockLocationPrivate *priv = PRIVATE (loc);
+@@ -658,43 +444,11 @@
+ {
+ 	ClockLocation *loc = data;
+ 	ClockLocationPrivate *priv = PRIVATE (loc);
+-	WeatherPrefs prefs = {
+-		FORECAST_STATE,
+-		FALSE,
+-		NULL,
+-		TEMP_UNIT_CENTIGRADE,
+-		SPEED_UNIT_MS,
+-		PRESSURE_UNIT_MB,
+-		DISTANCE_UNIT_KM
+-	};
+-
+-	prefs.temperature_unit = priv->temperature_unit;
+-	prefs.speed_unit = priv->speed_unit;
+-
+-	weather_info_abort (priv->weather_info);
+-        weather_info_update (priv->weather_info,
+-                             &prefs, weather_info_updated, loc);
+ 
+-	return TRUE;
+-}
++	gweather_info_abort (priv->weather_info);
++        gweather_info_update (priv->weather_info);
+ 
+-static gchar *
+-rad2dms (gfloat lat, gfloat lon)
+-{
+-	gchar h, h2;
+-	gfloat d, deg, min, d2, deg2, min2;
+-
+-	h = lat > 0 ? 'N' : 'S';
+-	d = fabs (lat);
+-	deg = floor (d);
+-	min = floor (60 * (d - deg));
+-	h2 = lon > 0 ? 'E' : 'W';
+-	d2 = fabs (lon);
+-	deg2 = floor (d2);
+-	min2 = floor (60 * (d2 - deg2));
+-	return g_strdup_printf ("%02d-%02d%c %02d-%02d%c",
+-				(int)deg, (int)min, h,
+-				(int)deg2, (int)min2, h2);
++	return TRUE;
+ }
+ 
+ static GList *locations = NULL;
+@@ -779,60 +533,23 @@
+ setup_weather_updates (ClockLocation *loc)
+ {
+ 	ClockLocationPrivate *priv = PRIVATE (loc);
+-	WeatherLocation *wl;
+-	WeatherPrefs prefs = {
+-		FORECAST_STATE,
+-		FALSE,
+-		NULL,
+-		TEMP_UNIT_CENTIGRADE,
+-		SPEED_UNIT_MS,
+-		PRESSURE_UNIT_MB,
+-		DISTANCE_UNIT_KM
+-	};
+-
+-	gchar *dms;
+ 
+-	prefs.temperature_unit = priv->temperature_unit;
+-	prefs.speed_unit = priv->speed_unit;
+-
+-        if (priv->weather_info) {
+-                weather_info_free (priv->weather_info);
+-                priv->weather_info = NULL;
+-        }
++	g_clear_object (&priv->weather_info);
+ 
+ 	if (priv->weather_timeout) {
+ 		g_source_remove (priv->weather_timeout);
+ 		priv->weather_timeout = 0;
+ 	}
+ 
+-	if (!priv->weather_code ||
+-	    strcmp (priv->weather_code, WEATHER_EMPTY_CODE) == 0)
+-		return;
+-
+-	dms = rad2dms (priv->latitude, priv->longitude);
+-	wl = weather_location_new (priv->city, priv->weather_code,
+-				   NULL, NULL, dms, NULL, NULL);
+-
+ 	priv->weather_info =
+-		weather_info_new (wl, &prefs, weather_info_updated, loc);
++		gweather_info_new_for_world (priv->world,
++					     priv->loc,
++					     GWEATHER_FORECAST_LIST);
++	g_signal_connect (priv->weather_info, "updated",
++			  G_CALLBACK (weather_info_updated), loc);
+ 
+ 	set_weather_update_timeout (loc);
+ 
+-	weather_location_free (wl);
+-	g_free (dms);
+-
+ 	add_to_network_monitor (loc);
+ }
+ 
+-void
+-clock_location_set_weather_prefs (ClockLocation *loc,
+-				  WeatherPrefs *prefs)
+-{
+-	ClockLocationPrivate *priv = PRIVATE (loc);
+-
+-	priv->temperature_unit = prefs->temperature_unit;
+-	priv->speed_unit = prefs->speed_unit;
+-
+-	update_weather_info (loc);
+-}
+-
+--- a/applets/clock/clock-location.h
++++ b/applets/clock/clock-location.h
+@@ -4,7 +4,7 @@
+ #include <time.h>
+ #include <glib.h>
+ #include <glib-object.h>
+-#include <libgweather/weather.h>
++#include <libgweather/gweather-weather.h>
+ 
+ G_BEGIN_DECLS
+ 
+@@ -24,44 +24,30 @@
+ {
+         GObjectClass g_object_class;
+ 
+-	void (* weather_updated) (ClockLocation *location, WeatherInfo *info);
++	void (* weather_updated) (ClockLocation *location, GWeatherInfo *info);
+ 
+ 	void (* set_current) (ClockLocation *location);
+ } ClockLocationClass;
+ 
+ GType clock_location_get_type (void);
+ 
+-ClockLocation *clock_location_new (const gchar *name, const gchar *city,
+-				   const gchar *timezone,
+-				   gfloat latitude, gfloat longitude,
+-				   const gchar *code,
+-				   WeatherPrefs *prefs);
+-
+-ClockLocation *clock_location_find_and_ref (GList       *locations,
+-                                            const gchar *name,
+-                                            const gchar *city,
+-                                            const gchar *timezone,
+-                                            gfloat       latitude,
+-                                            gfloat       longitude,
+-                                            const gchar *code);
++ClockLocation *clock_location_new (GWeatherLocation *world,
++				   const gchar *name,
++				   const gchar *metar_code,
++				   gboolean override_latlon,
++				   gdouble  latitude,
++				   gdouble  longitude);
+ 
+-gchar *clock_location_get_tzname (ClockLocation *loc);
++const gchar *clock_location_get_tzname (ClockLocation *loc);
+ 
+-const gchar *clock_location_get_display_name (ClockLocation *loc);
+-
+-const gchar *clock_location_get_name (ClockLocation *loc);
++const char *clock_location_get_name (ClockLocation *loc);
+ void clock_location_set_name (ClockLocation *loc, const gchar *name);
+ 
+-const gchar *clock_location_get_city (ClockLocation *loc);
+-void clock_location_set_city (ClockLocation *loc, const gchar *city);
+-
+-gchar *clock_location_get_timezone (ClockLocation *loc);
+-void clock_location_set_timezone (ClockLocation *loc, const gchar *timezone);
+-
+-void clock_location_get_coords (ClockLocation *loc, gfloat *latitude, gfloat *longitude);
+-void clock_location_set_coords (ClockLocation *loc, gfloat latitude, gfloat longitude);
++gchar *clock_location_get_city (ClockLocation *loc);
++const gchar *clock_location_get_timezone (ClockLocation *loc);
++void clock_location_get_coords (ClockLocation *loc, gdouble *latitude, gdouble *longitude);
+ 
+-void clock_location_localtime (ClockLocation *loc, struct tm *tm);
++GDateTime *clock_location_localtime (ClockLocation *loc);
+ 
+ gboolean clock_location_is_current (ClockLocation *loc);
+ void clock_location_make_current (ClockLocation *loc,
+@@ -71,10 +57,7 @@
+ gboolean clock_location_is_current_timezone (ClockLocation *loc);
+ 
+ const gchar *clock_location_get_weather_code (ClockLocation *loc);
+-void         clock_location_set_weather_code (ClockLocation *loc, const gchar *code);
+-WeatherInfo *clock_location_get_weather_info (ClockLocation *loc);
+-void         clock_location_set_weather_prefs (ClockLocation *loc,
+-					       WeatherPrefs *weather_prefs);
++GWeatherInfo *clock_location_get_weather_info (ClockLocation *loc);
+ 
+ glong clock_location_get_offset (ClockLocation *loc);
+ 
+--- a/applets/clock/clock-map.c
++++ b/applets/clock/clock-map.c
+@@ -417,7 +417,7 @@
+ static gboolean
+ clock_map_place_location (ClockMap *this, ClockLocation *loc, gboolean hilight)
+ {
+-        gfloat latitude, longitude;
++        gdouble latitude, longitude;
+ 	gint marker;
+ 
+         clock_location_get_coords (loc, &latitude, &longitude);
+--- a/applets/clock/clock-menu.xml
++++ b/applets/clock/clock-menu.xml
+@@ -1,5 +1,4 @@
+ <menuitem name="Clock Copy Time Item" action="ClockCopyTime" />
+-<menuitem name="Clock Copy Date Item" action="ClockCopyDate" />
+ <separator/>
+ <menuitem name="Clock Configure Item" action="ClockConfig" />
+ <menuitem name="Clock Preferences Item" action="ClockPreferences" />
+--- a/applets/clock/clock-utils.c
++++ b/applets/clock/clock-utils.c
+@@ -54,11 +54,12 @@
+ #endif
+ }
+ 
+-ClockFormat
++GDesktopClockFormat
+ clock_locale_format (void)
+ {
+ 	return clock_locale_supports_am_pm () ?
+-		CLOCK_FORMAT_12 : CLOCK_FORMAT_24;
++		G_DESKTOP_CLOCK_FORMAT_12H :
++		G_DESKTOP_CLOCK_FORMAT_24H;
+ }
+ 
+ void
+--- a/applets/clock/clock-utils.h
++++ b/applets/clock/clock-utils.h
+@@ -28,21 +28,12 @@
+ #define __CLOCK_UTILS_H__
+ 
+ #include <gtk/gtk.h>
++#include <gdesktop-enums.h>
+ 
+ G_BEGIN_DECLS
+ 
+-/* Needs to match the indices in the combo of the prefs dialog */
+-typedef enum {
+-	CLOCK_FORMAT_INVALID = 0,
+-	CLOCK_FORMAT_12,
+-	CLOCK_FORMAT_24,
+-	CLOCK_FORMAT_UNIX,
+-	CLOCK_FORMAT_INTERNET,
+-	CLOCK_FORMAT_CUSTOM
+-} ClockFormat;
+-
+ gboolean clock_locale_supports_am_pm (void);
+-ClockFormat clock_locale_format (void);
++GDesktopClockFormat clock_locale_format (void);
+ 
+ void clock_utils_display_help (GtkWidget  *widget,
+ 			       const char *doc_id,
+--- a/applets/clock/clock.c
++++ b/applets/clock/clock.c
+@@ -42,20 +42,22 @@
+ #include <locale.h>
+ 
+ #include <panel-applet.h>
+-#include <panel-applet-gconf.h>
+ 
+ #include <glib/gi18n.h>
++#include <gio/gio.h>
+ #include <gio/gdesktopappinfo.h>
+ 
+ #include <gtk/gtk.h>
+ #include <gdk/gdkkeysyms.h>
+ #include <gdk/gdkx.h>
+-#include <gconf/gconf-client.h>
+ 
+-#include <libgweather/gweather-prefs.h>
++#define GNOME_DESKTOP_USE_UNSTABLE_API
++#include <libgnome-desktop/gnome-wall-clock.h>
++
+ #include <libgweather/gweather-xml.h>
+ #include <libgweather/location-entry.h>
+ #include <libgweather/timezone-menu.h>
++#include <libgweather/gweather-enum-types.h>
+ 
+ #include "clock.h"
+ 
+@@ -67,32 +69,6 @@
+ #include "set-timezone.h"
+ #include "system-timezone.h"
+ 
+-#define INTERNETSECOND (864)
+-#define INTERNETBEAT   (86400)
+-
+-#define NEVER_SENSITIVE "never_sensitive"
+-
+-#define N_GCONF_PREFS 11 /* Keep this in sync with the number of keys below! */
+-#define KEY_FORMAT		"format"
+-#define KEY_SHOW_SECONDS	"show_seconds"
+-#define KEY_SHOW_DATE		"show_date"
+-#define KEY_SHOW_WEATHER	"show_weather"
+-#define KEY_SHOW_TEMPERATURE	"show_temperature"
+-#define KEY_CUSTOM_FORMAT	"custom_format"
+-#define KEY_SHOW_WEEK		"show_week_numbers"
+-#define KEY_CITIES		"cities"
+-#define KEY_TEMPERATURE_UNIT	"temperature_unit"
+-#define KEY_SPEED_UNIT		"speed_unit"
+-
+-static GConfEnumStringPair format_type_enum_map [] = {
+-	{ CLOCK_FORMAT_12,       "12-hour"  },
+-	{ CLOCK_FORMAT_24,       "24-hour"  },
+-	{ CLOCK_FORMAT_UNIX,     "unix"     },
+-	{ CLOCK_FORMAT_INTERNET, "internet" },
+-	{ CLOCK_FORMAT_CUSTOM,   "custom"   },
+-	{ 0, NULL }
+-};
+-
+ enum {
+ 	COL_CITY_NAME = 0,
+ 	COL_CITY_TZ,
+@@ -144,27 +120,18 @@
+         GtkWidget *map_widget;
+ 
+ 	/* preferences */
+-	ClockFormat  format;
+-	char        *custom_format;
+-	gboolean     showseconds;
+-	gboolean     showdate;
+-	gboolean     showweek;
+-        gboolean     show_weather;
+-        gboolean     show_temperature;
+-
+-        gboolean     use_temperature_default;
+-        gboolean     use_speed_default;
+-        TempUnit     temperature_unit;
+-        SpeedUnit    speed_unit;
++        GSettings   *applet_settings;
++        GSettings   *weather_settings;
++        GSettings   *clock_settings;
+ 
+         /* Locations */
++        GWeatherLocation *world;
+         GList *locations;
+         GList *location_tiles;
+ 
+ 	/* runtime data */
+         time_t             current_time;
+-	char              *timeformat;
+-	guint              timeout;
++        GnomeWallClock    *wall_clock;
+ 	PanelAppletOrient  orient;
+ 	int                size;
+ 	GtkAllocation      old_allocation;
+@@ -182,15 +149,11 @@
+         gboolean   custom_format_shown;
+ 
+ 	gboolean   can_handle_format_12;
+-
+-	guint listeners [N_GCONF_PREFS];
+ };
+ 
+-static void  update_clock (ClockData * cd);
++static void  update_clock (GnomeWallClock *, GParamSpec *, ClockData * cd);
+ static void  update_tooltip (ClockData * cd);
+ static void  update_panel_weather (ClockData *cd);
+-static int   clock_timeout_callback (gpointer data);
+-static float get_itime    (time_t current_time);
+ 
+ static void set_atk_name_description (GtkWidget *widget,
+                                       const char *name,
+@@ -281,219 +244,6 @@
+ 	return width;
+ }
+ 
+-static void
+-clock_set_timeout (ClockData *cd,
+-		   time_t     now)
+-{
+-	int timeouttime;
+-
+-	if (cd->format == CLOCK_FORMAT_INTERNET) {
+-		int itime_ms;
+-
+-		itime_ms = ((unsigned int) (get_itime (now) * 1000));
+-
+-		if (!cd->showseconds)
+-			timeouttime = (999 - itime_ms % 1000) * 86.4 + 1;
+-		else {
+-			struct timeval tv;
+-			gettimeofday (&tv, NULL);
+-			itime_ms += (tv.tv_usec * 86.4) / 1000;
+-			timeouttime = ((999 - itime_ms % 1000) * 86.4) / 100 + 1;
+-		}
+-	} else {
+- 		struct timeval tv;
+-		struct tm *tm;
+-
+-		gettimeofday (&tv, NULL);
+-		/* We can't expect the timer resolution to be < 10ms, so add
+-		 * 15ms to make sure we're fine; see
+-		 * https://bugzilla.gnome.org/show_bug.cgi?id=585668 */
+-		timeouttime = (G_USEC_PER_SEC - tv.tv_usec)/1000+15;
+-
+-		/* timeout of one minute if we don't care about the seconds */
+- 		if (cd->format != CLOCK_FORMAT_UNIX &&
+-		    !cd->showseconds) {
+-			/* we use localtime() to handle leap seconds, see
+-			 * https://bugzilla.gnome.org/show_bug.cgi?id=604317 */
+-			tm = localtime (&now);
+-			if (tm->tm_sec < 60)
+-				timeouttime += 1000 * (59 - tm->tm_sec);
+-		}
+- 	}
+-
+-	cd->timeout = g_timeout_add (timeouttime,
+-	                             clock_timeout_callback,
+-	                             cd);
+-}
+-
+-static int
+-clock_timeout_callback (gpointer data)
+-{
+-	ClockData *cd = data;
+-	time_t new_time;
+-
+-        time (&new_time);
+-
+-	if (!cd->showseconds && 
+-	    cd->format != CLOCK_FORMAT_UNIX &&
+-	    cd->format != CLOCK_FORMAT_CUSTOM) {
+-		if (cd->format == CLOCK_FORMAT_INTERNET &&
+-		    (unsigned int)get_itime (new_time) !=
+-		    (unsigned int)get_itime (cd->current_time)) {
+-			update_clock (cd);
+-		} else if ((cd->format == CLOCK_FORMAT_12 ||
+-			    cd->format == CLOCK_FORMAT_24) &&
+-			   new_time / 60 != cd->current_time / 60) {
+-			update_clock (cd);
+-		}
+-	} else {
+-		update_clock (cd);
+-	}
+-
+-	clock_set_timeout (cd, new_time);
+-
+-	return FALSE;
+-}
+-
+-static float
+-get_itime (time_t current_time)
+-{
+-	struct tm *tm;
+-	float itime;
+-	time_t bmt;
+-
+-	/* BMT (Biel Mean Time) is GMT+1 */
+-	bmt = current_time + 3600;
+-	tm = gmtime (&bmt);
+-	itime = (tm->tm_hour*3600.0 + tm->tm_min*60.0 + tm->tm_sec)/86.4;
+-
+-	return itime;
+-}
+-
+-/* adapted from panel-toplevel.c */
+-static int
+-calculate_minimum_height (GtkWidget        *widget,
+-                          PanelAppletOrient orientation)
+-{
+-        GtkStateFlags     state;
+-        GtkStyleContext  *style_context;
+-        const PangoFontDescription *font_desc;
+-        PangoContext     *pango_context;
+-        PangoFontMetrics *metrics;
+-        GtkBorder         padding;
+-        int               focus_width = 0;
+-        int               focus_pad = 0;
+-        int               ascent;
+-        int               descent;
+-        int               thickness;
+-
+-        state = gtk_widget_get_state_flags (widget);
+-        style_context = gtk_widget_get_style_context (widget);
+-        font_desc = gtk_style_context_get_font (style_context, state);
+-
+-        pango_context = gtk_widget_get_pango_context (widget);
+-        metrics = pango_context_get_metrics (pango_context,
+-                                             font_desc,
+-                                             pango_context_get_language (pango_context));
+-
+-        ascent  = pango_font_metrics_get_ascent  (metrics);
+-        descent = pango_font_metrics_get_descent (metrics);
+-
+-        pango_font_metrics_unref (metrics);
+-
+-        gtk_style_context_get_padding (style_context, state, &padding);
+-        gtk_style_context_get_style (style_context,
+-                                     "focus-line-width", &focus_width,
+-                                     "focus-padding", &focus_pad,
+-                                     NULL);
+-
+-        if (orientation == PANEL_APPLET_ORIENT_UP
+-            || orientation == PANEL_APPLET_ORIENT_DOWN) {
+-                thickness = padding.top + padding.bottom;
+-        } else {
+-                thickness = padding.left + padding.right;
+-        }
+-
+-        return PANGO_PIXELS (ascent + descent) + 2 * (focus_width + focus_pad) + thickness;
+-}
+-
+-static gboolean
+-use_two_line_format (ClockData *cd)
+-{
+-        if (cd->size >= 2 * calculate_minimum_height (cd->panel_button, cd->orient))
+-                return TRUE;
+-
+-        return FALSE;
+-}
+-
+-static char *
+-get_updated_timeformat (ClockData *cd)
+-{
+- /* Show date in another line if panel is vertical, or
+-  * horizontal but large enough to hold two lines of text
+-  */
+-	char       *result;
+-	const char *time_format;
+-	const char *date_format;
+-	char       *clock_format;
+-
+-	if (cd->format == CLOCK_FORMAT_12)
+-		/* Translators: This is a strftime format string.
+-		 * It is used to display the time in 12-hours format (eg, like
+-		 * in the US: 8:10 am). The %p expands to am/pm. */
+-		time_format = cd->showseconds ? _("%l:%M:%S %p") : _("%l:%M %p");
+-	else
+-		/* Translators: This is a strftime format string.
+-		 * It is used to display the time in 24-hours format (eg, like
+-		 * in France: 20:10). */
+-		time_format = cd->showseconds ? _("%H:%M:%S") : _("%H:%M");
+-
+-	if (!cd->showdate)
+-		clock_format = g_strdup (time_format);
+-
+-	else {
+-		/* Translators: This is a strftime format string.
+-		 * It is used to display the date. Replace %e with %d if, when
+-		 * the day of the month as a decimal number is a single digit,
+-		 * it should begin with a 0 in your locale (e.g. "May 01"
+-		 * instead of "May  1"). */
+-		date_format = _("%a %b %e");
+-
+-		if (use_two_line_format (cd))
+-			/* translators: reverse the order of these arguments
+-			 *              if the time should come before the
+-			 *              date on a clock in your locale.
+-			 */
+-			clock_format = g_strdup_printf (_("%1$s\n%2$s"),
+-							date_format,
+-							time_format);
+-		else
+-			/* translators: reverse the order of these arguments
+-			 *              if the time should come before the
+-			 *              date on a clock in your locale.
+-			 */
+-			clock_format = g_strdup_printf (_("%1$s, %2$s"),
+-							date_format,
+-							time_format);
+-	}
+-
+-	result = g_locale_from_utf8 (clock_format, -1, NULL, NULL, NULL);
+-	g_free (clock_format);
+-
+-	/* let's be paranoid */
+-	if (!result)
+-		result = g_strdup ("???");
+-
+-	return result;
+-}
+-
+-static void
+-update_timeformat (ClockData *cd)
+-{
+-	g_free (cd->timeformat);
+-	cd->timeformat = get_updated_timeformat (cd);
+-}
+-
+ /* sets accessible name and description for the widget */
+ static void
+ set_atk_name_description (GtkWidget  *widget,
+@@ -526,87 +276,13 @@
+         }
+ }
+ 
+-static char *
+-format_time (ClockData *cd)
+-{
+-	struct tm *tm;
+-	char hour[256];
+-	char *utf8;
+-
+-	utf8 = NULL;
+-
+-	tm = localtime (&cd->current_time);
+-
+-	if (cd->format == CLOCK_FORMAT_UNIX) {
+-		if (use_two_line_format (cd)) {
+-			utf8 = g_strdup_printf ("%lu\n%05lu",
+-						(unsigned long)(cd->current_time / 100000L),
+-						(unsigned long)(cd->current_time % 100000L));
+-		} else {
+-			utf8 = g_strdup_printf ("%lu",
+-						(unsigned long)cd->current_time);
+-		}
+-	} else if (cd->format == CLOCK_FORMAT_INTERNET) {
+-		float itime = get_itime (cd->current_time);
+-		if (cd->showseconds)
+-			utf8 = g_strdup_printf ("@%3.2f", itime);
+-		else
+-			utf8 = g_strdup_printf ("@%3d", (unsigned int) itime);
+-	} else if (cd->format == CLOCK_FORMAT_CUSTOM) {
+-		char *timeformat = g_locale_from_utf8 (cd->custom_format, -1,
+-						       NULL, NULL, NULL);
+-		if (!timeformat)
+-			strcpy (hour, "???");
+-		else if (strftime (hour, sizeof (hour), timeformat, tm) <= 0)
+-			strcpy (hour, "???");
+-		g_free (timeformat);
+-
+-		utf8 = g_locale_to_utf8 (hour, -1, NULL, NULL, NULL);
+-	} else {
+-		if (strftime (hour, sizeof (hour), cd->timeformat, tm) <= 0)
+-			strcpy (hour, "???");
+-
+-		utf8 = g_locale_to_utf8 (hour, -1, NULL, NULL, NULL);
+-        }
+-
+-	if (!utf8)
+-		utf8 = g_strdup (hour);
+-
+-        return utf8;
+-}
+-
+-static gchar *
+-format_time_24 (ClockData *cd)
+-{
+-	struct tm *tm;
+-	gchar buf[128];
+-
+-	tm = localtime (&cd->current_time);
+-	strftime (buf, sizeof (buf) - 1, "%k:%M:%S", tm);
+-	return g_locale_to_utf8 (buf, -1, NULL, NULL, NULL);
+-}
+-
+ static void
+-update_clock (ClockData * cd)
++update_clock (GnomeWallClock *wall_clock, GParamSpec *pspec, ClockData * cd)
+ {
+-	gboolean use_markup;
+-        char *utf8;
++        const char *clock;
+ 
+-        use_markup = FALSE;
+-
+-	time (&cd->current_time);
+-        utf8 = format_time (cd);
+-
+-	use_markup = FALSE;
+-        if (pango_parse_markup (utf8, -1, 0, NULL, NULL, NULL, NULL))
+-                use_markup = TRUE;
+-
+-	if (use_markup)
+-		gtk_label_set_markup (GTK_LABEL (cd->clockw), utf8);
+-	else
+-		gtk_label_set_text (GTK_LABEL (cd->clockw), utf8);
+-
+-	g_free (utf8);
++        clock = gnome_wall_clock_get_clock (cd->wall_clock);
++        gtk_label_set_text (GTK_LABEL (cd->clockw), clock);
+ 
+ 	update_orient (cd);
+ 	gtk_widget_queue_resize (cd->panel_button);
+@@ -621,48 +297,24 @@
+ static void
+ update_tooltip (ClockData * cd)
+ {
+-        if (!cd->showdate) {
+-		struct tm *tm;
+-		char date[256];
+-		char *utf8, *loc;
+-                char *zone;
+-                time_t now_t;
+-                struct tm now;
+-                char *tip;
+-
+-		tm = localtime (&cd->current_time);
++        gboolean show_date;
+ 
+-		utf8 = NULL;
++        show_date = g_settings_get_boolean (cd->clock_settings, "clock-show-date");
++        if (!show_date) {
++                GDateTime *dt;
++                char *tip, *format;
+ 
+-                /* Show date in tooltip. */
++                dt = g_date_time_new_now_local ();
+ 		/* Translators: This is a strftime format string.
+ 		 * It is used to display a date. Please leave "%%s" as it is:
+ 		 * it will be used to insert the timezone name later. */
+-                loc = g_locale_from_utf8 (_("%A %B %d (%%s)"), -1, NULL, NULL, NULL);
+-                if (!loc)
+-                        strcpy (date, "???");
+-                else if (strftime (date, sizeof (date), loc, tm) <= 0)
+-                        strcpy (date, "???");
+-                g_free (loc);
+-
+-                utf8 = g_locale_to_utf8 (date, -1, NULL, NULL, NULL);
+-
+-                /* Add the timezone name */
+-
+-                tzset ();
+-                time (&now_t);
+-                localtime_r (&now_t, &now);
+-
+-                if (now.tm_isdst > 0) {
+-                        zone = tzname[1];
+-                } else {
+-                        zone = tzname[0];
+-                }
+-
+-                tip = g_strdup_printf (utf8, zone);
++                format = g_date_time_format (dt, _("%A %B %d (%%s)"));
++                tip = g_strdup_printf (format, g_date_time_get_timezone_abbreviation (dt));
+ 
+                 gtk_widget_set_tooltip_text (cd->panel_button, tip);
+-                g_free (utf8);
++
++                g_date_time_unref (dt);
++                g_free (format);
+                 g_free (tip);
+         } else {
+ #ifdef HAVE_LIBECAL
+@@ -684,40 +336,6 @@
+ }
+ 
+ static void
+-refresh_clock (ClockData *cd)
+-{
+-	unfix_size (cd);
+-	update_clock (cd);
+-}
+-
+-static void
+-refresh_clock_timeout(ClockData *cd)
+-{
+-	unfix_size (cd);
+-
+-	update_timeformat (cd);
+-
+-	if (cd->timeout)
+-		g_source_remove (cd->timeout);
+-
+-	update_clock (cd);
+-
+-	clock_set_timeout (cd, cd->current_time);
+-}
+-
+-/**
+- * This is like refresh_clock_timeout(), except that we only care about whether
+- * the time actually changed. We don't care about the format.
+- */
+-static void
+-refresh_click_timeout_time_only (ClockData *cd)
+-{
+-	if (cd->timeout)
+-		g_source_remove (cd->timeout);
+-	clock_timeout_callback (cd);
+-}
+-
+-static void
+ free_locations (ClockData *cd)
+ {
+         GList *l;
+@@ -732,20 +350,11 @@
+ static void
+ destroy_clock (GtkWidget * widget, ClockData *cd)
+ {
+-	GConfClient *client;
+-	int          i;
+-
+-	client = gconf_client_get_default ();
++        g_clear_object (&cd->applet_settings);
++        g_clear_object (&cd->clock_settings);
++        g_clear_object (&cd->weather_settings);
+ 
+-	for (i = 0; i < N_GCONF_PREFS; i++)
+-		gconf_client_notify_remove (
+-				client, cd->listeners [i]);
+-
+-	g_object_unref (G_OBJECT (client));
+-
+-	if (cd->timeout)
+-		g_source_remove (cd->timeout);
+-        cd->timeout = 0;
++        g_clear_object (&cd->wall_clock);
+ 
+ 	if (cd->props)
+ 		gtk_widget_destroy (cd->props);
+@@ -759,19 +368,11 @@
+ 		g_object_unref (cd->datetime_appinfo);
+ 	cd->datetime_appinfo = NULL;
+ 
+-	g_free (cd->timeformat);
+-	g_free (cd->custom_format);
+-
+         free_locations (cd);
+ 
+         g_list_free (cd->location_tiles);
+         cd->location_tiles = NULL;
+ 
+-	if (cd->systz) {
+-		g_object_unref (cd->systz);
+-		cd->systz = NULL;
+-	}
+-
+         if (cd->cities_store) {
+                 g_object_unref (cd->cities_store);
+                 cd->cities_store = NULL;
+@@ -821,22 +422,18 @@
+ create_calendar (ClockData *cd)
+ {
+ 	GtkWidget *window;
+-	char      *prefs_dir;
+ 
+-	prefs_dir = panel_applet_get_preferences_key (PANEL_APPLET (cd->applet));
+-	window = calendar_window_new (&cd->current_time,
+-				      prefs_dir,
++	window = calendar_window_new (cd->applet_settings,
+ 				      cd->orient == PANEL_APPLET_ORIENT_UP);
+-	g_free (prefs_dir);
+ 
+ 	g_object_bind_property (cd->applet, "locked-down",
+ 				window, "locked-down",
+ 				G_BINDING_DEFAULT|G_BINDING_SYNC_CREATE);
+ 
+ 	calendar_window_set_show_weeks (CALENDAR_WINDOW (window),
+-					cd->showweek);
++				        g_settings_get_boolean (cd->applet_settings, "show-weeks"));
+ 	calendar_window_set_time_format (CALENDAR_WINDOW (window),
+-					 cd->format);
++					 g_settings_get_enum (cd->clock_settings, "clock-format"));
+ 
+         gtk_window_set_screen (GTK_WINDOW (window),
+ 			       gtk_widget_get_screen (cd->applet));
+@@ -983,8 +580,8 @@
+         ClockLocation *loc_a = (ClockLocation *) a;
+         ClockLocation *loc_b = (ClockLocation *) b;
+ 
+-        const char *name_a = clock_location_get_display_name (loc_a);
+-        const char *name_b = clock_location_get_display_name (loc_b);
++        const char *name_a = clock_location_get_name (loc_a);
++        const char *name_b = clock_location_get_name (loc_b);
+ 
+         return strcmp (name_a, name_b);
+ }
+@@ -1015,7 +612,7 @@
+ 
+ 		gtk_list_store_append (cd->cities_store, &iter);
+ 		gtk_list_store_set (cd->cities_store, &iter,
+-				    COL_CITY_NAME, clock_location_get_display_name (loc),
++				    COL_CITY_NAME, clock_location_get_name (loc),
+ 				    /* FIXME: translate the timezone */
+ 				    COL_CITY_TZ, clock_location_get_timezone (loc),
+                                     COL_CITY_LOC, loc,
+@@ -1038,42 +635,17 @@
+         ClockLocation *loc_a = (ClockLocation *) a;
+         ClockLocation *loc_b = (ClockLocation *) b;
+ 
+-        struct tm tm_a;
+-        struct tm tm_b;
++        GDateTime *dt1;
++        GDateTime *dt2;
+         gint ret;
+ 
+-        clock_location_localtime (loc_a, &tm_a);
+-        clock_location_localtime (loc_b, &tm_b);
+-
+-        ret = (tm_a.tm_year == tm_b.tm_year) ? 0 : 1;
+-        if (ret) {
+-                return (tm_a.tm_year < tm_b.tm_year) ? -1 : 1;
+-        }
++        dt1 = clock_location_localtime (loc_a);
++        dt2 = clock_location_localtime (loc_b);
+ 
+-        ret = (tm_a.tm_mon == tm_b.tm_mon) ? 0 : 1;
+-        if (ret) {
+-                return (tm_a.tm_mon < tm_b.tm_mon) ? -1 : 1;
+-        }
++        ret = g_date_time_compare (dt1, dt2);
+ 
+-        ret = (tm_a.tm_mday == tm_b.tm_mday) ? 0 : 1;
+-        if (ret) {
+-                return (tm_a.tm_mday < tm_b.tm_mday) ? -1 : 1;
+-        }
+-
+-        ret = (tm_a.tm_hour == tm_b.tm_hour) ? 0 : 1;
+-        if (ret) {
+-                return (tm_a.tm_hour < tm_b.tm_hour) ? -1 : 1;
+-        }
+-
+-        ret = (tm_a.tm_min == tm_b.tm_min) ? 0 : 1;
+-        if (ret) {
+-                return (tm_a.tm_min < tm_b.tm_min) ? -1 : 1;
+-        }
+-
+-        ret = (tm_a.tm_sec == tm_b.tm_sec) ? 0 : 1;
+-        if (ret) {
+-                return (tm_a.tm_sec < tm_b.tm_sec) ? -1 : 1;
+-        }
++        g_date_time_unref (dt1);
++        g_date_time_unref (dt2);
+ 
+         return ret;
+ }
+@@ -1091,12 +663,12 @@
+         g_object_unref (loc);
+ }
+ 
+-static ClockFormat
++static int
+ location_tile_need_clock_format_cb(ClockLocationTile *tile, gpointer data)
+ {
+         ClockData *cd = data;
+ 
+-        return cd->format;
++        return g_settings_get_enum (cd->clock_settings, "clock-format");
+ }
+ 
+ static void
+@@ -1236,7 +808,7 @@
+ {
+ 	/* if time is wrong, the user might try to fix it by clicking on the
+ 	 * clock */
+-	refresh_click_timeout_time_only (cd);
++	update_clock (NULL, NULL, cd);
+ 	update_calendar_popup (cd);
+ }
+ 
+@@ -1346,7 +918,7 @@
+                  ClockData   *cd)
+ {
+         GList *locations, *l;
+-        WeatherInfo *info;
++        GWeatherInfo *info;
+ 
+         locations = cd->locations;
+ 
+@@ -1354,10 +926,11 @@
+ 		ClockLocation *location = l->data;
+                 if (clock_location_is_current (location)) {
+                         info = clock_location_get_weather_info (location);
+-                        if (!info || !weather_info_is_valid (info))
++                        if (!info || !gweather_info_is_valid (info))
+                                 continue;
+ 
+-                        weather_info_setup_tooltip (info, location, tooltip, cd->format);
++                        weather_info_setup_tooltip (info, location, tooltip,
++                                                    g_settings_get_enum (cd->clock_settings, "clock-format"));
+ 
+                         return TRUE;
+                 }
+@@ -1369,6 +942,10 @@
+ static void
+ create_clock_widget (ClockData *cd)
+ {
++        cd->wall_clock = g_object_new (GNOME_TYPE_WALL_CLOCK, NULL);
++        g_signal_connect (cd->wall_clock, "notify::clock",
++                          G_CALLBACK (update_clock), cd);
++
+         /* Main toggle button */
+         cd->panel_button = create_main_clock_button ();
+ 	g_signal_connect (cd->panel_button, "button_press_event",
+@@ -1397,9 +974,13 @@
+         /* Weather widgets */
+         cd->panel_weather_icon = gtk_image_new ();
+         gtk_box_pack_start (GTK_BOX (cd->weather_obox), cd->panel_weather_icon, FALSE, FALSE, 0);
++        g_settings_bind (cd->applet_settings, "show-weather", cd->panel_weather_icon, "visible",
++                         G_SETTINGS_BIND_DEFAULT | G_SETTINGS_BIND_NO_SENSITIVITY);
+ 
+         cd->panel_temperature_label = gtk_label_new (NULL);
+         gtk_box_pack_start (GTK_BOX (cd->weather_obox), cd->panel_temperature_label, FALSE, FALSE, 0);
++        g_settings_bind (cd->applet_settings, "show-temperature", cd->panel_temperature_label, "visible",
++                         G_SETTINGS_BIND_DEFAULT | G_SETTINGS_BIND_NO_SENSITIVITY);
+ 
+         /* Main label for time display */
+ 	cd->clockw = create_main_clock_label (cd);
+@@ -1421,7 +1002,7 @@
+ 	update_panel_weather (cd);
+ 
+ 	/* Refresh the clock so that it paints its first state */
+-	refresh_clock_timeout (cd);
++        update_clock (NULL, NULL, cd);
+ 	applet_change_orient (PANEL_APPLET (cd->applet),
+ 			      panel_applet_get_orient (PANEL_APPLET (cd->applet)),
+ 			      cd);
+@@ -1492,7 +1073,7 @@
+         gtk_orientable_set_orientation (GTK_ORIENTABLE (cd->weather_obox), o);
+ 
+         unfix_size (cd);
+-        update_clock (cd);
++        update_clock (NULL, NULL, cd);
+         update_calendar_popup (cd);
+ }
+ 
+@@ -1520,109 +1101,21 @@
+ 	cd->size = new_size;
+ 
+         unfix_size (cd);
+-	update_timeformat (cd);
+-	update_clock (cd);
++	update_clock (NULL, NULL, cd);
+ }
+ 
+ static void
+ copy_time (GtkAction *action,
+ 	   ClockData *cd)
+ {
+-	char string[256];
+-	char *utf8;
+-
+-	if (cd->format == CLOCK_FORMAT_UNIX) {
+-		g_snprintf (string, sizeof(string), "%lu",
+-			    (unsigned long)cd->current_time);
+-	} else if (cd->format == CLOCK_FORMAT_INTERNET) {
+-		float itime = get_itime (cd->current_time);
+-		if (cd->showseconds)
+-			g_snprintf (string, sizeof (string), "@%3.2f", itime);
+-		else
+-			g_snprintf (string, sizeof (string), "@%3d",
+-				    (unsigned int) itime);
+-	} else {
+-		struct tm *tm;
+-		char      *format;
+-
+-		if (cd->format == CLOCK_FORMAT_CUSTOM) {
+-			format = g_locale_from_utf8 (cd->custom_format, -1,
+-						     NULL, NULL, NULL);
+-		} else if (cd->format == CLOCK_FORMAT_12) {
+-			if (cd->showseconds)
+-				/* Translators: This is a strftime format
+-				 * string.
+-				 * It is used to display the time in 12-hours
+-				 * format with a leading 0 if needed (eg, like
+-				 * in the US: 08:10 am). The %p expands to
+-				 * am/pm. */
+-				format = g_locale_from_utf8 (_("%I:%M:%S %p"), -1, NULL, NULL, NULL);
+-			else
+-				/* Translators: This is a strftime format
+-				 * string.
+-				 * It is used to display the time in 12-hours
+-				 * format with a leading 0 if needed (eg, like
+-				 * in the US: 08:10 am). The %p expands to
+-				 * am/pm. */
+-				format = g_locale_from_utf8 (_("%I:%M %p"), -1, NULL, NULL, NULL);
+-		} else {
+-			if (cd->showseconds)
+-				/* Translators: This is a strftime format
+-				 * string.
+-				 * It is used to display the time in 24-hours
+-				 * format (eg, like in France: 20:10). */
+-				format = g_locale_from_utf8 (_("%H:%M:%S"), -1, NULL, NULL, NULL);
+-			else
+-				/* Translators: This is a strftime format
+-				 * string.
+-				 * It is used to display the time in 24-hours
+-				 * format (eg, like in France: 20:10). */
+-				format = g_locale_from_utf8 (_("%H:%M"), -1, NULL, NULL, NULL);
+-		}
+-
+-		tm = localtime (&cd->current_time);
+-
+-		if (!format)
+-			strcpy (string, "???");
+-		else if (strftime (string, sizeof (string), format, tm) <= 0)
+-			strcpy (string, "???");
+-		g_free (format);
+-	}
+-
+-	utf8 = g_locale_to_utf8 (string, -1, NULL, NULL, NULL);
+-	gtk_clipboard_set_text (gtk_clipboard_get (GDK_SELECTION_PRIMARY),
+-				utf8, -1);
+-	gtk_clipboard_set_text (gtk_clipboard_get (GDK_SELECTION_CLIPBOARD),
+-				utf8, -1);
+-	g_free (utf8);
+-}
++	const char *time;
+ 
+-static void
+-copy_date (GtkAction *action,
+-	   ClockData *cd)
+-{
+-	struct tm *tm;
+-	char string[256];
+-	char *utf8, *loc;
+-
+-	tm = localtime (&cd->current_time);
+-
+-	/* Translators: This is a strftime format string.
+-	 * It is used to display a date in the full format (so that people can
+-	 * copy and paste it elsewhere). */
+-	loc = g_locale_from_utf8 (_("%A, %B %d %Y"), -1, NULL, NULL, NULL);
+-	if (!loc)
+-		strcpy (string, "???");
+-	else if (strftime (string, sizeof (string), loc, tm) <= 0)
+-		strcpy (string, "???");
+-	g_free (loc);
++        time = gnome_wall_clock_get_clock (cd->wall_clock);
+ 
+-	utf8 = g_locale_to_utf8 (string, -1, NULL, NULL, NULL);
+ 	gtk_clipboard_set_text (gtk_clipboard_get (GDK_SELECTION_PRIMARY),
+-				utf8, -1);
++				time, -1);
+ 	gtk_clipboard_set_text (gtk_clipboard_get (GDK_SELECTION_CLIPBOARD),
+-				utf8, -1);
+-	g_free (utf8);
++				time, -1);
+ }
+ 
+ static void
+@@ -1699,98 +1192,36 @@
+         { "ClockPreferences", GTK_STOCK_PROPERTIES, N_("_Preferences"),
+           NULL, NULL,
+           G_CALLBACK (verb_display_properties_dialog) },
+-        { "ClockCopyTime", GTK_STOCK_COPY, N_("Copy _Time"),
++        { "ClockCopyTime", GTK_STOCK_COPY, N_("Copy Date and _Time"),
+           NULL, NULL,
+           G_CALLBACK (copy_time) },
+-        { "ClockCopyDate", GTK_STOCK_COPY, N_("Copy _Date"),
+-          NULL, NULL,
+-          G_CALLBACK (copy_date) },
+         { "ClockConfig", GTK_STOCK_PREFERENCES, N_("Ad_just Date & Time"),
+           NULL, NULL,
+           G_CALLBACK (config_date) }
+ };
+ 
+ static void
+-format_changed (GConfClient  *client,
+-                guint         cnxn_id,
+-                GConfEntry   *entry,
++format_changed (GSettings    *settings,
++                const char   *key,
+                 ClockData    *clock)
+ {
+-	const char  *value;
+-	int          new_format;
+-
+-	if (!entry->value || entry->value->type != GCONF_VALUE_STRING)
+-		return;
+-
+-	value = gconf_value_get_string (entry->value);
+-	if (!gconf_string_to_enum (format_type_enum_map, value, &new_format))
+-		return;
+-
+-	if (!clock->can_handle_format_12 && new_format == CLOCK_FORMAT_12)
+-		new_format = CLOCK_FORMAT_24;
+-
+-	if (new_format == clock->format)
+-		return;
+-
+-	clock->format = new_format;
+-	refresh_clock_timeout (clock);
+-
+ 	if (clock->calendar_popup != NULL) {
+-		calendar_window_set_time_format (CALENDAR_WINDOW (clock->calendar_popup), clock->format);
++		calendar_window_set_time_format (CALENDAR_WINDOW (clock->calendar_popup),
++                                                 g_settings_get_enum (settings, "clock-format"));
+                 position_calendar_popup (clock);
+ 	}
+ 
+ }
+ 
+ static void
+-show_seconds_changed (GConfClient  *client,
+-                   guint         cnxn_id,
+-                   GConfEntry   *entry,
+-                   ClockData    *clock)
+-{
+-	gboolean value;
+-
+-	if (!entry->value || entry->value->type != GCONF_VALUE_BOOL)
+-		return;
+-
+-	value = gconf_value_get_bool (entry->value);
+-
+-	clock->showseconds = (value != 0);
+-	refresh_clock_timeout (clock);
+-}
+-
+-static void
+-show_date_changed (GConfClient  *client,
+-                   guint         cnxn_id,
+-                   GConfEntry   *entry,
+-                   ClockData    *clock)
+-{
+-	gboolean value;
+-
+-	if (!entry->value || entry->value->type != GCONF_VALUE_BOOL)
+-		return;
+-
+-	value = gconf_value_get_bool (entry->value);
+-
+-	clock->showdate = (value != 0);
+-	update_timeformat (clock);
+-	refresh_clock (clock);
+-}
+-
+-static void
+ update_panel_weather (ClockData *cd)
+ {
+-        if (cd->show_weather)
+-                gtk_widget_show (cd->panel_weather_icon);
+-        else
+-                gtk_widget_hide (cd->panel_weather_icon);
++        gboolean show_weather, show_temperature;
+ 
+-        if (cd->show_temperature)
+-                gtk_widget_show (cd->panel_temperature_label);
+-        else
+-                gtk_widget_hide (cd->panel_temperature_label);
++        show_weather = g_settings_get_boolean (cd->applet_settings, "show-weather");
++        show_temperature = g_settings_get_boolean (cd->applet_settings, "show-temperature");
+ 
+-	if ((cd->show_weather || cd->show_temperature) &&
++	if ((show_weather || show_temperature) &&
+ 	    g_list_length (cd->locations) > 0)
+                 gtk_widget_show (cd->weather_obox);
+         else
+@@ -1800,49 +1231,9 @@
+ }
+ 
+ static void
+-update_weather_bool_value_and_toggle_from_gconf (ClockData *cd, GConfEntry *entry,
+-                                                 gboolean *value_loc, const char *widget_name)
+-{
+-	GtkWidget *widget;
+-        gboolean value;
+-
+-        if (!entry->value || entry->value->type != GCONF_VALUE_BOOL)
+-                return;
+-
+-        value = gconf_value_get_bool (entry->value);
+-
+-        *value_loc = (value != 0);
+-
+-	widget = _clock_get_widget (cd, widget_name);
+-
+-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget),
+-				      *value_loc);
+-
+-        update_panel_weather (cd);
+-}
+-
+-static void
+-show_weather_changed (GConfClient  *client,
+-                      guint         cnxn_id,
+-                      GConfEntry   *entry,
+-                      ClockData    *cd)
+-{
+-        update_weather_bool_value_and_toggle_from_gconf (cd, entry, &cd->show_weather, "weather_check");
+-}
+-
+-static void
+-show_temperature_changed (GConfClient  *client,
+-                          guint         cnxn_id,
+-                          GConfEntry   *entry,
+-                          ClockData    *cd)
+-{
+-        update_weather_bool_value_and_toggle_from_gconf (cd, entry, &cd->show_temperature, "temperature_check");
+-}
+-
+-static void
+-location_weather_updated_cb (ClockLocation *location,
+-                             WeatherInfo   *info,
+-                             gpointer       data)
++location_weather_updated_cb (ClockLocation  *location,
++                             GWeatherInfo   *info,
++                             gpointer        data)
+ {
+ 	ClockData *cd = data;
+ 	const gchar *icon_name;
+@@ -1850,19 +1241,19 @@
+ 	GtkIconTheme *theme;
+ 	GdkPixbuf *pixbuf;
+ 
+-	if (!info || !weather_info_is_valid (info))
++	if (!info || !gweather_info_is_valid (info))
+ 		return;
+ 
+ 	if (!clock_location_is_current (location))
+ 		return;
+ 
+-	icon_name = weather_info_get_icon_name (info);
++	icon_name = gweather_info_get_icon_name (info);
+ 	/* FIXME: mmh, screen please? Also, don't hardcode to 16 */
+ 	theme = gtk_icon_theme_get_default ();
+ 	pixbuf = gtk_icon_theme_load_icon (theme, icon_name, 16,
+ 					   GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
+ 
+-	temp = weather_info_get_temp_summary (info);
++	temp = gweather_info_get_temp_summary (info);
+ 
+ 	gtk_image_set_from_pixbuf (GTK_IMAGE (cd->panel_weather_icon), pixbuf);
+ 	gtk_label_set_text (GTK_LABEL (cd->panel_temperature_label), temp);
+@@ -1873,7 +1264,7 @@
+ 			 gpointer       data)
+ {
+ 	ClockData *cd = data;
+-	WeatherInfo *info;
++	GWeatherInfo *info;
+ 
+ 	info = clock_location_get_weather_info (loc);
+ 	location_weather_updated_cb (loc, info, cd);
+@@ -1885,7 +1276,9 @@
+ }
+ 
+ static void
+-locations_changed (ClockData *cd)
++locations_changed (GSettings  *settings,
++                   const char *key,
++                   ClockData  *cd)
+ {
+ 	GList *l;
+ 	ClockLocation *loc;
+@@ -1925,482 +1318,41 @@
+ 		create_cities_section (cd);
+ }
+ 
+-
+-static void
+-set_locations (ClockData *cd, GList *locations)
+-{
+-        free_locations (cd);
+-        cd->locations = locations;
+-	locations_changed (cd);
+-}
+-
+-typedef struct {
+-        GList *cities;
+-        ClockData *cd;
+-} LocationParserData;
+-
+-/* Parser for our serialized locations in gconf */
+-static void
+-location_start_element (GMarkupParseContext *context,
+-                        const gchar *element_name,
+-                        const gchar **attribute_names,
+-                        const gchar **attribute_values,
+-                        gpointer user_data,
+-                        GError **error)
+-{
+-        ClockLocation *loc;
+-	LocationParserData *data = user_data;
+-        ClockData *cd = data->cd;
+-	WeatherPrefs prefs;
+-        const gchar *att_name;
+-
+-        gchar *name = NULL;
+-        gchar *city = NULL;
+-        gchar *timezone = NULL;
+-        gfloat latitude = 0.0;
+-        gfloat longitude = 0.0;
+-	gchar *code = NULL;
+-	gboolean current = FALSE;
+-
+-        int index = 0;
+-
+-	prefs.temperature_unit = cd->temperature_unit;
+-	prefs.speed_unit = cd->speed_unit;
+-
+-        if (strcmp (element_name, "location") != 0) {
+-                return;
+-        }
+-
+-        setlocale (LC_NUMERIC, "POSIX");
+-
+-        for (att_name = attribute_names[index]; att_name != NULL;
+-             att_name = attribute_names[++index]) {
+-                if (strcmp (att_name, "name") == 0) {
+-                        name = (gchar *)attribute_values[index];
+-                } else if (strcmp (att_name, "city") == 0) {
+-                        city = (gchar *)attribute_values[index];
+-                } else if (strcmp (att_name, "timezone") == 0) {
+-                        timezone = (gchar *)attribute_values[index];
+-                } else if (strcmp (att_name, "latitude") == 0) {
+-                        sscanf (attribute_values[index], "%f", &latitude);
+-                } else if (strcmp (att_name, "longitude") == 0) {
+-                        sscanf (attribute_values[index], "%f", &longitude);
+-                } else if (strcmp (att_name, "code") == 0) {
+-                        code = (gchar *)attribute_values[index];
+-                }
+-		else if (strcmp (att_name, "current") == 0) {
+-			if (strcmp (attribute_values[index], "true") == 0) {
+-				current = TRUE;
+-			}
+-		}
+-        }
+-
+-        setlocale (LC_NUMERIC, "");
+-
+-        if ((!name && !city) || !timezone) {
+-                return;
+-        }
+-
+-        /* migration from the old configuration, when name == city */
+-        if (!city)
+-                city = name;
+-
+-	loc = clock_location_find_and_ref (cd->locations, name, city,
+-					   timezone, latitude, longitude, code);
+-	if (!loc)
+-		loc = clock_location_new (name, city, timezone,
+-					  latitude, longitude, code, &prefs);
+-
+-	if (current && clock_location_is_current_timezone (loc))
+-		clock_location_make_current (loc, NULL, NULL, NULL);
+-
+-        data->cities = g_list_append (data->cities, loc);
+-}
+-
+-static GMarkupParser location_parser = {
+-        location_start_element, NULL, NULL, NULL, NULL
+-};
+-
+-static void
+-cities_changed (GConfClient  *client,
+-                guint         cnxn_id,
+-                GConfEntry   *entry,
+-                ClockData    *cd)
+-{
+-	LocationParserData data;
+-
+-        GSList *cur = NULL;
+-
+-        GMarkupParseContext *context;
+-
+-	data.cities = NULL;
+-	data.cd = cd;
+-
+-        if (!entry->value || entry->value->type != GCONF_VALUE_LIST)
+-                return;
+-
+-        context = g_markup_parse_context_new (&location_parser, 0, &data, NULL);
+-
+-        cur = gconf_value_get_list (entry->value);
+-
+-        while (cur) {
+-                const char *str = gconf_value_get_string (cur->data);
+-                g_markup_parse_context_parse (context, str, strlen (str), NULL);
+-
+-                cur = cur->next;
+-        }
+-
+-        g_markup_parse_context_free (context);
+-
+-        set_locations (cd, data.cities);
+-        create_cities_store (cd);
+-}
+-
+ static void
+-update_temperature_combo (ClockData *cd)
+-{
+-	GtkWidget *widget;
+-        int active_index;
+-
+-	widget = _clock_get_widget (cd, "temperature_combo");
+-
+-        if (cd->use_temperature_default)
+-                active_index = 0;
+-        else
+-                active_index = cd->temperature_unit - 1;
+-
+-        gtk_combo_box_set_active (GTK_COMBO_BOX (widget), active_index);
+-}
+-
+-static void
+-update_weather_locations (ClockData *cd)
+-{
+-	GList *locations, *l;
+-        WeatherPrefs prefs = {
+-                FORECAST_STATE,
+-                FALSE,
+-                NULL,
+-                TEMP_UNIT_CENTIGRADE,
+-                SPEED_UNIT_MS,
+-                PRESSURE_UNIT_MB,
+-                DISTANCE_UNIT_KM
+-        };
+-
+-	prefs.temperature_unit = cd->temperature_unit;
+-	prefs.speed_unit = cd->speed_unit;
+-
+-        locations = cd->locations;
+-
+-        for (l = locations; l; l = l->next) {
+-		clock_location_set_weather_prefs (l->data, &prefs);
+-	}
+-}
+-
+-static void
+-clock_migrate_to_26 (ClockData *clock)
+-{
+-	gboolean  unixtime;
+-	gboolean  internettime;
+-	int       hourformat;
+-
+-	internettime = panel_applet_gconf_get_bool (PANEL_APPLET (clock->applet),
+-						    "internet_time",
+-						    NULL);
+-	unixtime = panel_applet_gconf_get_bool (PANEL_APPLET (clock->applet),
+-						"unix_time",
+-						NULL);
+-	hourformat = panel_applet_gconf_get_int (PANEL_APPLET (clock->applet),
+-						 "hour_format",
+-						 NULL);
+-
+-	if (unixtime)
+-		clock->format = CLOCK_FORMAT_UNIX;
+-	else if (internettime)
+-		clock->format = CLOCK_FORMAT_INTERNET;
+-	else if (hourformat == 12)
+-		clock->format = CLOCK_FORMAT_12;
+-	else if (hourformat == 24)
+-		clock->format = CLOCK_FORMAT_24;
+-
+-	/* It's still possible that we have none of the old keys, in which case
+-	 * we're not migrating from 2.6, but the config is simply wrong. So
+-	 * don't set the format key in this case. */
+-	if (clock->format != CLOCK_FORMAT_INVALID)
+-		panel_applet_gconf_set_string (PANEL_APPLET (clock->applet),
+-					       KEY_FORMAT,
+-					       gconf_enum_to_string (format_type_enum_map,
+-								     clock->format),
+-					       NULL);
+-}
+-
+-static void
+-clock_timezone_changed (SystemTimezone *systz,
+-			const char     *new_tz,
+-			ClockData      *cd)
+-{
+-	/* This will refresh the current location */
+-	save_cities_store (cd);
+-
+-	refresh_click_timeout_time_only (cd);
+-}
+-
+-static void
+-parse_and_set_temperature_string (const char *str, ClockData *cd)
+-{
+-        gint value = 0;
+-	gboolean use_default = FALSE;
+-
+-	value = gweather_prefs_parse_temperature (str, &use_default);
+-
+-	cd->use_temperature_default = use_default;
+-	cd->temperature_unit = value;
+-}
+-
+-static void
+-parse_and_set_speed_string (const char *str, ClockData *cd)
+-{
+-        gint value = 0;
+-	gboolean use_default = FALSE;
+-
+-	value = gweather_prefs_parse_speed (str, &use_default);
+-
+-	cd->use_speed_default = use_default;
+-	cd->speed_unit = value;
+-}
+-
+-static void
+-temperature_unit_changed (GConfClient  *client,
+-                          guint         cnxn_id,
+-                          GConfEntry   *entry,
+-                          ClockData    *cd)
+-{
+-        const gchar *value;
+-
+-        if (!entry->value || entry->value->type != GCONF_VALUE_STRING)
+-                return;
+-
+-        value = gconf_value_get_string (entry->value);
+-        parse_and_set_temperature_string (value, cd);
+-	update_temperature_combo (cd);
+-	update_weather_locations (cd);
+-}
+-
+-static void
+-update_speed_combo (ClockData *cd)
+-{
+-	GtkWidget *widget;
+-        int active_index;
+-
+-	widget = _clock_get_widget (cd, "wind_speed_combo");
+-
+-	if (cd->use_speed_default)
+-                active_index = 0;
+-        else
+-                active_index = cd->speed_unit - 1;
+-
+-        gtk_combo_box_set_active (GTK_COMBO_BOX (widget), active_index);
+-}
+-
+-static void
+-speed_unit_changed (GConfClient  *client,
+-                    guint         cnxn_id,
+-                    GConfEntry   *entry,
+-                    ClockData    *cd)
+-{
+-        const gchar *value;
+-
+-        if (!entry->value || entry->value->type != GCONF_VALUE_STRING)
+-                return;
+-
+-        value = gconf_value_get_string (entry->value);
+-        parse_and_set_speed_string (value, cd);
+-	update_speed_combo (cd);
+-	update_weather_locations (cd);
+-}
+-
+-static void
+-custom_format_changed (GConfClient  *client,
+-                       guint         cnxn_id,
+-                       GConfEntry   *entry,
+-                       ClockData    *clock)
+-{
+-	const char *value;
+-
+-	if (!entry->value || entry->value->type != GCONF_VALUE_STRING)
+-		return;
+-
+-	value = gconf_value_get_string (entry->value);
+-
+-        g_free (clock->custom_format);
+-	clock->custom_format = g_strdup (value);
+-
+-	if (clock->format == CLOCK_FORMAT_CUSTOM)
+-		refresh_clock (clock);
+-}
+-
+-static void
+-show_week_changed (GConfClient  *client,
+-		   guint         cnxn_id,
+-		   GConfEntry   *entry,
++show_week_changed (GSettings    *settings,
++                   const char   *key,
+ 		   ClockData    *clock)
+ {
+-	gboolean value;
+-
+-	if (!entry->value || entry->value->type != GCONF_VALUE_BOOL)
+-		return;
+-
+-	value = gconf_value_get_bool (entry->value);
+-
+-	if (clock->showweek == (value != 0))
+-		return;
+-
+-	clock->showweek = (value != 0);
+-
+ 	if (clock->calendar_popup != NULL) {
+-		calendar_window_set_show_weeks (CALENDAR_WINDOW (clock->calendar_popup), clock->showweek);
++		calendar_window_set_show_weeks (CALENDAR_WINDOW (clock->calendar_popup),
++                                                g_settings_get_boolean (settings, "show-weeks"));
+                 position_calendar_popup (clock);
+ 	}
+ }
+ 
+-static guint
+-setup_gconf_preference (ClockData *cd, GConfClient *client, const char *key_name, GConfClientNotifyFunc callback)
+-{
+-        char *key;
+-        guint id;
+-
+-        key = panel_applet_gconf_get_full_key (PANEL_APPLET (cd->applet),
+-                                               key_name);
+-        id = gconf_client_notify_add (client, key,
+-                                      callback,
+-                                      cd, NULL, NULL);
+-        g_free (key);
+-
+-        return id;
+-}
+-
+ static void
+-setup_gconf (ClockData *cd)
+-{
+-        struct {
+-                const char *key_name;
+-                GConfClientNotifyFunc callback;
+-        } prefs[] = {
+-                { KEY_FORMAT,		(GConfClientNotifyFunc) format_changed },
+-                { KEY_SHOW_SECONDS,	(GConfClientNotifyFunc) show_seconds_changed },
+-                { KEY_SHOW_DATE,	(GConfClientNotifyFunc) show_date_changed },
+-                { KEY_SHOW_WEATHER,	(GConfClientNotifyFunc) show_weather_changed },
+-                { KEY_SHOW_TEMPERATURE,	(GConfClientNotifyFunc) show_temperature_changed },
+-                { KEY_CUSTOM_FORMAT,	(GConfClientNotifyFunc) custom_format_changed },
+-                { KEY_SHOW_WEEK,	(GConfClientNotifyFunc) show_week_changed },
+-                { KEY_CITIES,		(GConfClientNotifyFunc) cities_changed },
+-                { KEY_TEMPERATURE_UNIT,	(GConfClientNotifyFunc) temperature_unit_changed },
+-                { KEY_SPEED_UNIT,	(GConfClientNotifyFunc) speed_unit_changed },
+-        };
+-
+-	GConfClient *client;
+-        int          i;
+-
+-	client = gconf_client_get_default ();
+-
+-        for (i = 0; i < G_N_ELEMENTS (prefs); i++)
+-                cd->listeners[i] = setup_gconf_preference (cd, client, prefs[i].key_name, prefs[i].callback);
+-
+-	g_object_unref (G_OBJECT (client));
+-}
+-
+-static GList *
+-parse_gconf_cities (ClockData *cd, GSList *values)
++load_cities (ClockData *cd)
+ {
+-        GSList *cur = values;
+-	LocationParserData data;
+-        GMarkupParseContext *context;
++        GVariantIter *iter;
++        const char *name;
++        const char *code;
++        gboolean latlon_override;
++        gdouble latitude, longitude;
+ 
+-	data.cities = NULL;
+-	data.cd = cd;
++        g_settings_get (cd->applet_settings, "cities", "a(ssm(dd))", &iter);
+ 
+-        context =
+-                g_markup_parse_context_new (&location_parser, 0, &data, NULL);
++        while (g_variant_iter_loop (iter, "(&s&sm(dd))", &name, &code, &latlon_override,
++                                    &latitude, &longitude)) {
++                ClockLocation *loc;
+ 
+-        while (cur) {
+-                const char *str = (char *)cur->data;
+-                g_markup_parse_context_parse (context, str, strlen(str), NULL);
++                loc = clock_location_new (cd->world,
++                                          name, code,
++                                          latlon_override, latitude, longitude);
+ 
+-                cur = cur->next;
++                cd->locations = g_list_prepend (cd->locations, loc);
+         }
+ 
+-        g_markup_parse_context_free (context);
+-
+-        return data.cities;
+-}
+-
+-static void
+-load_gconf_settings (ClockData *cd)
+-{
+-        PanelApplet *applet;
+-        int format;
+-        char *format_str;
+-        char *value;
+-        GError *error;
+-        GSList *values = NULL;
+-        GList *cities = NULL;
+-
+-        applet = PANEL_APPLET (cd->applet);
+-
+-        cd->format = CLOCK_FORMAT_INVALID;
+-
+-	format_str = panel_applet_gconf_get_string (applet, KEY_FORMAT, NULL);
+-	if (format_str &&
+-            gconf_string_to_enum (format_type_enum_map, format_str, &format))
+-                cd->format = format;
+-	else
+-		clock_migrate_to_26 (cd);
+-
+-        g_free (format_str);
+-
+-	if (cd->format == CLOCK_FORMAT_INVALID)
+-		cd->format = clock_locale_format ();
+-
+-	cd->custom_format = panel_applet_gconf_get_string (applet, KEY_CUSTOM_FORMAT, NULL);
+-	cd->showseconds = panel_applet_gconf_get_bool (applet, KEY_SHOW_SECONDS, NULL);
+-
+-	error = NULL;
+-	cd->showdate = panel_applet_gconf_get_bool (applet, KEY_SHOW_DATE, &error);
+-	if (error) {
+-		g_error_free (error);
+-		/* if on a small screen don't show date by default */
+-		if (gdk_screen_width () <= 800)
+-			cd->showdate = FALSE;
+-		else
+-			cd->showdate = TRUE;
+-	}
+-
+-        cd->show_weather = panel_applet_gconf_get_bool (applet, KEY_SHOW_WEATHER, NULL);
+-        cd->show_temperature = panel_applet_gconf_get_bool (applet, KEY_SHOW_TEMPERATURE, NULL);
+-	cd->showweek = panel_applet_gconf_get_bool (applet, KEY_SHOW_WEEK, NULL);
+-        cd->timeformat = NULL;
+-
+-	cd->can_handle_format_12 = (clock_locale_format () == CLOCK_FORMAT_12);
+-	if (!cd->can_handle_format_12 && cd->format == CLOCK_FORMAT_12)
+-		cd->format = CLOCK_FORMAT_24;
+-
+-	value = panel_applet_gconf_get_string (applet, KEY_TEMPERATURE_UNIT, NULL);
+-	parse_and_set_temperature_string (value, cd);
+-        g_free (value);
+-
+-	value = panel_applet_gconf_get_string (applet, KEY_SPEED_UNIT, NULL);
+-	parse_and_set_speed_string (value, cd);
+-        g_free (value);
+-
+-        values = panel_applet_gconf_get_list (PANEL_APPLET (cd->applet), KEY_CITIES,
+-                                              GCONF_VALUE_STRING, NULL);
+-
+-        if (g_slist_length (values) == 0) {
+-                cities = NULL;
+-        } else {
+-                cities = parse_gconf_cities (cd, values);
+-        }
+-
+-        set_locations (cd, cities);
++        cd->locations = g_list_reverse (cd->locations);
+ }
+ 
+ static gboolean
+@@ -2410,17 +1362,29 @@
+         GtkActionGroup *action_group;
+         GtkAction      *action;
+ 
+-	panel_applet_add_preferences (applet, CLOCK_SCHEMA_DIR, NULL);
+ 	panel_applet_set_flags (applet, PANEL_APPLET_EXPAND_MINOR);
+ 
+ 	cd = g_new0 (ClockData, 1);
++
++	cd->applet_settings = panel_applet_settings_new (applet, "org.gnome.gnome-panel.applet.clock");
++        cd->clock_settings = g_settings_new ("org.gnome.desktop.interface");
++        cd->weather_settings = g_settings_new ("org.gnome.GWeather");
++
++        g_signal_connect (cd->clock_settings, "changed::clock-format",
++                          G_CALLBACK (format_changed), cd);
++        g_signal_connect (cd->clock_settings, "changed::clock-show-weeks",
++                          G_CALLBACK (show_week_changed), cd);
++        g_signal_connect (cd->applet_settings, "changed::cities",
++                          G_CALLBACK (locations_changed), cd);
++
+ 	cd->fixed_width = -1;
+ 	cd->fixed_height = -1;
+ 
+ 	cd->applet = GTK_WIDGET (applet);
+ 
+-	setup_gconf (cd);
+-        load_gconf_settings (cd);
++        cd->world = gweather_location_new_world (FALSE);
++        load_cities (cd);
++        locations_changed (NULL, NULL, cd);
+ 
+ 	cd->builder = gtk_builder_new ();
+ 	gtk_builder_set_translation_domain (cd->builder, GETTEXT_PACKAGE);
+@@ -2469,191 +1433,11 @@
+ 	g_object_bind_property (cd->applet, "locked-down",
+ 				action, "visible",
+ 				G_BINDING_DEFAULT|G_BINDING_INVERT_BOOLEAN|G_BINDING_SYNC_CREATE);
+-
+-	cd->systz = system_timezone_new ();
+-	g_signal_connect (cd->systz, "changed",
+-			  G_CALLBACK (clock_timezone_changed), cd);
+-
+         g_object_unref (action_group);
+ 
+ 	return TRUE;
+ }
+ 
+-/* FIXME old clock applet */
+-#if 0
+-static void
+-setup_writability_sensitivity (ClockData *clock, GtkWidget *w, GtkWidget *label, const char *key)
+-{
+-        /* FMQ: was used from old preferences dialog; fix this up */
+-	char *fullkey;
+-	GConfClient *client;
+-
+-	client = gconf_client_get_default ();
+-
+-	fullkey = panel_applet_gconf_get_full_key
+-		(PANEL_APPLET (clock->applet), key);
+-
+-	if ( ! gconf_client_key_is_writable (client, fullkey, NULL)) {
+-		g_object_set_data (G_OBJECT (w), NEVER_SENSITIVE,
+-				   GINT_TO_POINTER (1));
+-		gtk_widget_set_sensitive (w, FALSE);
+-		if (label != NULL) {
+-			g_object_set_data (G_OBJECT (label), NEVER_SENSITIVE,
+-					   GINT_TO_POINTER (1));
+-			gtk_widget_set_sensitive (label, FALSE);
+-		}
+-	}
+-
+-	g_free (fullkey);
+-
+-	g_object_unref (G_OBJECT (client));
+-}
+-
+-static void
+-update_properties_for_format (ClockData   *cd,
+-                              GtkComboBox *combo,
+-                              ClockFormat  format)
+-{
+-
+-        /* show the custom format things the first time we actually
+-         * have a custom format set in GConf, but after that don't
+-         * unshow it if the format changes
+-         */
+-        if (!cd->custom_format_shown &&
+-            (cd->format == CLOCK_FORMAT_CUSTOM ||
+-             (cd->custom_format && cd->custom_format [0]))) {
+-                gtk_widget_show (cd->custom_hbox);
+-                gtk_widget_show (cd->custom_label);
+-                gtk_widget_show (cd->custom_entry);
+-
+-                gtk_combo_box_append_text (combo, _("Custom format"));
+-
+-                cd->custom_format_shown = TRUE;
+-        }
+-
+-        /* Some combinations of options do not make sense */
+-        switch (format) {
+-        case CLOCK_FORMAT_12:
+-        case CLOCK_FORMAT_24:
+-                gtk_widget_set_sensitive (cd->showseconds_check, TRUE);
+-                gtk_widget_set_sensitive (cd->showdate_check, TRUE);
+-		gtk_widget_set_sensitive (cd->custom_entry, FALSE);
+-		gtk_widget_set_sensitive (cd->custom_label, FALSE);
+-                break;
+-        case CLOCK_FORMAT_UNIX:
+-                gtk_widget_set_sensitive (cd->showseconds_check, FALSE);
+-                gtk_widget_set_sensitive (cd->showdate_check, FALSE);
+-                gtk_widget_set_sensitive (cd->custom_entry, FALSE);
+-                gtk_widget_set_sensitive (cd->custom_label, FALSE);
+-                break;
+-        case CLOCK_FORMAT_INTERNET:
+-                gtk_widget_set_sensitive (cd->showseconds_check, TRUE);
+-                gtk_widget_set_sensitive (cd->showdate_check, FALSE);
+-		gtk_widget_set_sensitive (cd->custom_entry, FALSE);
+-		gtk_widget_set_sensitive (cd->custom_label, FALSE);
+-                break;
+-	case CLOCK_FORMAT_CUSTOM:
+-		gtk_widget_set_sensitive (cd->showseconds_check, FALSE);
+-		gtk_widget_set_sensitive (cd->showdate_check, FALSE);
+-		gtk_widget_set_sensitive (cd->custom_entry, TRUE);
+-		gtk_widget_set_sensitive (cd->custom_label, TRUE);
+-                break;
+-        default:
+-                g_assert_not_reached ();
+-                break;
+-	}
+-}
+-
+-static void
+-set_format_cb (GtkComboBox *combo,
+-	       ClockData   *cd)
+-{
+-        /* FMQ: was used from old preferences dialog; fix this up */
+-        ClockFormat format;
+-
+-	/* valid values begin from 1 */
+-	if (cd->can_handle_format_12)
+-		format = gtk_combo_box_get_active (combo) + 1;
+-	else
+-		format = gtk_combo_box_get_active (combo) + 2;
+-
+-        update_properties_for_format (cd, combo, format);
+-
+-        if (cd->format != format)
+-                panel_applet_gconf_set_string (PANEL_APPLET (cd->applet),
+-                                               KEY_FORMAT,
+-                                               gconf_enum_to_string (format_type_enum_map, format),
+-                                               NULL);
+-}
+-#endif
+-
+-static void
+-set_show_seconds_cb (GtkWidget *w,
+-                     ClockData *clock)
+-{
+-	panel_applet_gconf_set_bool (PANEL_APPLET (clock->applet),
+-				     KEY_SHOW_SECONDS,
+-				     gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w)),
+-				     NULL);
+-}
+-
+-static void
+-set_show_date_cb (GtkWidget *w,
+-		  ClockData *clock)
+-{
+-	panel_applet_gconf_set_bool (PANEL_APPLET (clock->applet),
+-				     KEY_SHOW_DATE,
+-				     gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w)),
+-				     NULL);
+-}
+-
+-static void
+-set_show_weather_cb (GtkWidget *w,
+-                     ClockData *clock)
+-{
+-	panel_applet_gconf_set_bool (PANEL_APPLET (clock->applet),
+-				     KEY_SHOW_WEATHER,
+-				     gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w)),
+-				     NULL);
+-}
+-
+-static void
+-set_show_temperature_cb (GtkWidget *w,
+-                         ClockData *clock)
+-{
+-	panel_applet_gconf_set_bool (PANEL_APPLET (clock->applet),
+-				     KEY_SHOW_TEMPERATURE,
+-				     gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w)),
+-				     NULL);
+-}
+-
+-#if 0
+-static void
+-set_show_zones_cb (GtkWidget *w,
+-		   ClockData *clock)
+-{
+-	panel_applet_gconf_set_bool (PANEL_APPLET (clock->applet),
+-				     KEY_SHOW_ZONES,
+-				     GTK_TOGGLE_BUTTON (w)->active,
+-				     NULL);
+-}
+-#endif
+-
+-/* FIXME old clock applet */
+-#if 0
+-static void
+-set_custom_format_cb (GtkEntry  *entry,
+-		      ClockData *cd)
+-{
+-        /* FMQ: was used from old preferences dialog; fix this up */
+-	const char *custom_format;
+-
+-	custom_format = gtk_entry_get_text (entry);
+-	panel_applet_gconf_set_string (PANEL_APPLET (cd->applet),
+-				       KEY_CUSTOM_FORMAT, custom_format, NULL);
+-}
+-#endif
+-
+ static void
+ prefs_locations_changed (GtkTreeSelection *selection, ClockData *cd)
+ {
+@@ -2664,60 +1448,38 @@
+         gtk_widget_set_sensitive (cd->prefs_location_remove_button, n > 0);
+ }
+ 
+-static gchar *
+-loc_to_string (ClockLocation *loc)
++static GVariant *
++location_serialize (ClockLocation *loc)
+ {
+-        const gchar *name, *city;
+-        gfloat latitude, longitude;
+-        gchar *ret;
+-
+-        name = clock_location_get_name (loc);
+-        city = clock_location_get_city (loc);
+-        clock_location_get_coords (loc, &latitude, &longitude);
++        gdouble lat, lon;
+ 
+-        setlocale (LC_NUMERIC, "POSIX");
+-	
+-        ret = g_markup_printf_escaped
+-                ("<location name=\"%s\" city=\"%s\" timezone=\"%s\" latitude=\"%f\" longitude=\"%f\" code=\"%s\" current=\"%s\"/>",
+-                 name ? name : "",
+-                 city ? city : "",
+-                 clock_location_get_timezone (loc),
+-                 latitude, longitude,
+-		 clock_location_get_weather_code (loc),
+-		 clock_location_is_current (loc) ? "true" : "false");
+-
+-        setlocale (LC_NUMERIC, "");
+-
+-        return ret;
++        clock_location_get_coords (loc, &lat, &lon);
++        return g_variant_new ("(ssm(dd))",
++                              clock_location_get_name (loc),
++                              clock_location_get_weather_code (loc),
++                              TRUE, lat, lon);
+ }
+ 
+ static void
+ save_cities_store (ClockData *cd)
+ {
+         ClockLocation *loc;
+-        GList *node = cd->locations;
+-
+-        GSList *root = NULL;
+-        GSList *list = NULL;
+-
+-        while (node) {
+-                loc = CLOCK_LOCATION (node->data);
+-                list = g_slist_prepend (list, loc_to_string (loc));
+-                node = node->next;
+-        }
++        GVariantBuilder builder;
++        GList *list;
+ 
+-        list = g_slist_reverse (list);
+-	panel_applet_gconf_set_list (PANEL_APPLET (cd->applet),
+-                                     KEY_CITIES, GCONF_VALUE_STRING, list, NULL);
+-
+-        root = list;
++        g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(ssm(dd))"));
+ 
++        list = cd->locations;
+         while (list) {
+-                g_free (list->data);
+-                list = g_slist_next (list);
++                loc = CLOCK_LOCATION (list->data);
++                g_variant_builder_add_value (&builder,
++                                             location_serialize (loc));
++
++                list = list->next;
+         }
+ 
+-        g_slist_free (root);
++        g_settings_set_value (cd->applet_settings, "cities",
++                              g_variant_builder_end (&builder));
+ }
+ 
+ static void
+@@ -2739,6 +1501,11 @@
+         gfloat lat = 0;
+         gfloat lon = 0;
+ 
++        if (loc) {
++                cd->locations = g_list_remove (cd->locations, loc);
++                g_object_unref (loc);
++        }
++
+         timezone = gweather_timezone_menu_get_tzid (cd->zone_combo);
+         if (!timezone) {
+                 edit_hide (NULL, cd);
+@@ -2750,11 +1517,12 @@
+         name = NULL;
+ 
+         gloc = gweather_location_entry_get_location (cd->location_entry);
+-        if (gloc) {
+-                city = gweather_location_get_city_name (gloc);
+-                weather_code = gweather_location_get_code (gloc);
++        if (!gloc) {
++                edit_hide (NULL, cd);
++                return;
+         }
+ 
++        weather_code = gweather_location_get_code (gloc);
+         if (gweather_location_entry_has_custom_text (cd->location_entry)) {
+                 name = gtk_editable_get_chars (GTK_EDITABLE (cd->location_entry), 0, -1);
+         }
+@@ -2770,27 +1538,14 @@
+                 lon = -lon;
+         }
+ 
+-        if (loc) {
+-                clock_location_set_timezone (loc, timezone);
+-                clock_location_set_name (loc, name);
+-                clock_location_set_city (loc, city);
+-                clock_location_set_coords (loc, lat, lon);
+-		clock_location_set_weather_code (loc, weather_code);
+-        } else {
+-		WeatherPrefs prefs;
++        loc = clock_location_new (cd->world, name, weather_code, TRUE, lat, lon);
++        /* 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);
+ 
+-		prefs.temperature_unit = cd->temperature_unit;
+-		prefs.speed_unit = cd->speed_unit;
+- 
+-                loc = clock_location_new (name, city, timezone, 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);
+ 
+-                cd->locations = g_list_append (cd->locations, loc);
+-        }
+-        g_free (name);
+         g_free (city);
+ 
+ 	/* This will update everything related to locations to take into
+@@ -2963,8 +1718,6 @@
+ 	tree = _clock_get_widget (cd, "cities_list");
+ 
+         gtk_tree_selection_unselect_all (gtk_tree_view_get_selection (GTK_TREE_VIEW (tree)));
+-
+-        refresh_click_timeout_time_only (cd);
+ }
+ 
+ static gboolean
+@@ -3036,7 +1789,7 @@
+         ClockLocation *loc;
+         const char *name;
+         gchar *tmp;
+-        gfloat lat, lon;
++        gdouble lat, lon;
+ 
+         /* fill the dialog with this location's data, show it */
+         GtkWidget *edit_window = _clock_get_widget (cd, "edit-location-window");
+@@ -3107,85 +1860,38 @@
+ static void
+ set_12hr_format_radio_cb (GtkWidget *widget, ClockData *cd)
+ {
+-	const gchar *val;
+-        ClockFormat format;
++        GDesktopClockFormat format;
+ 
+ 	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
+-                format = CLOCK_FORMAT_12;
++                format = G_DESKTOP_CLOCK_FORMAT_12H;
+         else
+-                format = CLOCK_FORMAT_24;
+-
+-        val = gconf_enum_to_string (format_type_enum_map, format);
++                format = G_DESKTOP_CLOCK_FORMAT_24H;
+ 
+-	panel_applet_gconf_set_string (PANEL_APPLET (cd->applet),
+-				       KEY_FORMAT, val, NULL);
+-}
+-
+-static void
+-temperature_combo_changed (GtkComboBox *combo, ClockData *cd)
+-{
+-	int value;
+-	int old_value;
+-	const gchar *str;
+-
+-	value = gtk_combo_box_get_active (combo) + 1;
+-
+-	if (cd->use_temperature_default)
+-		old_value = TEMP_UNIT_DEFAULT;
+-	else
+-		old_value = cd->temperature_unit;
+-
+-	if (value == old_value)
+-		return;
+-
+-	str = gweather_prefs_temp_enum_to_string (value);
+-
+-	panel_applet_gconf_set_string (PANEL_APPLET (cd->applet),
+-				       KEY_TEMPERATURE_UNIT, str, NULL);
+-}
+-
+-static void
+-speed_combo_changed (GtkComboBox *combo, ClockData *cd)
+-{
+-	int value;
+-	int old_value;
+-	const gchar *str;
+-
+-	value = gtk_combo_box_get_active (combo) + 1;
+-
+-	if (cd->use_speed_default)
+-		old_value = SPEED_UNIT_DEFAULT;
+-	else
+-		old_value = cd->speed_unit;
+-
+-	if (value == old_value)
+-		return;
+-
+-	str = gweather_prefs_speed_enum_to_string (value);
+-
+-	panel_applet_gconf_set_string (PANEL_APPLET (cd->applet),
+-				       KEY_SPEED_UNIT, str, NULL);
++        g_settings_set_enum (cd->clock_settings, "clock-format", format);
+ }
+ 
+ static void
+ fill_prefs_window (ClockData *cd)
+ {
+-        static const int temperatures[] = {
+-                TEMP_UNIT_DEFAULT,
+-                TEMP_UNIT_KELVIN,
+-                TEMP_UNIT_CENTIGRADE,
+-                TEMP_UNIT_FAHRENHEIT,
+-                -1
++        struct int_char_pair {
++                int v;
++                const char *c;
+         };
+ 
+-        static const int speeds[] = {
+-                SPEED_UNIT_DEFAULT,
+-                SPEED_UNIT_MS,
+-                SPEED_UNIT_KPH,
+-                SPEED_UNIT_MPH,
+-                SPEED_UNIT_KNOTS,
+-                SPEED_UNIT_BFT,
+-                -1
++        static const struct int_char_pair temperatures[] = {
++                { GWEATHER_TEMP_UNIT_KELVIN, N_("Kelvin") },
++                { GWEATHER_TEMP_UNIT_CENTIGRADE, N_("Celsius") },
++                { GWEATHER_TEMP_UNIT_FAHRENHEIT, N_("Fahrenheit") },
++                { -1 }
++        };
++
++        static const struct int_char_pair speeds[] = {
++                { GWEATHER_SPEED_UNIT_MS, N_("Meters per second (m/s)") },
++                { GWEATHER_SPEED_UNIT_KPH, N_("Kilometers per hour (kph)") },
++                { GWEATHER_SPEED_UNIT_MPH, N_("Miles per hour (mph)") },
++                { GWEATHER_SPEED_UNIT_KNOTS, N_("Knots") },
++                { GWEATHER_SPEED_UNIT_BFT, N_("Beaufort scale") },
++                { -1 }
+         };
+ 
+         GtkWidget *radio_12hr;
+@@ -3195,13 +1901,15 @@
+         GtkTreeViewColumn *col;
+ 	GtkListStore *store;
+         GtkTreeIter iter;
++        GEnumClass *enum_class;
+         int i;
+ 
+ 	/* Set the 12 hour / 24 hour widget */
+         radio_12hr = _clock_get_widget (cd, "12hr_radio");
+         radio_24hr = _clock_get_widget (cd, "24hr_radio");
+ 
+-        if (cd->format == CLOCK_FORMAT_12)
++        if (g_settings_get_enum (cd->clock_settings, "clock-format") ==
++            G_DESKTOP_CLOCK_FORMAT_12H)
+                 widget = radio_12hr;
+         else
+                 widget = radio_24hr;
+@@ -3213,27 +1921,23 @@
+ 
+ 	/* Set the "Show Date" checkbox */
+ 	widget = _clock_get_widget (cd, "date_check");
+-	g_signal_connect (widget, "toggled",
+-                          G_CALLBACK (set_show_date_cb), cd);
+-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), cd->showdate);
++        g_settings_bind (cd->clock_settings, "clock-show-date", widget, "active",
++                         G_SETTINGS_BIND_DEFAULT);
+ 
+ 	/* Set the "Show Seconds" checkbox */
+ 	widget = _clock_get_widget (cd, "seconds_check");
+-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), cd->showseconds);
+-	g_signal_connect (widget, "toggled",
+-                          G_CALLBACK (set_show_seconds_cb), cd);
++        g_settings_bind (cd->clock_settings, "clock-show-seconds", widget, "active",
++                         G_SETTINGS_BIND_DEFAULT);
+ 
+ 	/* Set the "Show weather" checkbox */
+ 	widget = _clock_get_widget (cd, "weather_check");
+-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), cd->show_weather);
+-	g_signal_connect (widget, "toggled",
+-                          G_CALLBACK (set_show_weather_cb), cd);
++        g_settings_bind (cd->applet_settings, "show-weather", widget, "active",
++                         G_SETTINGS_BIND_DEFAULT);
+ 
+ 	/* Set the "Show temperature" checkbox */
+ 	widget = _clock_get_widget (cd, "temperature_check");
+-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), cd->show_temperature);
+-	g_signal_connect (widget, "toggled",
+-                          G_CALLBACK (set_show_temperature_cb), cd);
++        g_settings_bind (cd->applet_settings, "show-temperature", widget, "active",
++                         G_SETTINGS_BIND_DEFAULT);
+ 
+ 	/* Fill the Cities list */
+ 	widget = _clock_get_widget (cd, "cities_list");
+@@ -3254,37 +1958,43 @@
+ 
+         /* Temperature combo */
+ 	widget = _clock_get_widget (cd, "temperature_combo");
+-	store = gtk_list_store_new (1, G_TYPE_STRING);
++	store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
+ 	gtk_combo_box_set_model (GTK_COMBO_BOX (widget), GTK_TREE_MODEL (store));
++        gtk_combo_box_set_id_column (GTK_COMBO_BOX (widget), 0);
+ 	renderer = gtk_cell_renderer_text_new ();
+ 	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (widget), renderer, TRUE);
+-	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (widget), renderer, "text", 0, NULL);
++	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (widget), renderer, "text", 1, NULL);
+ 
+-        for (i = 0; temperatures[i] != -1; i++)
++        enum_class = g_type_class_ref (GWEATHER_TYPE_TEMPERATURE_UNIT);
++        for (i = 0; temperatures[i].v != -1; i++)
+                 gtk_list_store_insert_with_values (store, &iter, -1,
+-                                                   0, gweather_prefs_get_temp_display_name (temperatures[i]),
++                                                   0, g_enum_get_value (enum_class, temperatures[i].v)->value_nick,
++                                                   1, gettext (temperatures[i].c),
+                                                    -1);
++        g_type_class_unref (enum_class);
+ 
+-	update_temperature_combo (cd);
+-	g_signal_connect (widget, "changed",
+-                          G_CALLBACK (temperature_combo_changed), cd);
++        g_settings_bind (cd->weather_settings, "temperature-unit", widget, "active-id",
++                         G_SETTINGS_BIND_DEFAULT);
+ 
+         /* Wind speed combo */
+ 	widget = _clock_get_widget (cd, "wind_speed_combo");
+-	store = gtk_list_store_new (1, G_TYPE_STRING);
++	store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
+ 	gtk_combo_box_set_model (GTK_COMBO_BOX (widget), GTK_TREE_MODEL (store));
++        gtk_combo_box_set_id_column (GTK_COMBO_BOX (widget), 0);
+ 	renderer = gtk_cell_renderer_text_new ();
+ 	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (widget), renderer, TRUE);
+-	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (widget), renderer, "text", 0, NULL);
++	gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (widget), renderer, "text", 1, NULL);
+ 
+-        for (i = 0; speeds[i] != -1; i++)
++        enum_class = g_type_class_ref (GWEATHER_TYPE_SPEED_UNIT);
++        for (i = 0; speeds[i].v != -1; i++)
+                 gtk_list_store_insert_with_values (store, &iter, -1,
+-                                                   0, gweather_prefs_get_speed_display_name (speeds[i]),
++                                                   0, g_enum_get_value (enum_class, speeds[i].v)->value_nick,
++                                                   1, gettext (speeds[i].c),
+                                                    -1);
++        g_type_class_unref (enum_class);
+ 
+-	update_speed_combo (cd);
+-	g_signal_connect (widget, "changed",
+-                          G_CALLBACK (speed_combo_changed), cd);
++        g_settings_bind (cd->weather_settings, "speed-unit", widget, "active-id",
++                         G_SETTINGS_BIND_DEFAULT);
+ }
+ 
+ static void
+@@ -3301,7 +2011,6 @@
+         GtkWidget *location_name_label;
+         GtkWidget *timezone_label;
+         GtkTreeSelection *selection;
+-        GWeatherLocation *world;
+ 
+         if (cd->prefs_window)
+                 return;
+@@ -3361,10 +2070,8 @@
+ 
+         edit_ok_button = _clock_get_widget (cd, "edit-location-ok-button");
+ 
+-        world = gweather_location_new_world (FALSE);
+-
+         location_box = _clock_get_widget (cd, "edit-location-name-box");
+-        cd->location_entry = GWEATHER_LOCATION_ENTRY (gweather_location_entry_new (world));
++        cd->location_entry = GWEATHER_LOCATION_ENTRY (gweather_location_entry_new (cd->world));
+         gtk_widget_show (GTK_WIDGET (cd->location_entry));
+         gtk_container_add (GTK_CONTAINER (location_box), GTK_WIDGET (cd->location_entry));
+         gtk_label_set_mnemonic_widget (GTK_LABEL (location_name_label),
+@@ -3376,7 +2083,7 @@
+                           G_CALLBACK (location_name_changed), cd);
+ 
+         zone_box = _clock_get_widget (cd, "edit-location-timezone-box");
+-        cd->zone_combo = GWEATHER_TIMEZONE_MENU (gweather_timezone_menu_new (world));
++        cd->zone_combo = GWEATHER_TIMEZONE_MENU (gweather_timezone_menu_new (cd->world));
+         gtk_widget_show (GTK_WIDGET (cd->zone_combo));
+         gtk_container_add (GTK_CONTAINER (zone_box), GTK_WIDGET (cd->zone_combo));
+         gtk_label_set_mnemonic_widget (GTK_LABEL (timezone_label),
+@@ -3385,8 +2092,6 @@
+         g_signal_connect (G_OBJECT (cd->zone_combo), "notify::tzid",
+                           G_CALLBACK (location_timezone_changed), cd);
+ 
+-        gweather_location_unref (world);
+-
+         g_signal_connect (G_OBJECT (edit_cancel_button), "clicked",
+                           G_CALLBACK (edit_hide), cd);
+ 
+@@ -3418,77 +2123,6 @@
+         gtk_window_set_screen (GTK_WINDOW (cd->prefs_window),
+                                gtk_widget_get_screen (cd->applet));
+ 	gtk_window_present (GTK_WINDOW (cd->prefs_window));
+-
+-        refresh_click_timeout_time_only (cd);
+-
+-        /* FMQ: cd->props was the old preferences window; remove references to it */
+-        /* FMQ: connect to the Help button by hand; look at properties_response_cb() for the help code */
+-#if 0
+-        /* FMQ: check the code below; replace the proper parts */
+-	GtkWidget *hbox;
+-	GtkWidget *vbox;
+-	GtkWidget *combo;
+-	GtkWidget *label;
+-
+-        gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("24 hour"));
+-        gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("UNIX time"));
+-        gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _("Internet time"));
+-
+-	gtk_box_pack_start (GTK_BOX (hbox), combo, FALSE, FALSE, 0);
+-	gtk_widget_show (combo);
+-
+-	cd->custom_hbox = gtk_hbox_new (FALSE, 12);
+-	gtk_box_pack_start (GTK_BOX (vbox), cd->custom_hbox, TRUE, TRUE, 0);
+-
+-	cd->custom_label = gtk_label_new_with_mnemonic (_("Custom _format:"));
+-	gtk_label_set_use_markup (GTK_LABEL (cd->custom_label), TRUE);
+-	gtk_label_set_justify (GTK_LABEL (cd->custom_label),
+-			       GTK_JUSTIFY_LEFT);
+-	gtk_misc_set_alignment (GTK_MISC (cd->custom_label), 0, 0.5);
+-	gtk_box_pack_start (GTK_BOX (cd->custom_hbox),
+-                            cd->custom_label,
+-			    FALSE, FALSE, 0);
+-
+-	cd->custom_entry = gtk_entry_new ();
+-	gtk_box_pack_start (GTK_BOX (cd->custom_hbox),
+-                            cd->custom_entry,
+-			    FALSE, FALSE, 0);
+-	gtk_entry_set_text (GTK_ENTRY (cd->custom_entry),
+-			    cd->custom_format);
+-	g_signal_connect (cd->custom_entry, "changed",
+-			  G_CALLBACK (set_custom_format_cb),
+-			  cd);
+-
+-	g_signal_connect (cd->props, "destroy",
+-			  G_CALLBACK (gtk_widget_destroyed),
+-                          &cd->props);
+-	g_signal_connect (cd->props, "response",
+-			  G_CALLBACK (properties_response_cb),
+-                          cd);
+-
+-	cd->custom_format_shown = FALSE;
+-	update_properties_for_format (cd, GTK_COMBO_BOX (combo), cd->format);
+-
+-	/* valid values begin from 1 */
+-	if (cd->can_handle_format_12)
+-		gtk_combo_box_set_active (GTK_COMBO_BOX (combo),
+-					  cd->format - 1);
+-	else
+-		gtk_combo_box_set_active (GTK_COMBO_BOX (combo),
+-					  cd->format - 2);
+-
+-        g_signal_connect (combo, "changed",
+-                          G_CALLBACK (set_format_cb), cd);
+-
+-	/* Now set up the sensitivity based on gconf key writability */
+-	setup_writability_sensitivity (cd, combo, label, KEY_FORMAT);
+-	setup_writability_sensitivity (cd, cd->custom_entry, cd->custom_label,
+-				       KEY_CUSTOM_FORMAT);
+-	setup_writability_sensitivity (cd, cd->showseconds_check, NULL, KEY_SHOW_SECONDS);
+-	setup_writability_sensitivity (cd, cd->showdate_check, NULL, KEY_SHOW_DATE);
+-
+-	gtk_widget_show (cd->props);
+-#endif
+ }
+ 
+ static void
+--- a/applets/clock/clock.schemas.in
++++ /dev/null
+@@ -1,313 +0,0 @@
+-<?xml version="1.0"?>
+-<gconfschemafile>
+-    <schemalist>
+-
+-      <schema>
+-        <key>/schemas/apps/clock_applet/prefs/format</key>
+-        <owner>clock-applet</owner>
+-        <type>string</type>
+-        <locale name="C">
+-          <default>
+-            <!-- Translators:
+-               This controls whether the GNOME panel clock should display time in 24 hour mode
+-               or 12 hour mode by default. The only valid values for this are "24-hour" and
+-               "12-hour". If your locale uses 24 hour time notation, translate this to "24-hour".
+-               If your locale uses 12 hour time notation with am/pm, translate this to "12-hour".
+-
+-               Do NOT translate this into anything else than "24-hour" or "12-hour". For example,
+-               if you translate this to "24 sata" or anything else that isn't "24-hour" or
+-               "12-hour", things will not work.
+-              -->
+-            24-hour
+-          </default>
+-          <short>Hour format</short>
+-          <long>
+-            This key specifies the hour format used by the clock applet.
+-            Possible values are "12-hour", "24-hour", "internet", "unix" and
+-	    "custom".
+-            If set to "internet", the clock will display Internet time.
+-            The Internet time system divides the day into 1000 ".beats". There
+-            are no time zones in this system, so time is the same all over the
+-            world.
+-            If set to "unix", the clock will display time in seconds since
+-            Epoch, i.e. 1970-01-01.
+-	    If set to "custom", the clock will display time according to the
+-	    format specified in the custom_format key.
+-          </long>
+-        </locale>
+-	<locale name="en_US">
+-	  <default>12-hour</default>
+-	</locale>
+-      </schema>
+-
+-      <schema>
+-        <key>/schemas/apps/clock_applet/prefs/custom_format</key>
+-        <owner>clock-applet</owner>
+-        <type>string</type>
+-        <default></default>
+-        <locale name="C">
+-          <short>Custom format of the clock</short>
+-          <long>
+-            This key specifies the format used by the clock applet when the
+-	    format key is set to "custom". You can use conversion specifiers
+-	    understood by strftime() to obtain a specific format. See the
+-	    strftime() manual for more information.
+-          </long>
+-        </locale>
+-      </schema>
+-
+-      <schema>
+-        <key>/schemas/apps/clock_applet/prefs/show_seconds</key>
+-        <owner>clock-applet</owner>
+-        <type>bool</type>
+-        <default>false</default>
+-        <locale name="C">
+-          <short>Show time with seconds</short>
+-          <long>If true, display seconds in time.</long>
+-        </locale>
+-      </schema>
+-
+-      <schema>
+-        <key>/schemas/apps/clock_applet/prefs/show_date</key>
+-        <owner>clock-applet</owner>
+-        <type>bool</type>
+-        <default>true</default>
+-        <locale name="C">
+-          <short>Show date in clock</short>
+-          <long>If true, display date in the clock, in addition to time.</long>
+-        </locale>
+-      </schema>
+-
+-      <schema>
+-        <key>/schemas/apps/clock_applet/prefs/show_tooltip</key>
+-        <owner>clock-applet</owner>
+-        <type>bool</type>
+-        <default>true</default>
+-        <locale name="C">
+-          <short>Show date in tooltip</short>
+-          <long>
+-            If true, show date in a tooltip when the pointer is over the clock.
+-          </long>
+-        </locale>
+-      </schema>
+-
+-      <schema>
+-        <key>/schemas/apps/clock_applet/prefs/show_weather</key>
+-        <owner>clock-applet</owner>
+-        <type>bool</type>
+-        <default>true</default>
+-        <locale name="C">
+-          <short>Show weather in clock</short>
+-          <long>If true, display a weather icon.</long>
+-        </locale>
+-      </schema>
+-
+-      <schema>
+-        <key>/schemas/apps/clock_applet/prefs/show_temperature</key>
+-        <owner>clock-applet</owner>
+-        <type>bool</type>
+-        <default>true</default>
+-        <locale name="C">
+-          <short>Show temperature in clock</short>
+-          <long>If true, show the temperature next to the weather icon.</long>
+-        </locale>
+-      </schema>
+-
+-      <schema>
+-        <key>/schemas/apps/clock_applet/prefs/gmt_time</key>
+-        <owner>clock-applet</owner>
+-        <type>bool</type>
+-        <default>false</default>
+-        <locale name="C">
+-          <short>Use UTC</short>
+-          <long>
+-	    The use of this key was deprecated in GNOME 2.28 in favour of the
+-	    use of timezones. The schema is retained for compatibility with
+-	    older versions.
+-          </long>
+-        </locale>
+-      </schema>
+-
+-      <schema>
+-        <key>/schemas/apps/clock_applet/prefs/config_tool</key>
+-        <owner>clock-applet</owner>
+-        <type>string</type>
+-        <default> </default>
+-        <locale name="C">
+-          <short>Time configuration tool</short>
+-          <long>
+-            The use of this key was deprecated in GNOME 2.22 with the use
+-            of an internal time configuration tool. The schema is retained for
+-            compatibility with older versions.
+-          </long>
+-        </locale>
+-      </schema>
+-
+-      <schema>
+-        <key>/schemas/apps/clock_applet/prefs/show_week_numbers</key>
+-        <owner>clock-applet</owner>
+-        <type>bool</type>
+-        <default>true</default>
+-        <locale name="C">
+-          <short>Show week numbers in calendar</short>
+-          <long>
+-            If true, show week numbers in the calendar.
+-          </long>
+-        </locale>
+-      </schema>
+-
+-      <schema>
+-        <key>/schemas/apps/clock_applet/prefs/expand_appointments</key>
+-        <owner>clock-applet</owner>
+-        <type>bool</type>
+-        <default>false</default>
+-        <locale name="C">
+-          <short>Expand list of appointments</short>
+-          <long>
+-            If true, expand the list of appointments in the calendar window.
+-          </long>
+-        </locale>
+-      </schema>
+-
+-      <schema>
+-        <key>/schemas/apps/clock_applet/prefs/expand_birthdays</key>
+-        <owner>clock-applet</owner>
+-        <type>bool</type>
+-        <default>false</default>
+-        <locale name="C">
+-          <short>Expand list of birthdays</short>
+-          <long>
+-            If true, expand the list of birthdays in the calendar window.
+-          </long>
+-        </locale>
+-      </schema>
+-
+-      <schema>
+-        <key>/schemas/apps/clock_applet/prefs/expand_tasks</key>
+-        <owner>clock-applet</owner>
+-        <type>bool</type>
+-        <default>false</default>
+-        <locale name="C">
+-          <short>Expand list of tasks</short>
+-          <long>
+-            If true, expand the list of tasks in the calendar window.
+-          </long>
+-        </locale>
+-      </schema>
+-
+-      <schema>
+-        <key>/schemas/apps/clock_applet/prefs/expand_weather</key>
+-        <owner>clock-applet</owner>
+-        <type>bool</type>
+-        <default>false</default>
+-        <locale name="C">
+-          <short>Expand list of weather information</short>
+-          <long>
+-            If true, expand the list of weather information in the calendar
+-            window.
+-          </long>
+-        </locale>
+-      </schema>
+-
+-      <schema>
+-        <key>/schemas/apps/clock_applet/prefs/expand_locations</key>
+-        <owner>clock-applet</owner>
+-        <type>bool</type>
+-        <default>false</default>
+-        <locale name="C">
+-          <short>Expand list of locations</short>
+-          <long>
+-            If true, expand the list of locations in the calendar
+-            window.
+-          </long>
+-        </locale>
+-      </schema>
+-
+-      <schema>
+-        <key>/schemas/apps/clock_applet/prefs/hour_format</key>
+-        <owner>clock-applet</owner>
+-        <type>int</type>
+-        <default>12</default>
+-        <locale name="C">
+-          <short>Hour format</short>
+-          <long>
+-	    The use of this key was deprecated in GNOME 2.6 in favour of the
+-	    'format' key. The schema is retained for compatibility with older
+-	    versions.
+-          </long>
+-        </locale>
+-      </schema>
+-
+-      <schema>
+-        <key>/schemas/apps/clock_applet/prefs/unix_time</key>
+-        <owner>clock-applet</owner>
+-        <type>bool</type>
+-        <default>false</default>
+-        <locale name="C">
+-          <short>Use UNIX time</short>
+-          <long>
+-	    The use of this key was deprecated in GNOME 2.6 in favour of the
+-	    'format' key. The schema is retained for compatibility with older
+-	    versions.
+-          </long>
+-        </locale>
+-      </schema>
+-
+-      <schema>
+-        <key>/schemas/apps/clock_applet/prefs/internet_time</key>
+-        <owner>clock-applet</owner>
+-        <type>bool</type>
+-        <default>false</default>
+-        <locale name="C">
+-          <short>Use Internet time</short>
+-          <long>
+-	    The use of this key was deprecated in GNOME 2.6 in favour of the
+-	    'format' key. The schema is retained for compatibility with older
+-	    versions.
+-          </long>
+-        </locale>
+-      </schema>
+-
+-      <schema>
+-        <key>/schemas/apps/clock_applet/prefs/cities</key>
+-        <owner>clock-applet</owner>
+-        <type>list</type>
+-        <list_type>string</list_type>
+-        <default>[]</default>
+-        <locale name="C">
+-          <short>List of locations</short>
+-          <long>
+-            A list of locations to display in the calendar window.
+-          </long>
+-        </locale>
+-      </schema>
+-
+-      <schema>
+-        <key>/schemas/apps/clock_applet/prefs/temperature_unit</key>
+-        <owner>clock-applet</owner>
+-        <type>string</type>
+-        <default>Default</default>
+-        <locale name="C">
+-          <short>Temperature unit</short>
+-          <long>
+-            The unit to use when showing temperatures.
+-          </long>
+-        </locale>
+-      </schema>
+-
+-      <schema>
+-        <key>/schemas/apps/clock_applet/prefs/speed_unit</key>
+-        <owner>clock-applet</owner>
+-        <type>string</type>
+-        <default>Default</default>
+-        <locale name="C">
+-          <short>Speed unit</short>
+-          <long>
+-            The unit to use when showing wind speed.
+-          </long>
+-        </locale>
+-      </schema>
+-
+-  </schemalist>
+-
+-</gconfschemafile>
+--- a/configure.ac
++++ b/configure.ac
+@@ -75,7 +75,7 @@
+ LIBECAL_REQUIRED=3.5.3
+ LIBEDATASERVER_REQUIRED=3.5.3
+ CAIRO_REQUIRED=1.0.0
+-GWEATHER_REQUIRED=2.91.0
++GWEATHER_REQUIRED=3.5.1
+ DBUS_GLIB_REQUIRED=0.80
+ DCONF_REQUIRED=0.13.4
+ 
+--- a/data/Makefile.am
++++ b/data/Makefile.am
+@@ -3,7 +3,8 @@
+ gsettings_applets_schemas_in_in =						\
+ 	org.gnome.gnome-panel.applet.fish.gschema.xml.in.in			\
+ 	org.gnome.gnome-panel.applet.window-list.gschema.xml.in.in		\
+-	org.gnome.gnome-panel.applet.workspace-switcher.gschema.xml.in.in
++	org.gnome.gnome-panel.applet.workspace-switcher.gschema.xml.in.in 	\
++	org.gnome.gnome-panel.applet.clock.gschema.xml.in.in
+ 
+ gsettings_panel_schemas_in_in =					\
+ 	org.gnome.gnome-panel.gschema.xml.in.in			\
+--- a/data/org.gnome.gnome-panel.applet.clock.gschema.xml.in.in
++++ b/data/org.gnome.gnome-panel.applet.clock.gschema.xml.in.in
+@@ -1,25 +1,5 @@
+ <schemalist gettext-domain="@GETTEXT_PACKAGE@">
+   <schema id="org.gnome.gnome-panel.applet.clock">
+-    <key name="format" type="s">
+-      <default l10n="messages" context="format">''</default>
+-      <_summary>Hour format</_summary>
+-      <_description>This key specifies the hour format used by the clock applet. Possible values are "12-hour", "24-hour", "internet", "unix" and "custom". If set to "internet", the clock will display Internet time. The Internet time system divides the day into 1000 ".beats". There are no time zones in this system, so time is the same all over the world. If set to "unix", the clock will display time in seconds since Epoch, i.e. 1970-01-01. If set to "custom", the clock will display time according to the format specified in the custom_format key.</_description>
+-    </key>
+-    <key name="custom-format" type="s">
+-      <default>''</default>
+-      <_summary>Custom format of the clock</_summary>
+-      <_description>This key specifies the format used by the clock applet when the format key is set to "custom". You can use conversion specifiers understood by strftime() to obtain a specific format. See the strftime() manual for more information.</_description>
+-    </key>
+-    <key name="show-seconds" type="b">
+-      <default>false</default>
+-      <_summary>Show time with seconds</_summary>
+-      <_description>If true, display seconds in time.</_description>
+-    </key>
+-    <key name="show-date" type="b">
+-      <default>true</default>
+-      <_summary>Show date in clock</_summary>
+-      <_description>If true, display date in the clock, in addition to time.</_description>
+-    </key>
+     <key name="show-tooltip" type="b">
+       <default>true</default>
+       <_summary>Show date in tooltip</_summary>
+@@ -35,7 +15,7 @@
+       <_summary>Show temperature in clock</_summary>
+       <_description>If true, show the temperature next to the weather icon.</_description>
+     </key>
+-    <key name="show-week-numbers" type="b">
++    <key name="show-weeks" type="b">
+       <default>true</default>
+       <_summary>Show week numbers in calendar</_summary>
+       <_description>If true, show week numbers in the calendar.</_description>
+@@ -65,20 +45,13 @@
+       <_summary>Expand list of locations</_summary>
+       <_description>If true, expand the list of locations in the calendar window.</_description>
+     </key>
+-    <key name="cities" type="as">
++    <key name="cities" type="a(ssm(dd))">
+       <default>[]</default>
+       <_summary>List of locations</_summary>
+-      <_description>A list of locations to display in the calendar window.</_description>
+-    </key>
+-    <key name="temperature-unit" type="s">
+-      <default>'Default'</default>
+-      <_summary>Temperature unit</_summary>
+-      <_description>The unit to use when showing temperatures.</_description>
+-    </key>
+-    <key name="speed-unit" type="s">
+-      <default>'Default'</default>
+-      <_summary>Speed unit</_summary>
+-      <_description>The unit to use when showing wind speed.</_description>
++      <_description>
++	  A list of locations to display in the calendar window. Each location is a tuple of
++	  display name, METAR code and coordinates.
++      </_description>
+     </key>
+   </schema>
+ </schemalist>

Added: desktop/unstable/gnome-panel/debian/patches/clock-schema.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-panel/debian/patches/clock-schema.patch?rev=39559&op=file
==============================================================================
--- desktop/unstable/gnome-panel/debian/patches/clock-schema.patch	(added)
+++ desktop/unstable/gnome-panel/debian/patches/clock-schema.patch	[utf-8] Tue Sep 17 14:32:48 2013
@@ -0,0 +1,100 @@
+From 4d179612593570ddf20d1e6875d051c110032869 Mon Sep 17 00:00:00 2001
+From: Vincent Untz <vuntz at gnome.org>
+Date: Mon, 28 Mar 2011 10:19:16 +0000
+Subject: schemas: Make GSettings schemas translatable
+
+---
+(limited to 'data/org.gnome.gnome-panel.applet.clock.gschema.xml.in.in')
+
+diff --git a/data/org.gnome.gnome-panel.applet.clock.gschema.xml.in.in b/data/org.gnome.gnome-panel.applet.clock.gschema.xml.in.in
+new file mode 100644
+index 0000000..12b1899
+--- /dev/null
++++ b/data/org.gnome.gnome-panel.applet.clock.gschema.xml.in.in
+@@ -0,0 +1,84 @@
++<schemalist gettext-domain="@GETTEXT_PACKAGE@">
++  <schema id="org.gnome.gnome-panel.applet.clock">
++    <key name="format" type="s">
++      <default l10n="messages" context="format">''</default>
++      <_summary>Hour format</_summary>
++      <_description>This key specifies the hour format used by the clock applet. Possible values are "12-hour", "24-hour", "internet", "unix" and "custom". If set to "internet", the clock will display Internet time. The Internet time system divides the day into 1000 ".beats". There are no time zones in this system, so time is the same all over the world. If set to "unix", the clock will display time in seconds since Epoch, i.e. 1970-01-01. If set to "custom", the clock will display time according to the format specified in the custom_format key.</_description>
++    </key>
++    <key name="custom-format" type="s">
++      <default>''</default>
++      <_summary>Custom format of the clock</_summary>
++      <_description>This key specifies the format used by the clock applet when the format key is set to "custom". You can use conversion specifiers understood by strftime() to obtain a specific format. See the strftime() manual for more information.</_description>
++    </key>
++    <key name="show-seconds" type="b">
++      <default>false</default>
++      <_summary>Show time with seconds</_summary>
++      <_description>If true, display seconds in time.</_description>
++    </key>
++    <key name="show-date" type="b">
++      <default>true</default>
++      <_summary>Show date in clock</_summary>
++      <_description>If true, display date in the clock, in addition to time.</_description>
++    </key>
++    <key name="show-tooltip" type="b">
++      <default>true</default>
++      <_summary>Show date in tooltip</_summary>
++      <_description>If true, show date in a tooltip when the pointer is over the clock.</_description>
++    </key>
++    <key name="show-weather" type="b">
++      <default>true</default>
++      <_summary>Show weather in clock</_summary>
++      <_description>If true, display a weather icon.</_description>
++    </key>
++    <key name="show-temperature" type="b">
++      <default>true</default>
++      <_summary>Show temperature in clock</_summary>
++      <_description>If true, show the temperature next to the weather icon.</_description>
++    </key>
++    <key name="show-week-numbers" type="b">
++      <default>true</default>
++      <_summary>Show week numbers in calendar</_summary>
++      <_description>If true, show week numbers in the calendar.</_description>
++    </key>
++    <key name="expand-appointments" type="b">
++      <default>false</default>
++      <_summary>Expand list of appointments</_summary>
++      <_description>If true, expand the list of appointments in the calendar window.</_description>
++    </key>
++    <key name="expand-birthdays" type="b">
++      <default>false</default>
++      <_summary>Expand list of birthdays</_summary>
++      <_description>If true, expand the list of birthdays in the calendar window.</_description>
++    </key>
++    <key name="expand-tasks" type="b">
++      <default>false</default>
++      <_summary>Expand list of tasks</_summary>
++      <_description>If true, expand the list of tasks in the calendar window.</_description>
++    </key>
++    <key name="expand-weather" type="b">
++      <default>false</default>
++      <_summary>Expand list of weather information</_summary>
++      <_description>If true, expand the list of weather information in the calendar window.</_description>
++    </key>
++    <key name="expand-locations" type="b">
++      <default>false</default>
++      <_summary>Expand list of locations</_summary>
++      <_description>If true, expand the list of locations in the calendar window.</_description>
++    </key>
++    <key name="cities" type="as">
++      <default>[]</default>
++      <_summary>List of locations</_summary>
++      <_description>A list of locations to display in the calendar window.</_description>
++    </key>
++    <key name="temperature-unit" type="s">
++      <default>'Default'</default>
++      <_summary>Temperature unit</_summary>
++      <_description>The unit to use when showing temperatures.</_description>
++    </key>
++    <key name="speed-unit" type="s">
++      <default>'Default'</default>
++      <_summary>Speed unit</_summary>
++      <_description>The unit to use when showing wind speed.</_description>
++    </key>
++  </schema>
++</schemalist>
+--
+cgit v0.9.2

Added: desktop/unstable/gnome-panel/debian/patches/drop-gweather-xml-include.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-panel/debian/patches/drop-gweather-xml-include.patch?rev=39559&op=file
==============================================================================
--- desktop/unstable/gnome-panel/debian/patches/drop-gweather-xml-include.patch	(added)
+++ desktop/unstable/gnome-panel/debian/patches/drop-gweather-xml-include.patch	[utf-8] Tue Sep 17 14:32:48 2013
@@ -0,0 +1,21 @@
+From f5550422e202041a70cce8776785e3e651a01d8d Mon Sep 17 00:00:00 2001
+From: Philipp Kaluza <phk at src.gnome.org>
+Date: Thu, 03 Jan 2013 10:51:19 +0000
+Subject: fix build error due to missing gweather-xml.h
+
+GWeather doesn't export the deprecated GWeatherXML anymore since
+commit 354f1aa9003ee08c6e63ecbaaa6b9179b9178184 . Luckily, our last
+usage of it is long gone. Remove leftover include.
+
+See https://bugzilla.redhat.com/show_bug.cgi?id=890219
+---
+--- a/applets/clock/clock.c
++++ b/applets/clock/clock.c
+@@ -54,7 +54,6 @@
+ #define GNOME_DESKTOP_USE_UNSTABLE_API
+ #include <libgnome-desktop/gnome-wall-clock.h>
+ 
+-#include <libgweather/gweather-xml.h>
+ #include <libgweather/location-entry.h>
+ #include <libgweather/timezone-menu.h>
+ #include <libgweather/gweather-enum-types.h>

Modified: desktop/unstable/gnome-panel/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-panel/debian/patches/series?rev=39559&op=diff
==============================================================================
--- desktop/unstable/gnome-panel/debian/patches/series	[utf-8] (original)
+++ desktop/unstable/gnome-panel/debian/patches/series	[utf-8] Tue Sep 17 14:32:48 2013
@@ -8,3 +8,7 @@
 17_avoid_double_forking.patch
 18_fix_force_quit_applet.patch
 19_dconf_api_changes.patch
+20_eds-api.patch
+clock-schema.patch
+clock-applet-modern-gnome-tech.patch
+drop-gweather-xml-include.patch




More information about the pkg-gnome-commits mailing list