~ubuntu-branches/ubuntu/saucy/goldencheetah/saucy

« back to all changes in this revision

Viewing changes to src/BestIntervalDialog.cpp

  • Committer: Package Import Robot
  • Author(s): KURASHIKI Satoru
  • Date: 2013-08-18 07:02:45 UTC
  • mfrom: (4.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20130818070245-zgdvb47e1k3mtgil
Tags: 3.0-3
debian/control: remove needless dependency. (Closes: #719571)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
#include "BestIntervalDialog.h"
20
20
#include "MainWindow.h"
 
21
#include "IntervalItem.h"
21
22
#include "RideFile.h"
22
23
#include <QMap>
23
24
#include <assert.h>
256
257
    double totalWatts = 0.0;
257
258
    QList<const RideFilePoint*> window;
258
259
 
 
260
    // ride is shorter than the window size!
 
261
    if (windowSizeSecs > ride->dataPoints().last()->secs + secsDelta) return;
 
262
 
259
263
    // We're looking for intervals with durations in [windowSizeSecs, windowSizeSecs + secsDelta).
260
264
    foreach (const RideFilePoint *point, ride->dataPoints()) {
261
265
        // Discard points until interval duration is < windowSizeSecs + secsDelta.
323
327
                                 ride->timeToDistance(start),
324
328
                                 ride->timeToDistance(stop),
325
329
                                 allIntervals->childCount()+1);
 
330
            last->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
326
331
            // add
327
332
            allIntervals->addChild(last);
328
333
        }