diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2013-03-11 22:07:25 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2013-03-11 22:07:25 +0000 |
commit | deea1176b716566e27846501f0e1d209b748a934 (patch) | |
tree | 77cc8122c26b11655907d08fbaced10079446c54 /navit/navit/route.c | |
parent | f71b89493e4691fd74895d644759173043be9eb2 (diff) | |
download | navit-deea1176b716566e27846501f0e1d209b748a934.tar.gz |
Fix:Core:Consider route_depth of profile options
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@5412 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/navit/route.c')
-rw-r--r-- | navit/navit/route.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/navit/navit/route.c b/navit/navit/route.c index 9e1ae96cf..6513d5086 100644 --- a/navit/navit/route.c +++ b/navit/navit/route.c @@ -970,8 +970,7 @@ route_calc_selection(struct coord *c, int count, struct vehicleprofile *profile) struct map_selection *ret=NULL; int i; struct coord_rect r; - char *str, *tok; - struct attr attr; + char *depth, *str, *tok; if (!count) return NULL; @@ -980,11 +979,10 @@ route_calc_selection(struct coord *c, int count, struct vehicleprofile *profile) for (i = 1 ; i < count ; i++) coord_rect_extend(&r, &c[i]); - if(!vehicleprofile_get_attr(profile,attr_route_depth, &attr, NULL) || attr.u.str==NULL) { - attr.u.str="4:25%,8:40000,18:10000"; - } - - attr.u.str=str=g_strdup(attr.u.str); + depth=profile->route_depth; + if (!depth) + depth="4:25%,8:40000,18:10000"; + depth=str=g_strdup(depth); while((tok=strtok(str,","))!=NULL) { int order=0, dist=0; @@ -998,7 +996,7 @@ route_calc_selection(struct coord *c, int count, struct vehicleprofile *profile) str=NULL; } - g_free(attr.u.str); + g_free(depth); return ret; } |