This is a partial patch based on code from Eric Murray. It changes just
enough of ManyalRideDialog to fix a crash that otherwise occurs when the
user doesn't have a zones file.
The previous version of this code contained a memory corruption bug.
QwtPlot deletes all of the items that are attached to it in its
destructor, but the QwtPlotMarkers for intervals were being allocated as a
group with array new. If we deleted an AllPlot object, then, it would
have tried to delete each of the marker objects individually, rather than
with array delete, which causes memory corruption. We haven't seen this
bug before because we don't ever delete AllPlot objects (which is a memory
leak in MainWindow).
Use gcc macros for __TIME__ and __DATE__ to compute build date. This has the
advantage that we don't have to shell out to find the date, though it has the
disadvantage that it doesn't give us any control over format, nor does it
report the time zone.
By default, set GC_VERSION to "(developer build)". For release versions,
specify GC_VERSION explicitly in gcconfig.pri like this:
QMAKE_CXXFLAGS += -DGC_VERSION="'\"1.2.0\"'"
It would be nice to specify the git commit id in developer builds. On the
other hand, the developer could always have uncommitted changes, so the git
commit id doesn't really make for a completely reproducible build. It's also
a pain to get ahold of in Windows.
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.
Revert "Revert "First line of Notes in WKO imported file now has sport followed by workout code. Improves Calendar display.""
This reverts commit 3567012046.