diff options
author | kazer_ <kazer_@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2010-02-04 12:02:29 +0000 |
---|---|---|
committer | kazer_ <kazer_@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2010-02-04 12:02:29 +0000 |
commit | 74a57d1f7d924a340cd5e6ce33853b0ea4b3dc49 (patch) | |
tree | bdcb306a510bdc51274faf53249a0fed0b26e2f8 /navit/vehicle.c | |
parent | 3f6ea477d02edb8cb5d214f5ec66d5148720a22a (diff) | |
download | navit-svn-74a57d1f7d924a340cd5e6ce33853b0ea4b3dc49.tar.gz |
Add:Logging:Added a 'Mark' button for use whith gpx loggin, ticket #542
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@2945 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/vehicle.c')
-rw-r--r-- | navit/vehicle.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/navit/vehicle.c b/navit/vehicle.c index dd0c7498..117a71f7 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<desc>%s</desc>\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<course>%.1f</course>\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)) |