]> err.no Git - mapper/commitdiff
MapWidget: Use path type when setting current/track/route
authorKaj-Michael Lang <milang@tal.org>
Fri, 1 Aug 2008 13:05:53 +0000 (16:05 +0300)
committerKaj-Michael Lang <milang@tal.org>
Fri, 1 Aug 2008 13:05:53 +0000 (16:05 +0300)
libs/libgtkmap/gtkmap.c

index 3c0e5952215e95584d97929e02fa4fe282c2bbf3..7e20020424756c3c33a120ef9e0c3dc681e57906 100644 (file)
@@ -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;
 }