[Xfce4-commits] <orage:master> 4.8.1.6: Fixed bug 7836 - orage hangs using 100% cpu at start

Juha Kautto noreply at xfce.org
Sun Jul 24 12:08:01 CEST 2011


Updating branch refs/heads/master
         to 1fc45d628b2f432aff62900d0a0963e175986cdc (commit)
       from 179a8f3ac1e5607e0ba974fc5de9b9947e9080e7 (commit)

commit 1fc45d628b2f432aff62900d0a0963e175986cdc
Author: Juha Kautto <juha at xfce.org>
Date:   Sun Jul 24 13:04:18 2011 +0300

    4.8.1.6: Fixed bug  7836 - orage hangs using 100% cpu at start
    
    When event box was disabled by setting number of events to show to 0,
    Orage was going into cpu loop in startup. Added missing check for 0.

 configure.in.in |    2 +-
 src/mainbox.c   |   39 +++++++++++++++++++++------------------
 2 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index ba90371..1052937 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -9,7 +9,7 @@ dnl Written for Xfce by Juha Kautto <juha at xfce.org>
 dnl
 
 dnl Version information
-m4_define([orage_version], [4.8.1.5-git])
+m4_define([orage_version], [4.8.1.6-git])
 
 m4_define([gtk_minimum_version], [2.10.0])
 m4_define([xfce_minimum_version], [4.6.0])
diff --git a/src/mainbox.c b/src/mainbox.c
index c5f8b42..6d0bdc1 100644
--- a/src/mainbox.c
+++ b/src/mainbox.c
@@ -558,25 +558,28 @@ static void create_mainbox_event_info_box(void)
     cal->mEvent_vbox = gtk_vbox_new(FALSE, 0);
     gtk_box_pack_start(GTK_BOX(cal->mVbox), cal->mEvent_vbox, TRUE, TRUE, 0);
     cal->mEvent_label = gtk_label_new(NULL);
-    if (g_par.show_event_days == 1) {
-        tmp2 = g_strdup(orage_tm_date_to_i18_date(&tm_date_start));
-        tmp = g_strdup_printf(_("<b>Events for %s:</b>"), tmp2);
-        g_free(tmp2);
-    }
-    else {
-        int i;
-
-        tm_date_end = tm_date_start;
-        for (i = g_par.show_event_days-1; i; i--)
-            orage_move_day(&tm_date_end, 1);
-        tmp2 = g_strdup(orage_tm_date_to_i18_date(&tm_date_start));
-        tmp3 = g_strdup(orage_tm_date_to_i18_date(&tm_date_end));
-        tmp = g_strdup_printf(_("<b>Events for %s - %s:</b>"), tmp2, tmp3);
-        g_free(tmp2);
-        g_free(tmp3);
+    if (g_par.show_event_days) {
+    /* bug 7836: we call this routine also with 0 = no event data at all */
+        if (g_par.show_event_days == 1) {
+            tmp2 = g_strdup(orage_tm_date_to_i18_date(&tm_date_start));
+            tmp = g_strdup_printf(_("<b>Events for %s:</b>"), tmp2);
+            g_free(tmp2);
+        }
+        else {
+            int i;
+
+            tm_date_end = tm_date_start;
+            for (i = g_par.show_event_days-1; i; i--)
+                orage_move_day(&tm_date_end, 1);
+            tmp2 = g_strdup(orage_tm_date_to_i18_date(&tm_date_start));
+            tmp3 = g_strdup(orage_tm_date_to_i18_date(&tm_date_end));
+            tmp = g_strdup_printf(_("<b>Events for %s - %s:</b>"), tmp2, tmp3);
+            g_free(tmp2);
+            g_free(tmp3);
+        }
+        gtk_label_set_markup(GTK_LABEL(cal->mEvent_label), tmp);
+        g_free(tmp);
     }
-    gtk_label_set_markup(GTK_LABEL(cal->mEvent_label), tmp);
-    g_free(tmp);
 
     gtk_box_pack_start(GTK_BOX(cal->mEvent_vbox), cal->mEvent_label
             , FALSE, FALSE, 0);


More information about the Xfce4-commits mailing list