[Xfce4-commits] [xfce/xfce4-panel] 01/01: Fixed handling of a local timezone

noreply at xfce.org noreply at xfce.org
Mon Mar 27 20:58:24 CEST 2017


This is an automated email from the git hooks/post-receive script.

andrzejr pushed a commit to branch master
in repository xfce/xfce4-panel.

commit fe4b501a3f89290fccbc79216488800cc90a6284
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Mon Mar 27 19:58:12 2017 +0100

    Fixed handling of a local timezone
---
 plugins/clock/clock-time.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/plugins/clock/clock-time.c b/plugins/clock/clock-time.c
index f737cad..8d2d208 100644
--- a/plugins/clock/clock-time.c
+++ b/plugins/clock/clock-time.c
@@ -109,7 +109,7 @@ static void
 clock_time_init (ClockTime *time)
 {
   time->timezone_name = g_strdup (DEFAULT_TIMEZONE);
-  time->timezone = g_time_zone_new_local ();
+  time->timezone = NULL;
 }
 
 
@@ -121,7 +121,8 @@ clock_time_finalize (GObject *object)
 
   g_free (time->timezone_name);
 
-  g_time_zone_unref (time->timezone);
+  if (time->timezone != NULL)
+    g_time_zone_unref (time->timezone);
 
   G_OBJECT_CLASS (clock_time_parent_class)->finalize (object);
 }
@@ -166,11 +167,12 @@ clock_time_set_property (GObject      *object,
       if (g_strcmp0 (time->timezone_name, str_value) != 0)
         {
           g_free (time->timezone_name);
-          g_time_zone_unref (time->timezone);
+          if (time->timezone != NULL)
+            g_time_zone_unref (time->timezone);
           if (str_value == NULL || g_strcmp0 (str_value, "") == 0)
             {
               time->timezone_name = g_strdup (DEFAULT_TIMEZONE);
-              time->timezone = g_time_zone_new_local ();
+              time->timezone = NULL;
             }
           else
             {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list