aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-datetime.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-07-07 16:24:09 -0500
committerTed Gould <ted@gould.cx>2011-07-07 16:24:09 -0500
commit732b5f6b4eb81a4b36481b14646ef0bd049922ec (patch)
treeb281871bdc8f2f66825ed97f2539f8458f1abb95 /src/indicator-datetime.c
parent64b442893f7ae6d4201f72535175a2956f448ddf (diff)
parent1819f029c3f3af6922e095e959e80b1ce446148b (diff)
downloadayatana-indicator-datetime-732b5f6b4eb81a4b36481b14646ef0bd049922ec.tar.gz
ayatana-indicator-datetime-732b5f6b4eb81a4b36481b14646ef0bd049922ec.tar.bz2
ayatana-indicator-datetime-732b5f6b4eb81a4b36481b14646ef0bd049922ec.zip
* New upstream release.
* libindicator 0.4 transition * Making preferences a gnome-control-center plugin * Calling gnome-control-center from the menu * Fixing timezone setting with new gsd
Diffstat (limited to 'src/indicator-datetime.c')
-rw-r--r--src/indicator-datetime.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c
index 800fa87..072253b 100644
--- a/src/indicator-datetime.c
+++ b/src/indicator-datetime.c
@@ -41,9 +41,9 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <libindicator/indicator-service-manager.h>
/* DBusMenu */
-#include <libdbusmenu-gtk/menu.h>
+#include <libdbusmenu-gtk3/menu.h>
#include <libido/libido.h>
-#include <libdbusmenu-gtk/menuitem.h>
+#include <libdbusmenu-gtk3/menuitem.h>
#include "utils.h"
#include "dbus-shared.h"
@@ -761,11 +761,18 @@ set_label_to_time_in_zone (IndicatorDatetime * self, GtkLabel * label,
GTimeZone * tz, const gchar * format,
GDateTime ** datetime)
{
+ gboolean unref_tz = FALSE;
+ if (tz == NULL) {
+ gchar * zone = read_timezone ();
+ if (zone == NULL)
+ return;
+ tz = g_time_zone_new(zone);
+ unref_tz = TRUE;
+ g_free (zone);
+ }
+
GDateTime * datetime_now;
- if (tz == NULL)
- datetime_now = g_date_time_new_now_local();
- else
- datetime_now = g_date_time_new_now(tz);
+ datetime_now = g_date_time_new_now(tz);
gchar * timestr;
if (format == NULL) {
@@ -793,6 +800,9 @@ set_label_to_time_in_zone (IndicatorDatetime * self, GtkLabel * label,
else
g_date_time_unref(datetime_now);
+ if (unref_tz)
+ g_time_zone_unref(tz);
+
return;
}