From 753f56358647175e3bcd8d85296d427a614fb2f7 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Tue, 30 Oct 2007 22:04:41 +0200 Subject: [PATCH] Add more init stages for connecting to db, init poi and osm --- src/mapper.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/mapper.c b/src/mapper.c index d830df8..9bb6d2e 100644 --- a/src/mapper.c +++ b/src/mapper.c @@ -67,6 +67,7 @@ #include "ui-common.h" #include "db.h" #include "osm-db.h" +#include "poi.h" #include "cb.h" #include "speak.h" #include "gpx.h" @@ -101,8 +102,10 @@ enum { MAPPER_INIT_MISC, MAPPER_INIT_CONFIG, MAPPER_INIT_GPS, - MAPPER_INIT_VOICE, MAPPER_INIT_DB, + MAPPER_INIT_POI, + MAPPER_INIT_OSM, + MAPPER_INIT_VOICE, MAPPER_INIT_UI, MAPPER_INIT_GOTO, MAPPER_INIT_DONE @@ -222,7 +225,18 @@ switch (mis) { mis=MAPPER_INIT_DB; break; case MAPPER_INIT_DB: - osm_init(); + if (db_connect(&_db, _mapper_db)) { + mis=MAPPER_INIT_POI; + } else { + mis=MAPPER_INIT_VOICE; + } + break; + case MAPPER_INIT_POI: + poi_init(&_db); + mis=MAPPER_INIT_OSM; + break; + case MAPPER_INIT_OSM: + osm_init(&_db); mis=MAPPER_INIT_VOICE; break; case MAPPER_INIT_VOICE: -- 2.39.5