#include <config.h>
-#define _GNU_SOURCE
-
#include <glib.h>
#include <gtk/gtk.h>
#include "map-download.h"
#include "route.h"
#include "mapper-types.h"
-#include "bt.h"
#include "gps.h"
#include "settings-gconf.h"
#include "settings.h"
if (_must_save_data)
_must_save_data = FALSE;
else {
- if (_conn_state > RCVR_OFF) {
+ if (_gps->io.conn > RCVR_OFF) {
if (gconf_client_get_bool(gconf_client, GCONF_KEY_DISCONNECT_ON_COVER, NULL)) {
gconf_client_clear_cache(gconf_client);
- gps_conn_set_state(RCVR_OFF);
- rcvr_disconnect();
- track_add(0, FALSE);
+ gps_conn_set_state(_gps, RCVR_OFF);
+ gps_disconnect(_gps);
+ track_add(NULL);
/* Pretend autoroute is in progress to avoid download. */
if (_autoroute_data.enabled)
_autoroute_data.in_progress = TRUE;
config_save();
_must_save_data = TRUE;
} else if (state->memory_low_ind) {
- /* Drop any memory we can.. */
+ poi_icon_hash_clear();
} else {
- if (_conn_state == RCVR_OFF && _enable_gps) {
- gps_conn_set_state(RCVR_DOWN);
- rcvr_connect_later();
+ if (_gps->io.conn == RCVR_OFF && _enable_gps) {
+ gps_conn_set_state(_gps, RCVR_DOWN);
+ gps_connect_later(_gps);
if (_autoroute_data.enabled)
_autoroute_data.in_progress = TRUE;
}