From: Kaj-Michael Lang Date: Tue, 30 Oct 2007 20:04:41 +0000 (+0200) Subject: Add more init stages for connecting to db, init poi and osm X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=753f56358647175e3bcd8d85296d427a614fb2f7;p=mapper Add more init stages for connecting to db, init poi and osm --- 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: