summaryrefslogtreecommitdiff
path: root/navit/mapset.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-09-21 18:38:29 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-09-21 18:38:29 +0000
commit8cf7bed680fd9045d0351961186aa1ff2f1588a4 (patch)
treea0a31eaae81e906be2536e15ece4bfce12e2ba4e /navit/mapset.c
parent1bc6ddc4908e3629eb69c73f6ebe107402de9639 (diff)
downloadnavit-svn-8cf7bed680fd9045d0351961186aa1ff2f1588a4.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.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/navit/mapset.c b/navit/mapset.c
index eed7539a..e3606815 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);