summaryrefslogtreecommitdiff
path: root/navit/mapset.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-11-12 16:41:21 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-11-12 16:41:21 +0000
commit725372e083d6c7aae8f888a7c1eba6eba6be5fd2 (patch)
tree41993b1a16225e1e38834dcf1cc9af9dd8592cf8 /navit/mapset.c
parent770c0dae922ff5f79c8939d02081d718637ee980 (diff)
downloadnavit-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.c28
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: