[gnome-clocks] Add multiple alarm deletion:



commit 5940d864c418efd2bbc7180152c0f107e63ad58a
Author: Seif Lotfy <seif lotfy com>
Date:   Sat Aug 25 19:50:28 2012 +0200

    Add multiple alarm deletion:
    
    Fix ICSHandler to support deleting several alarms properly

 gnomeclocks/alarm.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gnomeclocks/alarm.py b/gnomeclocks/alarm.py
index c3514b9..c0bb3b5 100644
--- a/gnomeclocks/alarm.py
+++ b/gnomeclocks/alarm.py
@@ -37,9 +37,12 @@ class ICSHandler():
     def remove_vevents(self, uids):
         with open(self.ics_file, 'r+') as ics:
             vcal = vobject.readOne(ics)
+            v_set = []
             for v in vcal.components():
                 if v.uid.value in uids:
-                    vcal.remove(v)
+                    v_set.append(v)
+            for v in v_set:
+                vcal.remove(v)
             ics.seek(0)
             vcal.serialize(ics)
 



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