Cleanup code a bit
authorEnrico Zini <enrico@enricozini.org>
Mon, 17 Aug 2009 16:53:02 +0000 (17:53 +0100)
committerEnrico Zini <enrico@enricozini.org>
Mon, 17 Aug 2009 16:53:02 +0000 (17:53 +0100)
src/clock.vala

index 727b32de5c3c8288de1233dc0a5c027682a064cd..3d97a901de39a1970952395a63fd434eed9c6000 100644 (file)
@@ -51,7 +51,7 @@ private int alarm_compare(void* a, void* b)
 [DBus (name = "org.freesmartphone.Notification")]
 public class AlarmNotification : Object {
     public void Alarm () {
-        clock.on_alarm();
+        clock.check_alarms();
     }
 }
 
@@ -110,15 +110,16 @@ public class Clock: zavai.Service
     public void schedule(Alarm a)
     {
         alarms.insert_sorted(a, alarm_compare);
-        zavai.log.info("Next alarm: " + alarms.data.label + " at " + Time.local(alarms.data.deadline).to_string());
         otimed_reschedule();
     }
 
     private void otimed_reschedule()
     {
-        stderr.printf("ALARM: %p BN %s\n", otimed_alarm, zavai.registry.bus_name);
+        zavai.log.info("No alarms left to reschedule");
         if (alarms != null)
         {
+            zavai.log.info("Scheduling next alarm: " + alarms.data.label + " at " + Time.local(alarms.data.deadline).to_string());
+            
             try {
                 otimed_alarm.ClearAlarm(zavai.registry.bus_name);
             } catch (Error e) {
@@ -132,12 +133,6 @@ public class Clock: zavai.Service
         }
     }
 
-    public void on_alarm()
-    {
-stderr.printf("ON ALARM\n");
-        check_alarms();
-    }
-
     public void check_alarms()
     {
         last_system_time = time_t();