X-Git-Url: http://git.maemo.org/git/?p=navit-package;a=blobdiff_plain;f=navit%2Fvehicle.c;fp=navit%2Fvehicle.c;h=117a71f7c360b7ecec6a7401a48b82a31735cfa2;hp=dd0c74983102983f81de4ad00304b10a5c1914d5;hb=2aefaff78ef92c2f07fb45239318d96306c8e688;hpb=1ac8b0238357a06c8f6e540b141bc2dce14e3a57 diff --git a/navit/vehicle.c b/navit/vehicle.c index dd0c749..117a71f 100644 --- a/navit/vehicle.c +++ b/navit/vehicle.c @@ -45,6 +45,7 @@ struct vehicle { struct vehicle_priv *priv; struct callback_list *cbl; struct log *nmea_log, *gpx_log; + char *gpx_desc; struct attr **attrs; // cursor @@ -182,6 +183,10 @@ vehicle_get_attr(struct vehicle *this_, enum attr_type type, struct attr *attr, if (ret) return ret; } + if (type == attr_log_gpx_desc) { + attr->u.str = this_->gpx_desc; + return 1; + } return attr_generic_get_attr(this_->attrs, NULL, type, attr, iter); } @@ -198,6 +203,10 @@ vehicle_set_attr(struct vehicle *this_, struct attr *attr) int ret=1; if (this_->meth.set_attr) ret=this_->meth.set_attr(this_->priv, attr); + if (ret == 1 && attr->type == attr_log_gpx_desc) { + g_free(this_->gpx_desc); + this_->gpx_desc = attr->u.str; + } if (ret == 1 && attr->type != attr_navit) this_->attrs=attr_generic_set_attr(this_->attrs, attr); return ret != 0; @@ -446,6 +455,11 @@ vehicle_log_gpx(struct vehicle *this_, struct log *log) g_free(timep); } } + if (this_->gpx_desc) { + logstr=g_strconcat_printf(logstr,"\t%s\n",this_->gpx_desc); + g_free(this_->gpx_desc); + this_->gpx_desc = NULL; + } if (attr_types_contains_default(attr_types, attr_position_direction,0) && this_->meth.position_attr_get(this_->priv, attr_position_direction, &attr)) logstr=g_strconcat_printf(logstr,"\t%.1f\n",*attr.u.numd); if (attr_types_contains_default(attr_types, attr_position_speed, 0) && this_->meth.position_attr_get(this_->priv, attr_position_speed, &attr))