diff options
author | Ted Gould <ted@gould.cx> | 2011-09-29 15:36:39 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-09-29 15:36:39 -0500 |
commit | 4e2dc05c209906b1a0d01b1c9f12c26a8ce2cd6d (patch) | |
tree | a20803b6ae442a06f1227bcf067cdf7ccb10b8e4 | |
parent | 1e2f73f716198aec43b76570e1926d73ddfeca19 (diff) | |
parent | c2fbaa0add265eab4a5c493d97fa80efc75a526a (diff) | |
download | ayatana-indicator-datetime-4e2dc05c209906b1a0d01b1c9f12c26a8ce2cd6d.tar.gz ayatana-indicator-datetime-4e2dc05c209906b1a0d01b1c9f12c26a8ce2cd6d.tar.bz2 ayatana-indicator-datetime-4e2dc05c209906b1a0d01b1c9f12c26a8ce2cd6d.zip |
Import upstream version 0.3.0
-rw-r--r-- | AUTHORS | 3 | ||||
-rw-r--r-- | ChangeLog | 32 | ||||
-rwxr-xr-x | configure | 20 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/datetime-prefs-locations.c | 3 | ||||
-rw-r--r-- | src/datetime-service.c | 27 | ||||
-rw-r--r-- | src/indicator-datetime.c | 12 | ||||
-rw-r--r-- | src/utils.c | 6 |
8 files changed, 79 insertions, 26 deletions
@@ -1,5 +1,6 @@ # Generated by Makefile. Do not edit. + Antti Kaijanmäki David Barth David Planella Dylan McCall @@ -8,12 +9,14 @@ Gabor Kelemen Javier Jardón Jeremy Bicha + Jörn Horstmann karl-qdh Ken VanDine Kyle Nitzsche Luke Yelavich Marco Trevisan (Treviño) Michael Terry + Robert Ancell Rodrigo Moya Sebastien Bacher Ted Gould @@ -1,5 +1,37 @@ # Generated by Makefile. Do not edit. +2011-09-29 Ted Gould <ted@gould.cx> + + 0.3.0 + +2011-09-29 Ted Gould <ted@gould.cx> + + Unref Cals in error situations + +2011-09-29 Antti Kaijanmäki <antti.kaijanmaki@canonical.com> + + Fix 100% CPU usage (LP: #774071) + +2011-09-29 Ted Gould <ted@gould.cx> + + Protect setting or unseting the env if we don't have it already. + +2011-09-28 Robert Ancell <robert.ancell@canonical.com> + + Don't call setenv when value is NULL + +2011-09-21 Jörn Horstmann <launchpad@planetxml.de> + + Use g_datetime() to measure string (6 LOC) + +2011-09-21 Ted Gould <ted@gould.cx> + + Moving setting the translation domain for builder to earlier + +2011-09-18 Gabor Kelemen <kelemeng@gnome.hu> + + Set translation domain before gtk_builder_add_from_file, in the other file too. LP: #853130 + 2011-09-15 Ted Gould <ted@gould.cx> 0.2.95 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for indicator-datetime 0.2.95. +# Generated by GNU Autoconf 2.68 for indicator-datetime 0.3.0. # # Report bugs to <http://bugs.launchpad.net/indicator-datetime>. # @@ -572,8 +572,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='indicator-datetime' PACKAGE_TARNAME='indicator-datetime' -PACKAGE_VERSION='0.2.95' -PACKAGE_STRING='indicator-datetime 0.2.95' +PACKAGE_VERSION='0.3.0' +PACKAGE_STRING='indicator-datetime 0.3.0' PACKAGE_BUGREPORT='http://bugs.launchpad.net/indicator-datetime' PACKAGE_URL='http://launchpad.net/indicator-datetime' @@ -1375,7 +1375,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 0.2.95 to adapt to many kinds of systems. +\`configure' configures indicator-datetime 0.3.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1446,7 +1446,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of indicator-datetime 0.2.95:";; + short | recursive ) echo "Configuration of indicator-datetime 0.3.0:";; esac cat <<\_ACEOF @@ -1578,7 +1578,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -indicator-datetime configure 0.2.95 +indicator-datetime configure 0.3.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1949,7 +1949,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 0.2.95, which was +It was created by indicator-datetime $as_me 0.3.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2773,7 +2773,7 @@ fi # Define the identity of the package. PACKAGE='indicator-datetime' - VERSION='0.2.95' + VERSION='0.3.0' cat >>confdefs.h <<_ACEOF @@ -14654,7 +14654,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 0.2.95, which was +This file was extended by indicator-datetime $as_me 0.3.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14721,7 +14721,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 0.2.95 +indicator-datetime config.status 0.3.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index fd87af8..144672f 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_INIT([indicator-datetime], - [0.2.95], + [0.3.0], [http://bugs.launchpad.net/indicator-datetime], [indicator-datetime], [http://launchpad.net/indicator-datetime]) diff --git a/src/datetime-prefs-locations.c b/src/datetime-prefs-locations.c index af0e10d..d865efe 100644 --- a/src/datetime-prefs-locations.c +++ b/src/datetime-prefs-locations.c @@ -421,6 +421,7 @@ datetime_setup_locations_dialog (CcTimezoneMap * map) { GError * error = NULL; GtkBuilder * builder = gtk_builder_new (); + gtk_builder_set_translation_domain (builder, GETTEXT_PACKAGE); gtk_builder_add_from_file (builder, DATETIME_DIALOG_UI_FILE, &error); if (error != NULL) { /* We have to abort, we can't continue without the ui file */ @@ -429,8 +430,6 @@ datetime_setup_locations_dialog (CcTimezoneMap * map) return NULL; } - gtk_builder_set_translation_domain (builder, GETTEXT_PACKAGE); - GSettings * conf = g_settings_new (SETTINGS_INTERFACE); #define WIG(name) GTK_WIDGET (gtk_builder_get_object (builder, name)) diff --git a/src/datetime-service.c b/src/datetime-service.c index 80c0b57..25572ee 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -1,3 +1,4 @@ +/*-*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* An indicator to time and date related information in the menubar. @@ -430,7 +431,10 @@ static guint ecaltimer = 0; static void start_ecal_timer(void) { - if (ecaltimer != 0) g_source_remove(ecaltimer); + if (ecaltimer != 0) { + g_source_remove(ecaltimer); + ecaltimer = 0; + } if (update_appointment_menu_items(NULL)) ecaltimer = g_timeout_add_seconds(60*5, update_appointment_menu_items, NULL); } @@ -438,7 +442,10 @@ start_ecal_timer(void) static void stop_ecal_timer(void) { - if (ecaltimer != 0) g_source_remove(ecaltimer); + if (ecaltimer != 0) { + g_source_remove(ecaltimer); + ecaltimer = 0; + } } static gboolean idle_start_ecal_timer (gpointer data) @@ -748,9 +755,10 @@ update_appointment_menu_items (gpointer user_data) for (l = comp_instances; l; l = l->next) { const struct comp_instance *ci = l->data; g_object_unref(ci->comp); - g_list_free(comp_instances); - comp_instances = NULL; } + g_list_free(comp_instances); + comp_instances = NULL; + } GSList *cal_list = gconf_client_get_list(gconf, "/apps/evolution/calendar/display/selected_calendars", GCONF_VALUE_STRING, &gerror); if (gerror) { @@ -759,6 +767,7 @@ update_appointment_menu_items (gpointer user_data) gerror = NULL; cal_list = NULL; } + // Generate instances for all sources for (g = e_source_list_peek_groups (sources); g; g = g->next) { ESourceGroup *group = E_SOURCE_GROUP (g->data); @@ -779,6 +788,7 @@ update_appointment_menu_items (gpointer user_data) g_debug("Failed to set ecal default timezone %s", gerror->message); g_error_free(gerror); gerror = NULL; + g_object_unref(ecal); continue; } @@ -786,8 +796,9 @@ update_appointment_menu_items (gpointer user_data) g_debug("Failed to get ecal sources %s", gerror->message); g_error_free(gerror); gerror = NULL; + g_object_unref(ecal); continue; - } + } const gchar *ecal_uid = e_source_peek_uid(source); gboolean match = FALSE; g_debug("Checking ecal_uid is enabled: %s", ecal_uid); @@ -798,10 +809,14 @@ update_appointment_menu_items (gpointer user_data) break; } } - if (!match) continue; + if (!match) { + g_object_unref(ecal); + continue; + } g_debug("ecal_uid is enabled, generating instances"); e_cal_generate_instances (ecal, t1, t2, (ECalRecurInstanceFn) populate_appointment_instances, (gpointer) source); + g_object_unref(ecal); } } g_debug("Number of ECalComponents returned: %d", g_list_length(comp_instances)); diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c index 339ea2f..8e5f421 100644 --- a/src/indicator-datetime.c +++ b/src/indicator-datetime.c @@ -1092,12 +1092,14 @@ guess_label_size (IndicatorDatetime * self) g_debug("Checking against %d possible times", timevals->len); gint check_time; for (check_time = 0; check_time < timevals->len; check_time++) { - gchar longstr[256]; - strftime(longstr, 256, self->priv->time_string, &(g_array_index(timevals, struct tm, check_time))); + struct tm * timeval = &g_array_index(timevals, struct tm, check_time); + GDateTime * dt = g_date_time_new_local(timeval->tm_year, timeval->tm_mon, timeval->tm_mday, timeval->tm_hour, timeval->tm_min, timeval->tm_sec); + gchar * timestr = g_date_time_format(dt, self->priv->time_string); - gchar * utf8 = g_locale_to_utf8(longstr, -1, NULL, NULL, NULL); - gint length = measure_string(style, context, utf8); - g_free(utf8); + gint length = measure_string(style, context, timestr); + + g_free(timestr); + g_date_time_unref(dt); if (length > *max_width) { *max_width = length; diff --git a/src/utils.c b/src/utils.c index 73c8ab2..e6de92a 100644 --- a/src/utils.c +++ b/src/utils.c @@ -161,7 +161,8 @@ T_(const char *msg) char *time_locale = g_strdup(setlocale(LC_TIME, NULL)); char *language = g_strdup(g_getenv("LANGUAGE")); char *rv; - g_unsetenv("LANGUAGE"); + if (language) + g_unsetenv("LANGUAGE"); setlocale(LC_MESSAGES, time_locale); /* Get the LC_TIME version */ @@ -169,7 +170,8 @@ T_(const char *msg) /* Put everything back the way it was */ setlocale(LC_MESSAGES, message_locale); - g_setenv("LANGUAGE", language, TRUE); + if (language) + g_setenv("LANGUAGE", language, TRUE); g_free(message_locale); g_free(time_locale); g_free(language); |