diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2009-11-12 16:41:21 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2009-11-12 16:41:21 +0000 |
commit | 725372e083d6c7aae8f888a7c1eba6eba6be5fd2 (patch) | |
tree | 41993b1a16225e1e38834dcf1cc9af9dd8592cf8 /navit/mapset.c | |
parent | 770c0dae922ff5f79c8939d02081d718637ee980 (diff) | |
download | navit-725372e083d6c7aae8f888a7c1eba6eba6be5fd2.tar.gz |
Add:binding_dbus:More functionality, cleanup
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@2747 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/mapset.c')
-rw-r--r-- | navit/mapset.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/navit/mapset.c b/navit/mapset.c index ba5560b86..81e2103ab 100644 --- a/navit/mapset.c +++ b/navit/mapset.c @@ -44,6 +44,10 @@ struct mapset { GList *maps; /**< Linked list of all the maps in the mapset */ }; +struct attr_iter { + GList *last; +}; + /** * @brief Creates a new, empty mapset * @@ -59,6 +63,18 @@ struct mapset *mapset_new(struct attr *parent, struct attr **attrs) } +struct attr_iter * +mapset_attr_iter_new(void) +{ + return g_new0(struct attr_iter, 1); +} + +void +mapset_attr_iter_destroy(struct attr_iter *iter) +{ + g_free(iter); +} + /** * @brief Adds a map to a mapset * @@ -82,11 +98,17 @@ mapset_get_attr(struct mapset *ms, enum attr_type type, struct attr *attr, struc { GList *map; map=ms->maps; + attr->type=type; switch (type) { case attr_map: - if (map) { - attr->u.map=map->data; - return 1; + while (map) { + if (!iter || iter->last == g_list_previous(map)) { + attr->u.map=map->data; + if (iter) + iter->last=map; + return 1; + } + map=g_list_next(map); } break; default: |