[gnome-clocks] AlarmDialog: Make sure the days list is sorted



commit 19951638f9de8f272789e5524ddb788851ca9a5f
Author: Volker Sobek <reklov live com>
Date:   Tue Nov 27 16:11:56 2012 +0100

    AlarmDialog: Make sure the days list is sorted
    
    AlarmItem._update_expiration_time() sometimes calculated wrong times
    because the days list passed to AlarmItem() in
    AlarmDialog.get_alarm_item() wasn't guaranteed to be sorted when the
    week didn't start on Monday.

 gnomeclocks/alarm.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gnomeclocks/alarm.py b/gnomeclocks/alarm.py
index e78f390..9ba2fc3 100644
--- a/gnomeclocks/alarm.py
+++ b/gnomeclocks/alarm.py
@@ -273,6 +273,8 @@ class AlarmDialog(Gtk.Dialog):
         for btn in self.day_buttons:
             if btn.get_active():
                 days.append(btn.data)
+        # needed in case the first day of the week is not 0 (Monday)
+        days.sort()
 
         # if no days were selected, create a daily alarm
         if not days:



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