diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2008-09-21 18:38:29 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2008-09-21 18:38:29 +0000 |
commit | 8e1ec4992a45715663118c246792b954eabcd2b5 (patch) | |
tree | a0a31eaae81e906be2536e15ece4bfce12e2ba4e /navit/mapset.c | |
parent | a3ae06055f24530e7481e14c7d61168ff751456f (diff) | |
download | navit-8e1ec4992a45715663118c246792b954eabcd2b5.tar.gz |
Fix:Core:Cleaned up map api a bit
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@1391 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/mapset.c')
-rw-r--r-- | navit/mapset.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/navit/mapset.c b/navit/mapset.c index eed7539a5..e36068157 100644 --- a/navit/mapset.c +++ b/navit/mapset.c @@ -74,13 +74,18 @@ mapset_open(struct mapset *ms) struct map * mapset_next(struct mapset_handle *msh, int active) { struct map *ret; + struct attr active_attr; for (;;) { if (!msh->l) return NULL; ret=msh->l->data; msh->l=g_list_next(msh->l); - if (!active || map_get_active(ret)) + if (!active) + return ret; + if (!map_get_attr(ret, attr_active, &active_attr, NULL)) + return ret; + if (active_attr.u.num) return ret; } } @@ -117,12 +122,20 @@ struct item * mapset_search_get_item(struct mapset_search *this) { struct item *ret=NULL; + struct attr active_attr; + while (!this->ms || !(ret=map_search_get_item(this->ms))) { if (this->search_attr->type >= attr_country_all && this->search_attr->type <= attr_country_name) break; - do { + for (;;) { this->map=g_list_next(this->map); - } while (this->map && ! map_get_active(this->map->data)); + if (! this->map) + break; + if (!map_get_attr(this->map, attr_active, &active_attr, NULL)) + break; + if (active_attr.u.num) + break; + } if (! this->map) break; map_search_destroy(this->ms); |