[gnome-clocks] Fix segfault when modifying an alarm



commit 2d0a68d779135bb7d0e655701711720640223b68
Author: Garrett Regier <garrettregier gmail com>
Date:   Thu Sep 11 13:11:47 2014 -0700

    Fix segfault when modifying an alarm
    
    The days must be set before set_range() as it will emit
    signals which will try to access days.
    
    Signed-off-by: Garrett Regier <garrettregier gmail com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=728392

 src/alarm.vala |   26 ++++++++++++--------------
 1 files changed, 12 insertions(+), 14 deletions(-)
---
diff --git a/src/alarm.vala b/src/alarm.vala
index 1a2851c..2ab2c60 100644
--- a/src/alarm.vala
+++ b/src/alarm.vala
@@ -317,20 +317,6 @@ private class SetupDialog : Gtk.Dialog {
         // Force LTR since we do not want to reverse [hh] : [mm]
         time_grid.set_direction (Gtk.TextDirection.LTR);
 
-        format  = Utils.WallClock.get_default ().format;
-        am_pm_button = new AmPmToggleButton ();
-
-        if (format == Utils.WallClock.Format.TWENTYFOUR)
-            // 24h format
-            h_spinbutton.set_range (0, 23);
-        else {
-            // 12h format
-            h_spinbutton.set_range (1, 12);
-            am_pm_sizegroup.add_widget (am_pm_button);
-            am_pm_alignment.remove (am_pm_alignment.get_child ());
-            am_pm_alignment.add (am_pm_button);
-        }
-
         // Create an array with the weekday buttons with
         // day_buttons[0] referencing the button for Monday, and so on.
         // Also declare toogled signal connection.
@@ -352,6 +338,18 @@ private class SetupDialog : Gtk.Dialog {
             day_buttons_box.pack_start (day_buttons[day_number]);
         }
 
+        format  = Utils.WallClock.get_default ().format;
+        am_pm_button = new AmPmToggleButton ();
+
+        if (format == Utils.WallClock.Format.TWENTYFOUR) {
+            h_spinbutton.set_range (0, 23);
+        } else {
+            h_spinbutton.set_range (1, 12);
+            am_pm_sizegroup.add_widget (am_pm_button);
+            am_pm_alignment.remove (am_pm_alignment.get_child ());
+            am_pm_alignment.add (am_pm_button);
+        }
+
         set_from_alarm (alarm);
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]