]> err.no Git - mapper/blobdiff - src/maemo-osso.c
Add header and cast properly.
[mapper] / src / maemo-osso.c
index d31ec2c45582ab49d130752653292aca1eb793b9..9f6354bfdf35388822f1dfa4cc6a0f952541278e 100644 (file)
@@ -1,26 +1,49 @@
+/*
+ * This file is part of mapper
+ *
+ * Copyright (C) 2007 Kaj-Michael Lang
+ * Copyright (C) 2006-2007 John Costigan.
+ *
+ * POI and GPS-Info code originally written by Cezary Jackiewicz.
+ *
+ * Default map data provided by http://www.openstreetmap.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
 /* 
  * Maemo hardware specific functions 
  */
 
 #include <config.h>
 
-#define _GNU_SOURCE
-
 #include <glib.h>
 #include <gtk/gtk.h>
 
 #ifdef WITH_OSSO
-
 #include <libosso.h>
-#include <osso-helplib.h>
-#include <osso-ic-dbus.h>
+
+#ifdef WITH_OSSO_IC
 #include <osso-ic.h>
+#include <osso-ic-dbus.h>
+#endif
 
 #include "map.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"
@@ -46,12 +69,12 @@ if (state->system_inactivity_ind) {
        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);
-                               set_conn_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;
@@ -66,11 +89,11 @@ if (state->system_inactivity_ind) {
        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) {
-               set_conn_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;
        }