From: Kaj-Michael Lang Date: Fri, 1 Aug 2008 13:05:53 +0000 (+0300) Subject: MapWidget: Use path type when setting current/track/route X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=413705b16b1fecb7a5a6f12c2cb6fc089513e8d6;p=mapper MapWidget: Use path type when setting current/track/route --- diff --git a/libs/libgtkmap/gtkmap.c b/libs/libgtkmap/gtkmap.c index 3c0e595..7e20020 100644 --- a/libs/libgtkmap/gtkmap.c +++ b/libs/libgtkmap/gtkmap.c @@ -1191,7 +1191,7 @@ for (iter=priv->paths; iter!=NULL; iter=iter->next) { /** * gtk_map_add_path: * @path: A path object to add to the map - * @current: Is this the current track ? + * @current: Is this the current track/route ? * * Adds a new path to the map. */ @@ -1214,8 +1214,17 @@ if (g_slist_find(priv->paths, path)!=NULL) { } g_object_ref(path); priv->paths=g_slist_append(priv->paths, path); -if (current==TRUE) - priv->current_track=path; +if (current==TRUE) { + switch (path->type) { + case PATH_TYPE_ROUTE: + priv->current_track=path; + break; + case PATH_TYPE_TRACK: + priv->current_track=path; + break; + default: ; + } +} gtk_map_refresh(widget); return TRUE; }