aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDidier Roche <didier.roche@canonical.com>2012-09-20 18:36:17 +0200
committerDidier Roche <didier.roche@canonical.com>2012-09-20 18:36:17 +0200
commitf3556e6aee50c0981be6797d5ad54fb202b39b78 (patch)
treef833940bcc36569b8553895b3c8e5f2a3d0e4184
parent9414aa3cdd59e3650a6e030880c3daa34bd9223c (diff)
parent52099c2fe93e72a86e5f6a742582d1110aab5eff (diff)
downloadayatana-indicator-datetime-f3556e6aee50c0981be6797d5ad54fb202b39b78.tar.gz
ayatana-indicator-datetime-f3556e6aee50c0981be6797d5ad54fb202b39b78.tar.bz2
ayatana-indicator-datetime-f3556e6aee50c0981be6797d5ad54fb202b39b78.zip
* New upstream release.
* build-dep on newer libecal
-rw-r--r--AUTHORS1
-rw-r--r--ChangeLog64
-rw-r--r--NEWS11
-rwxr-xr-xconfigure26
-rw-r--r--configure.ac8
-rw-r--r--data/indicator-datetime-preferences.desktop4
-rw-r--r--debian/changelog7
-rw-r--r--debian/control2
-rw-r--r--src/datetime-service.c107
-rw-r--r--src/indicator-datetime.c5
10 files changed, 161 insertions, 74 deletions
diff --git a/AUTHORS b/AUTHORS
index 1eafdee..1e5f02d 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -24,4 +24,5 @@
Rodrigo Moya
Ryan Lortie
Sebastien Bacher
+ Tarmac
Ted Gould
diff --git a/ChangeLog b/ChangeLog
index 1603f2d..3e397a7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,69 @@
# Generated by Makefile. Do not edit.
+2012-09-20 Charles Kerr <charles.kerr@canonical.com>
+
+ 12.10.1
+
+2012-09-20 Charles Kerr <charles.kerr@canonical.com>
+
+ When clock skew is detected, rebuild the date/time labels.. Fixes: https://bugs.launchpad.net/bugs/917236. Approved by jenkins, Lars Uebernickel.
+
+2012-09-20 Charles Kerr <charles.kerr@canonical.com>
+
+ copyediting: typo tweak
+
+2012-09-20 Charles Kerr <charles.kerr@canonical.com>
+
+ Fix r190 typo. Yet another reminder to drink my morning coffee /before/ pushing.
+
+2012-09-20 Charles Kerr <charles.kerr@canonical.com>
+
+ for SKEW_DIFF_THRESHOLD_SEC and SKEW_CHECK_INTERVAL_SEC, use #define instead of enum
+
+2012-09-20 Charles Kerr <charles.kerr@canonical.com>
+
+ move declaration of SKEW_CHECK_INTERVAL_SEC and SKEW_DIFF_THRESHOLD_SEC to the top of the file.
+
+2012-09-19 Charles Kerr <charles.kerr@canonical.com>
+
+ clocks don't skew very often, so let's reduce the frequency that we test for this.
+
+2012-09-19 Charles Kerr <charles.kerr@canonical.com>
+
+ in datetime-service, add a seconds timer that watches for clock skew and rebuilds the labels when it finds it
+
+2012-09-19 Charles Kerr <charles.kerr@canonical.com>
+
+ rename 'timer' as 'day_timer' to make room in the namespace for a second timer
+
+2012-09-19 Charles Kerr <charles.kerr@canonical.com>
+
+ update all of the indicator's labels when the menu's visibility changes to true
+
+2012-09-13 Ted Gould <ted@gould.cx>
+
+ No longer watch if the address provider changes. Approved by Charles Kerr, jenkins.
+
+2012-09-12 Ted Gould <ted@gould.cx>
+
+ Stop watching the address provider change, we don't really care
+
+2012-09-11 Ken VanDine <ken.vandine@canonical.com>
+
+ Removed stray lines from the desktop file, it's causing duplicate X-Ubuntu-Gettext-Domain to get added. (LP: #1048834). Fixes: https://bugs.launchpad.net/bugs/1048834. Approved by Omer Akram.
+
+2012-09-11 Ken VanDine <ken.vandine@canonical.com>
+
+ Removed stray lines from the desktop file, it's causing duplicate X-Ubuntu-Gettext-Domain to get added. (LP: #1048834)
+
+2012-07-24 Charles Kerr <charles.kerr@canonical.com>
+
+ merge lp:~charlesk/indicator-datetime/bump-eds-requirement to sync configure.ac's EDS version requirement with the EDS API level being used in the code
+
+2012-07-13 Charles Kerr <charles.kerr@canonical.com>
+
+ bump eds, ical requirements to reflect new API use
+
2012-07-12 Charles Kerr <charles.kerr@canonical.com>
bump version to 12.10.0
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 b/configure
index 1614e6a..7b35642 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for indicator-datetime 12.10.0.
+# Generated by GNU Autoconf 2.69 for indicator-datetime 12.10.1.
#
# Report bugs to <http://bugs.launchpad.net/indicator-datetime>.
#
@@ -592,8 +592,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='indicator-datetime'
PACKAGE_TARNAME='indicator-datetime'
-PACKAGE_VERSION='12.10.0'
-PACKAGE_STRING='indicator-datetime 12.10.0'
+PACKAGE_VERSION='12.10.1'
+PACKAGE_STRING='indicator-datetime 12.10.1'
PACKAGE_BUGREPORT='http://bugs.launchpad.net/indicator-datetime'
PACKAGE_URL='http://launchpad.net/indicator-datetime'
@@ -1417,7 +1417,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures indicator-datetime 12.10.0 to adapt to many kinds of systems.
+\`configure' configures indicator-datetime 12.10.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1488,7 +1488,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of indicator-datetime 12.10.0:";;
+ short | recursive ) echo "Configuration of indicator-datetime 12.10.1:";;
esac
cat <<\_ACEOF
@@ -1620,7 +1620,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-indicator-datetime configure 12.10.0
+indicator-datetime configure 12.10.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1991,7 +1991,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by indicator-datetime $as_me 12.10.0, which was
+It was created by indicator-datetime $as_me 12.10.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2815,7 +2815,7 @@ fi
# Define the identity of the package.
PACKAGE='indicator-datetime'
- VERSION='12.10.0'
+ VERSION='12.10.1'
cat >>confdefs.h <<_ACEOF
@@ -11897,9 +11897,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
@@ -14923,7 +14923,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by indicator-datetime $as_me 12.10.0, which was
+This file was extended by indicator-datetime $as_me 12.10.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -14990,7 +14990,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-indicator-datetime config.status 12.10.0
+indicator-datetime config.status 12.10.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index e8b3eb2..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])
@@ -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
diff --git a/data/indicator-datetime-preferences.desktop b/data/indicator-datetime-preferences.desktop
index 8231e22..a283ff4 100644
--- a/data/indicator-datetime-preferences.desktop
+++ b/data/indicator-datetime-preferences.desktop
@@ -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
diff --git a/debian/changelog b/debian/changelog
index c088a64..a55479e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+indicator-datetime (12.10.1-0ubuntu1) UNRELEASED; urgency=low
+
+ * New upstream release.
+ * build-dep on newer libecal
+
+ -- Didier Roche <didrocks@ubuntu.com> Thu, 20 Sep 2012 18:35:07 +0200
+
indicator-datetime (12.10.0-0ubuntu2) quantal; urgency=low
* data/indicator-datetime-preferences.desktop.in
diff --git a/debian/control b/debian/control
index 1663fc3..0498c7a 100644
--- a/debian/control
+++ b/debian/control
@@ -18,7 +18,7 @@ Build-Depends: cdbs,
libcairo2-dev (>= 1.10),
libjson-glib-dev,
libpolkit-gobject-1-dev,
- libedataserver1.2-dev (>= 2.30),
+ libedataserver1.2-dev (>= 3.5),
libedataserverui-3.0-dev,
libgconf2-dev (>= 2.31),
libgnome-control-center-dev,
diff --git a/src/datetime-service.c b/src/datetime-service.c
index 86c677a..ccdfe14 100644
--- a/src/datetime-service.c
+++ b/src/datetime-service.c
@@ -52,6 +52,11 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include "settings-shared.h"
#include "utils.h"
+/* how often to check for clock skew */
+#define SKEW_CHECK_INTERVAL_SEC 10
+
+#define SKEW_DIFF_THRESHOLD_SEC (SKEW_CHECK_INTERVAL_SEC + 5)
+
#ifdef HAVE_CCPANEL
#define SETTINGS_APP_INVOCATION "gnome-control-center indicator-datetime"
#else
@@ -61,9 +66,8 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
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 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);
@@ -356,7 +360,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 */
@@ -1107,14 +1111,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);
- setup_timer();
+ on_clock_skew();
return;
}
@@ -1134,42 +1150,58 @@ 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;
}
+static gboolean
+skew_check_timer_func (gpointer unused G_GNUC_UNUSED)
+{
+ 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 && (diff_sec > SKEW_DIFF_THRESHOLD_SEC)) {
+ g_debug (G_STRLOC" clock skew detected (%.0f seconds)", diff_sec);
+ 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)
@@ -1179,9 +1211,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);
- setup_timer();
+ on_clock_skew ();
}
}
return;
@@ -1258,7 +1288,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 +1359,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 +1394,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;
}
@@ -1452,8 +1458,13 @@ main (int argc, char ** argv)
/* Setup timezone watch */
build_timezone(dbus);
- /* Setup the timer */
- setup_timer();
+ /* Set up the day timer */
+ day_timer_reset();
+
+ /* Set up the skew-check timer */
+ 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,
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);