Assume "no fix" when the "fix" data structure is NULL
[gps-tracker] / gps-tracker.c
index 252cd84..9dc33cc 100644 (file)
@@ -79,7 +79,6 @@ static void write_gpx_footer(AppData *app_data)
   g_fprintf(fp, "</trkseg>\n</trk>\n");
   g_fprintf(fp, app_data->waypoint_block_str->str);
   g_fprintf(fp, "</gpx>\n");
-  g_string_truncate(app_data->waypoint_block_str, 0);
 }
 
 static void cb_wp_set_btn (GtkWidget * w, AppData * data)
@@ -124,6 +123,7 @@ static void cb_start_stop (GtkWidget * w, AppData * data)
     gtk_widget_set_sensitive(GTK_WIDGET(data->wp_set_btn), FALSE);
   }
   g_string_truncate(data->wp_marker_str, 0);
+  g_string_truncate(app_data->waypoint_block_str, 0);
 }
 
 static void cb_file_save (GtkWidget * w, AppData * data)
@@ -278,6 +278,10 @@ static void on_gps_device_changed (LocationGPSDevice *device, gpointer data)
       }
     }
   }
+  else {
+    app_data->has_fix = FALSE;
+    app_data->last_device_status = LOCATION_GPS_DEVICE_STATUS_NO_FIX;
+  }
        
        //g_print ("Satellites in view: %d\n", device->satellites_in_view);
        //g_print ("Satellites in use: %d\n", device->satellites_in_use);