With the introduction of the rideSelected signal the RideFile was
opened (as previously) by the RideSummaryWindow::htmlSummary()
member. In some cases, this signal was processed by RideSummary window
AFTER the other charts (AllPlot etc) this results in 'No data' being
shown on other charts.
This patch moves the file reading to RideItem::ride() which was previously
a public RideFile * (that is now a protected member ride_). As a happy by
product it removes the need to check if the file has already been read
across all other functions ensuring in-core values are not accidentally
overwritten. The read errors are made available by a new RideItem::errors()
member.
This modification is required to support the RideImportWizard in freeing
loaded RideFiles during batch import to ensure virtual memory is not
exhausted when large numbers of files are imported at once. This modification
is also included in this patch.
created a method to find QSettings (settings.h) and stopped it from leaking.
The leak looked like this...
==7800== at 0x4C2726C: operator new(unsigned long) (vg_replace_malloc.c:230)
==7800== by 0x64FD232: (within /usr/lib/libQtCore.so.4.5.0)
==7800== by 0x64FDB62: QSettings::QSettings(QString const&, QString const&, Q
Object*) (in /usr/lib/libQtCore.so.4.5.0)
==7800== by 0x4738E5: PfPvPlot::setData(RideItem*) (PfPvPlot.cpp:361)
With some versions of Qt/Qwt, tooltips cause an infinite recursion. We don't
know why this happens yet, but this patch at least prevents crashes while we
figure it out.
This patch unifies the way in which we handle negative values in the Power
Histogram by ignoring all values (speed, hr, cadence, power, and torque)
less than zero.
I'm not sure if this is the right way to handle such values long term, but
it sure beats dumping core.
QVector::resize() already does exponential capacity growth and zero fills new
elements, so there's no reason for us to be doing either by hand. This change
simplifies our code substantially.
data type instead of dynamically allocating and freeing arrays. No
memory leak here, but it's an low hanging fruit type of example of
what kind of changes we can do to reduce the amount of explicit
dynamic memory management.
--jtc
bucket sizes, the power histogram often looks short and squat with a
lot of whitespace at the top because the largest bucket may be 3 - 5
minutes, but the y-axis is scaled by adding a constant 10 (minutes) to
the max.
The attached patch scales the y-axis by a factor of 1.1 (The ride plot
does the same scaling, and it appears to work well there). Now you're
able to see more detail in histogram plots as the curve is not all
squashed along the bottom of the graph.
-jtc