]> err.no Git - mapper/commitdiff
Do the info update callbacks in as idle
authorKaj-Michael Lang <milang@onion.tal.org>
Tue, 29 Jan 2008 16:39:34 +0000 (18:39 +0200)
committerKaj-Michael Lang <milang@onion.tal.org>
Tue, 29 Jan 2008 16:39:34 +0000 (18:39 +0200)
src/gps.c
src/gps.h
src/ui-common.c

index 08e3f316d7cc060f9b2ddde248d49e20ae7b0361..15cb552a640e91a012c6a1572ff8e1e9d8dadffd 100644 (file)
--- a/src/gps.c
+++ b/src/gps.c
@@ -672,6 +672,12 @@ switch (status) {
                                gps->io.nmea=g_strdup(gps->io.buffer);
                                g_assert(gps->io.nmea);
                                g_idle_add_full(G_PRIORITY_HIGH_IDLE, (GSourceFunc)gps_nmea_parse, gps, NULL);
+
+                               if (gps->update_info)
+                                       g_idle_add_full(G_PRIORITY_DEFAULT, (GSourceFunc)gps->update_info, gps, NULL);
+
+                               if (gps->update_satellite)
+                                       g_idle_add_full(G_PRIORITY_DEFAULT, (GSourceFunc)gps->update_satellite, gps, NULL);
                        } else {
                                /* There was a checksum, and it was bad. */
                                g_printerr("%s: Bad checksum in NMEA sentence:\n%s\n", __PRETTY_FUNCTION__, gps->io.buffer);
index fa7afdac02ece1491119f5788471927d6068712a..f2758fc9ffa0d30a24a80192b172fdb548dc60c1 100644 (file)
--- a/src/gps.h
+++ b/src/gps.h
@@ -121,8 +121,8 @@ struct _Gps {
 
        /* New location */
        void(* update_location)(Gps *gps, gboolean newly_fixed);
-       void(* update_satellite)(Gps *gps);
-       void(* update_info)(Gps *gps);
+       gboolean(* update_satellite)(Gps *gps);
+       gboolean(* update_info)(Gps *gps);
 };
 
 Gps *_gps;
index 1fe5f20d49317650e97139f179466f853e0656b2..61c5000d1ac00bfd248cee76c7471be27735b416 100644 (file)
@@ -807,12 +807,18 @@ g_assert(gps);
 if (_gps_info)
     gps_display_data(&gps->data);
 
+gps_display_data_speed(info_banner.speed, gps->data.speed);
+
+return FALSE;
+}
+
+gboolean
+gps_satellite_update(Gps *gps)
+{
 if (_satdetails_on)
     gps_display_details(&gps->data);
 
-gps_display_data_speed(info_banner.speed, gps->data.speed);
-
-return TRUE;
+return FALSE;
 }
 
 gboolean