~ubuntu-branches/ubuntu/vivid/goldencheetah/vivid-proposed

« back to all changes in this revision

Viewing changes to src/GpxParser.cpp

  • Committer: Package Import Robot
  • Author(s): KURASHIKI Satoru
  • Date: 2014-03-04 11:26:33 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20140304112633-zj72ncjogjy1iu7h
Tags: 3.0.2-1
* New upstream release.
* Now depends on: libqt4-sql-sqlite.
* Drop libusb support options on kfreebsd.

Show diffs side-by-side

added added

removed removed

Lines of Context:
170
170
 
171
171
        // compute the elapsed time and distance traveled since the
172
172
        // last recorded trackpoint
173
 
        double delta_t = last_time.secsTo(time);
 
173
        // use msec in case there are msec in QDateTime
 
174
        double delta_t_ms = last_time.msecsTo(time);
174
175
        if (delta_d<0)
175
176
        {
176
177
            delta_d=0;
181
182
        // for the first trackpoint -- so set speed to 0.0 instead of
182
183
        // dividing by zero.
183
184
        double speed = 0.0;
184
 
        if (delta_t > 0.0)
 
185
        if (delta_t_ms > 0.0)
185
186
        {
186
 
            speed=delta_d / delta_t * 3600.0;
 
187
            speed= 1000.0 * delta_d / delta_t_ms * 3600.0;
187
188
        }
188
189
 
189
190
        // Time from beginning of activity