From d8a5354682becebcb167265a898ce25a6cab6c7b Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 13 Jul 2012 11:04:07 -0500 Subject: bump eds, ical requirements to reflect new API use --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index e8b3eb2..81c4dbb 100644 --- a/configure.ac +++ b/configure.ac @@ -52,9 +52,9 @@ DBUSMENUGTK_REQUIRED_VERSION=0.5.90 GIO_REQUIRED_VERSION=2.25.11 INDICATOR_DISPLAY_OBJECTS=0.2.2 GEOCLUE_REQUIRED_VERSION=0.12.0 -ECAL_REQUIRED_VERSION=2.30 -EDS_REQUIRED_VERSION=2.30 -ICAL_REQUIRED_VERSION=0.44 +ECAL_REQUIRED_VERSION=3.5 +EDS_REQUIRED_VERSION=3.5 +ICAL_REQUIRED_VERSION=0.48 CAIRO_REQUIRED_VERSION=1.10 GDK_REQUIRED_VERSION=2.22 GLIB_REQUIRED_VERSION=2.29.19 -- cgit v1.2.3 From 5829bb99b006343b87799ec655e2961855496a59 Mon Sep 17 00:00:00 2001 From: Ken VanDine Date: Tue, 11 Sep 2012 15:33:00 -0400 Subject: Removed stray lines from the desktop file, it's causing duplicate X-Ubuntu-Gettext-Domain to get added. (LP: #1048834) --- data/indicator-datetime-preferences.desktop.in | 4 ---- 1 file changed, 4 deletions(-) diff --git a/data/indicator-datetime-preferences.desktop.in b/data/indicator-datetime-preferences.desktop.in index 226ae67..68571db 100644 --- a/data/indicator-datetime-preferences.desktop.in +++ b/data/indicator-datetime-preferences.desktop.in @@ -1,15 +1,11 @@ [Desktop Entry] Version=1.0 - _Name=Time & Date _Comment=Change your clock and date settings - Icon=preferences-system-time TryExec=gnome-control-center Exec=gnome-control-center indicator-datetime - StartupNotify=true - Type=Application Categories=GNOME;GTK;Utility;DesktopSettings;Settings;X-GNOME-SystemSettings;X-GNOME-Settings-Panel; X-GNOME-Settings-Panel=indicator-datetime -- cgit v1.2.3 From eedc75e2b8ace2c569bcd386d61c1d76d5d2f135 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 12 Sep 2012 16:59:02 -0500 Subject: Stop watching the address provider change, we don't really care --- src/datetime-service.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/src/datetime-service.c b/src/datetime-service.c index 86c677a..6b06b45 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -63,7 +63,6 @@ static gboolean update_appointment_menu_items (gpointer user_data); static void update_location_menu_items (void); static void setup_timer (void); static void geo_client_invalid (GeoclueMasterClient * client, gpointer user_data); -static void geo_address_change (GeoclueMasterClient * client, gchar * a, gchar * b, gchar * c, gchar * d, gpointer user_data); static gboolean get_greeter_mode (void); static void quick_set_tz (DbusmenuMenuitem * menuitem, guint timestamp, gpointer user_data); @@ -1258,7 +1257,6 @@ geo_client_clean (void) } g_signal_handlers_disconnect_by_func(G_OBJECT(geo_master), geo_client_invalid, NULL); - g_signal_handlers_disconnect_by_func(G_OBJECT(geo_master), geo_address_change, NULL); g_object_unref(G_OBJECT(geo_master)); geo_master = NULL; @@ -1330,28 +1328,6 @@ geo_client_invalid (GeoclueMasterClient * client, gpointer user_data) return; } -/* Address provider changed, we need to get that one */ -static void -geo_address_change (GeoclueMasterClient * client, gchar * a, gchar * b, gchar * c, gchar * d, gpointer user_data) -{ - g_warning("Address provider changed. Let's change"); - - /* If the address is supposed to have changed we need to drop the old - address before starting to get the new one. */ - geo_address_clean(); - - geoclue_master_client_create_address_async(geo_master, geo_create_address, NULL); - - if (geo_timezone != NULL) { - g_free(geo_timezone); - geo_timezone = NULL; - } - - update_location_menu_items(); - - return; -} - /* Callback from creating the client */ static void geo_create_client (GeoclueMaster * master, GeoclueMasterClient * client, gchar * path, GError * error, gpointer user_data) @@ -1387,7 +1363,6 @@ geo_create_client (GeoclueMaster * master, GeoclueMasterClient * client, gchar * geoclue_master_client_create_address_async(geo_master, geo_create_address, NULL); g_signal_connect(G_OBJECT(client), "invalidated", G_CALLBACK(geo_client_invalid), NULL); - g_signal_connect(G_OBJECT(client), "address-provider-changed", G_CALLBACK(geo_address_change), NULL); return; } -- cgit v1.2.3 From 409f65de28ab57035c7d6945060573a32a69b6cc Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 19 Sep 2012 20:09:14 -0500 Subject: update all of the indicator's labels when the menu's visibility changes to true --- src/indicator-datetime.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c index 9e34a65..2356c6d 100644 --- a/src/indicator-datetime.c +++ b/src/indicator-datetime.c @@ -154,6 +154,7 @@ GType indicator_datetime_get_type (void) G_GNUC_CONST; static void indicator_datetime_class_init (IndicatorDatetimeClass *klass); static void indicator_datetime_init (IndicatorDatetime *self); +static void timezone_update_all_labels (IndicatorDatetime *self); static void set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); static void indicator_datetime_dispose (GObject *object); @@ -280,6 +281,10 @@ menu_visible_notfy_cb(GtkWidget * menu, G_GNUC_UNUSED GParamSpec *pspec, gpointe // Set the calendar to todays date ido_calendar_menu_item_set_date (self->priv->ido_calendar, y, m-1, d); + /* Update in case date was changed outside of indicator-datetime */ + update_label(self, NULL); + timezone_update_all_labels(self); + // Make sure the day-selected signal is sent so the menu updates - may duplicate /*GVariant *variant = g_variant_new_uint32((guint)curtime); guint timestamp = (guint)time(NULL); -- cgit v1.2.3 From 69aed01b36ca189487a27e044b57bb4936258b0f Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 19 Sep 2012 20:51:59 -0500 Subject: rename 'timer' as 'day_timer' to make room in the namespace for a second timer --- src/datetime-service.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/datetime-service.c b/src/datetime-service.c index 6b06b45..453bb9b 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -61,7 +61,7 @@ with this program. If not, see . static void geo_create_client (GeoclueMaster * master, GeoclueMasterClient * client, gchar * path, GError * error, gpointer user_data); static gboolean update_appointment_menu_items (gpointer user_data); static void update_location_menu_items (void); -static void setup_timer (void); +static void day_timer_reset (void); static void geo_client_invalid (GeoclueMasterClient * client, gpointer user_data); static gboolean get_greeter_mode (void); @@ -355,7 +355,7 @@ update_datetime (gpointer user_data) g_date_time_unref (datetime); g_free(utf8); - return FALSE; + return G_SOURCE_REMOVE; } /* Run a particular program based on an activation */ @@ -1113,7 +1113,7 @@ timezone_changed (GFileMonitor * monitor, GFile * file, GFile * otherfile, GFile update_current_timezone(); datetime_interface_update(DATETIME_INTERFACE(user_data)); update_datetime(NULL); - setup_timer(); + day_timer_reset(); return; } @@ -1133,38 +1133,38 @@ build_timezone (DatetimeInterface * dbus) } /* Source ID for the timer */ -static guint timer = 0; +static guint day_timer = 0; /* Execute at a given time, update and setup a new timer to go again. */ static gboolean -timer_func (gpointer user_data) +day_timer_func (gpointer user_data) { - timer = 0; + day_timer = 0; /* Reset up each time to reduce error */ - setup_timer(); + day_timer_reset(); update_datetime(NULL); - return FALSE; + return G_SOURCE_REMOVE; } /* Sets up the time to launch the timer to update the date in the datetime entry */ static void -setup_timer (void) +day_timer_reset (void) { - if (timer != 0) { - g_source_remove(timer); - timer = 0; + if (day_timer != 0) { + g_source_remove(day_timer); + day_timer = 0; } time_t t; t = time(NULL); struct tm * ltime = localtime(&t); - timer = g_timeout_add_seconds(((23 - ltime->tm_hour) * 60 * 60) + - ((59 - ltime->tm_min) * 60) + - ((60 - ltime->tm_sec)) + 60 /* one minute past */, - timer_func, NULL); + day_timer = g_timeout_add_seconds(((23 - ltime->tm_hour) * 60 * 60) + + ((59 - ltime->tm_min) * 60) + + ((60 - ltime->tm_sec)) + 60 /* one minute past */, + day_timer_func, NULL); return; } @@ -1180,7 +1180,7 @@ session_active_change_cb (GDBusProxy * proxy, gchar * sender_name, gchar * signa if (!idle) { datetime_interface_update(DATETIME_INTERFACE(user_data)); update_datetime(NULL); - setup_timer(); + day_timer_reset(); } } return; @@ -1428,7 +1428,7 @@ main (int argc, char ** argv) build_timezone(dbus); /* Setup the timer */ - setup_timer(); + day_timer_reset(); /* And watch for system resumes */ g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM, -- cgit v1.2.3 From 6145a631d5d1095ac937d28ba812f7e3cb315c1c Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 19 Sep 2012 21:13:15 -0500 Subject: in datetime-service, add a seconds timer that watches for clock skew and rebuilds the labels when it finds it --- src/datetime-service.c | 44 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/src/datetime-service.c b/src/datetime-service.c index 453bb9b..88689b7 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -1106,14 +1106,26 @@ build_menus (DbusmenuMenuitem * root) return; } +static void +on_clock_skew (void) +{ + /* tell the indicators to refresh */ + if (IS_DATETIME_INTERFACE (dbus)) + datetime_interface_update (DATETIME_INTERFACE(dbus)); + + /* update our day label */ + update_datetime (NULL); + day_timer_reset(); + + return; +} + /* Run when the timezone file changes */ static void timezone_changed (GFileMonitor * monitor, GFile * file, GFile * otherfile, GFileMonitorEvent event, gpointer user_data) { update_current_timezone(); - datetime_interface_update(DATETIME_INTERFACE(user_data)); - update_datetime(NULL); - day_timer_reset(); + on_clock_skew(); return; } @@ -1169,6 +1181,23 @@ day_timer_reset (void) return; } +static guint second_timer = 0; + +static gboolean +second_timer_func (gpointer unused G_GNUC_UNUSED) +{ + static time_t prev_time =0; + const time_t cur_time = time (NULL); + + if (prev_time && (fabs (difftime (cur_time, prev_time)) > 5)) { + g_debug (G_STRLOC" clock skew detected"); + on_clock_skew (); + } + + prev_time = cur_time; + return G_SOURCE_CONTINUE; +} + static void session_active_change_cb (GDBusProxy * proxy, gchar * sender_name, gchar * signal_name, GVariant * parameters, gpointer user_data) @@ -1178,9 +1207,7 @@ session_active_change_cb (GDBusProxy * proxy, gchar * sender_name, gchar * signa gboolean idle = FALSE; g_variant_get(parameters, "(b)", &idle); if (!idle) { - datetime_interface_update(DATETIME_INTERFACE(user_data)); - update_datetime(NULL); - day_timer_reset(); + on_clock_skew (); } } return; @@ -1427,9 +1454,12 @@ main (int argc, char ** argv) /* Setup timezone watch */ build_timezone(dbus); - /* Setup the timer */ + /* Set up the day timer */ day_timer_reset(); + /* Set up the second timer */ + second_timer = g_timeout_add_seconds_full (G_PRIORITY_LOW, 1, second_timer_func, NULL, NULL); + /* And watch for system resumes */ g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, -- cgit v1.2.3 From 1a48f285e56954ba589cb4cb12d0fa7c0da558e8 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 19 Sep 2012 22:34:12 -0500 Subject: clocks don't skew very often, so let's reduce the frequency that we test for this. --- src/datetime-service.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/datetime-service.c b/src/datetime-service.c index 88689b7..d2a9a63 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -1181,16 +1181,22 @@ day_timer_reset (void) return; } -static guint second_timer = 0; +enum { + /* how often to check for clock skew */ + SKEW_CHECK_INTERVAL_SEC = 10, + + SKEW_DIFF_THRESHOLD_SEC = SKEW_CHECK_INTERVAL_SEC + 5 +}; static gboolean -second_timer_func (gpointer unused G_GNUC_UNUSED) +skew_check_timer_func (gpointer unused G_GNUC_UNUSED) { - static time_t prev_time =0; + static time_t prev_time = 0; const time_t cur_time = time (NULL); + const double diff_sec = fabs (difftime (cur_time, prev_time)); - if (prev_time && (fabs (difftime (cur_time, prev_time)) > 5)) { - g_debug (G_STRLOC" clock skew detected"); + if (prev_time && (diff_sec > SKEW_DIFF_THRESHOLD_SEC)) { + g_debug (G_STRLOC" clock skew detected (%.0f seconds)", diff_sec); on_clock_skew (); } @@ -1458,7 +1464,9 @@ main (int argc, char ** argv) day_timer_reset(); /* Set up the second timer */ - second_timer = g_timeout_add_seconds_full (G_PRIORITY_LOW, 1, second_timer_func, NULL, NULL); + g_timeout_add_seconds (SKEW_CHECK_INTERVAL_SEC, + skew_check_timer_func, + NULL); /* And watch for system resumes */ g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM, -- cgit v1.2.3 From 1ffd530753901cb424ddd64bc44b126296f33ca2 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 20 Sep 2012 06:18:22 -0500 Subject: move declaration of SKEW_CHECK_INTERVAL_SEC and SKEW_DIFF_THRESHOLD_SEC to the top of the file. --- src/datetime-service.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/datetime-service.c b/src/datetime-service.c index d2a9a63..8db3c73 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -52,6 +52,13 @@ with this program. If not, see . #include "settings-shared.h" #include "utils.h" +enum { + /* how often to check for clock skew */ + SKEW_CHECK_INTERVAL_SEC = 10, + + SKEW_DIFF_THRESHOLD_SEC = SKEW_CHECK_INTERVAL_SEC + 5 +}; + #ifdef HAVE_CCPANEL #define SETTINGS_APP_INVOCATION "gnome-control-center indicator-datetime" #else @@ -1181,13 +1188,6 @@ day_timer_reset (void) return; } -enum { - /* how often to check for clock skew */ - SKEW_CHECK_INTERVAL_SEC = 10, - - SKEW_DIFF_THRESHOLD_SEC = SKEW_CHECK_INTERVAL_SEC + 5 -}; - static gboolean skew_check_timer_func (gpointer unused G_GNUC_UNUSED) { -- cgit v1.2.3 From 38c2ed7d7b0b8f068ea166316fd1c882d4ca35b5 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 20 Sep 2012 06:28:10 -0500 Subject: for SKEW_DIFF_THRESHOLD_SEC and SKEW_CHECK_INTERVAL_SEC, use #define instead of enum --- src/datetime-service.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/datetime-service.c b/src/datetime-service.c index 8db3c73..c01121e 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -52,12 +52,10 @@ with this program. If not, see . #include "settings-shared.h" #include "utils.h" -enum { - /* how often to check for clock skew */ - SKEW_CHECK_INTERVAL_SEC = 10, +/* how often to check for clock skew */ +#define SKEW_CHECK_INTERVAL_SEC 19 - SKEW_DIFF_THRESHOLD_SEC = SKEW_CHECK_INTERVAL_SEC + 5 -}; +#define SKEW_DIFF_THRESHOLD_SEC (SKEW_CHECK_INTERVAL_SEC + 5) #ifdef HAVE_CCPANEL #define SETTINGS_APP_INVOCATION "gnome-control-center indicator-datetime" -- cgit v1.2.3 From b576f93979293efbe9bf31641bf1fa47596aac98 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 20 Sep 2012 06:37:25 -0500 Subject: Fix r190 typo. Yet another reminder to drink my morning coffee /before/ pushing. --- src/datetime-service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datetime-service.c b/src/datetime-service.c index c01121e..e97ec10 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -53,7 +53,7 @@ with this program. If not, see . #include "utils.h" /* how often to check for clock skew */ -#define SKEW_CHECK_INTERVAL_SEC 19 +#define SKEW_CHECK_INTERVAL_SEC 10 #define SKEW_DIFF_THRESHOLD_SEC (SKEW_CHECK_INTERVAL_SEC + 5) -- cgit v1.2.3 From 3f4134737085a73ab0b9379922d1db941f66137e Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 20 Sep 2012 06:47:43 -0500 Subject: copyediting: typo tweak --- src/datetime-service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datetime-service.c b/src/datetime-service.c index e97ec10..ccdfe14 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -1461,7 +1461,7 @@ main (int argc, char ** argv) /* Set up the day timer */ day_timer_reset(); - /* Set up the second timer */ + /* Set up the skew-check timer */ g_timeout_add_seconds (SKEW_CHECK_INTERVAL_SEC, skew_check_timer_func, NULL); -- cgit v1.2.3 From 3f6591ab927a4313f7623904a4a0d75533fa021f Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 20 Sep 2012 11:22:17 -0500 Subject: 12.10.1 --- NEWS | 11 +++++++---- configure.ac | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index b18731c..59376bb 100644 --- a/NEWS +++ b/NEWS @@ -1,15 +1,18 @@ +12.10.1 + + - Gracefully handle clock skew (LP: #917236) + - Raise the version number of our EDS dependency (LP: #1024437) + - Fix X-Ubuntu-Gettext-Domain entries in the .desktop file (LP: #1048834) + - Remove unnecessary watching for geoclue address provider changes + 12.10.0 - Support EDS 3.6's API (cyphermox) - - Apply an 'en space' between the date and time strings. (LP #749847) lp:~bobowen/indicator-datetime/fix-for-749847 - - Sort locations as spec'ed by https://wiki.ubuntu.com/TimeAndDate (LP #833325) lp:~charlesk/indicator-datetime/lp-833325 - - Fix a bug that caused location settings to be re-saved each 2 seconds lp:~charlesk/indicator-datetime/unnecessary-saves - - Drop GTK+ 2 support diff --git a/configure.ac b/configure.ac index 81c4dbb..ce79611 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_INIT([indicator-datetime], - [12.10.0], + [12.10.1], [http://bugs.launchpad.net/indicator-datetime], [indicator-datetime], [http://launchpad.net/indicator-datetime]) -- cgit v1.2.3