Handle gps disconnect time
authorEnrico Zini <enrico@enricozini.org>
Sun, 16 Aug 2009 20:14:41 +0000 (21:14 +0100)
committerEnrico Zini <enrico@enricozini.org>
Sun, 16 Aug 2009 20:14:41 +0000 (21:14 +0100)
src/app_main.vala

index 7a116d2fb471999d008ef1112fa3d6bf5b5c18aa..7553c1ae2105fa48187e3a0fdc3f843edb591459 100644 (file)
@@ -92,10 +92,15 @@ public class Clock : Gtk.VBox
 
        private void on_gps_time(dynamic DBus.Object pos, int t)
        {
 
        private void on_gps_time(dynamic DBus.Object pos, int t)
        {
-stderr.printf("GPS TIME %d\n", t);
-               last_gps_time = (time_t)t;
-        last_gps_time_system_time = time_t();
-        update_time();
+        if (t == 0)
+        {
+            last_gps_time_system_time = 0;
+            update_time();
+        } else {
+            last_gps_time = (time_t)t;
+            last_gps_time_system_time = time_t();
+            update_time();
+        }
        }
 
     private bool on_system_time()
        }
 
     private bool on_system_time()