From 5a6477d7a38f2e5ae6d5fa1f8eacef853daa3ecc Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Mon, 11 Feb 2013 09:05:19 +0000 Subject: [PATCH 1/7] Code Cleanup: GcCalendarModel .. wow, nasty memory leak fixed. Leaked memory every time a ride was selected or calendar was refreshed! .. tbf it was marked with a 'XXX' memory leak comment but really lazy to leave it there. .. was also highlighted by valgrind, which is promising, since I've been using it to hunt down any memory managment issues -- most of them are within 3rd party libraries tho. --- src/GcCalendarModel.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/GcCalendarModel.h b/src/GcCalendarModel.h index 214e53bbb..99c16b6fd 100644 --- a/src/GcCalendarModel.h +++ b/src/GcCalendarModel.h @@ -101,7 +101,15 @@ public slots: // we need to build a list of all the rides // in the source model for the dates we have - dateToRows.clear(); //XXX mem leak, need to delete vectors... + // first we clear previous + QMapIterator* > fm(dateToRows); + while (fm.hasNext()) { + fm.next(); + delete fm.value(); + } + dateToRows.clear(); + + // then we create new for (int j=0; jrowCount(); j++) { QVector *arr; From 1baefa0e2f2ba642b0e07a6c435c5826c0e57f0f Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Mon, 11 Feb 2013 09:35:03 +0000 Subject: [PATCH 2/7] Code Cleanup: Notes deprecated .. some vestiges from the old notes file. .. fixes a significant memory leak in MainWindow too. --- src/MainWindow.cpp | 15 ++++++--------- src/MainWindow.h | 4 +--- src/RideItem.cpp | 4 ++-- src/RideItem.h | 3 +-- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 6efc31874..814d8f69f 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -664,11 +664,10 @@ MainWindow::MainWindow(const QDir &home) : QTreeWidgetItem *last = NULL; QStringListIterator i(RideFileFactory::instance().listRideFiles(home)); while (i.hasNext()) { - QString name = i.next(), notesFileName; + QString name = i.next(); QDateTime dt; - if (parseRideFileName(name, ¬esFileName, &dt)) { - last = new RideItem(RIDE_TYPE, home.path(), - name, dt, zones(), hrZones(), notesFileName, this); + if (parseRideFileName(name, &dt)) { + last = new RideItem(RIDE_TYPE, home.path(), name, dt, zones(), hrZones(), this); allRides->addChild(last); } } @@ -1813,13 +1812,12 @@ MainWindow::dropEvent(QDropEvent *event) void MainWindow::addRide(QString name, bool /* bSelect =true*/) { - QString notesFileName; QDateTime dt; - if (!parseRideFileName(name, ¬esFileName, &dt)) { + if (!parseRideFileName(name, &dt)) { fprintf(stderr, "bad name: %s\n", name.toAscii().constData()); assert(false); } - RideItem *last = new RideItem(RIDE_TYPE, home.path(), name, dt, zones(), hrZones(), notesFileName, this); + RideItem *last = new RideItem(RIDE_TYPE, home.path(), name, dt, zones(), hrZones(), this); int index = 0; while (index < allRides->childCount()) { @@ -2485,7 +2483,7 @@ MainWindow::setCriticalPower(int cp) } bool -MainWindow::parseRideFileName(const QString &name, QString *notesFileName, QDateTime *dt) +MainWindow::parseRideFileName(const QString &name, QDateTime *dt) { static char rideFileRegExp[] = "^((\\d\\d\\d\\d)_(\\d\\d)_(\\d\\d)" "_(\\d\\d)_(\\d\\d)_(\\d\\d))\\.(.+)$"; @@ -2503,7 +2501,6 @@ MainWindow::parseRideFileName(const QString &name, QString *notesFileName, QDate return false; } *dt = QDateTime(date, time); - *notesFileName = rx.cap(1) + ".notes"; return true; } diff --git a/src/MainWindow.h b/src/MainWindow.h index e1a9ae14d..607a1455d 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -375,8 +375,6 @@ class MainWindow : public QMainWindow protected: - static QString notesFileName(QString rideFileName); - private: QSharedPointer settings; IntervalItem *activeInterval; // currently active for context menu popup @@ -439,7 +437,7 @@ class MainWindow : public QMainWindow QSignalMapper *toolMapper; WithingsDownload *withingsDownload; ZeoDownload *zeoDownload; - bool parseRideFileName(const QString &name, QString *notesFileName, QDateTime *dt); + bool parseRideFileName(const QString &name, QDateTime *dt); #ifdef Q_OS_MAC // Mac Native Support diff --git a/src/RideItem.cpp b/src/RideItem.cpp index ce7a15d29..8de48593f 100644 --- a/src/RideItem.cpp +++ b/src/RideItem.cpp @@ -28,9 +28,9 @@ RideItem::RideItem(int type, QString path, QString fileName, const QDateTime &dateTime, - const Zones *zones, const HrZones *hrZones, QString notesFileName, MainWindow *main) : + const Zones *zones, const HrZones *hrZones, MainWindow *main) : QTreeWidgetItem(type), ride_(NULL), main(main), isdirty(false), isedit(false), path(path), fileName(fileName), - dateTime(dateTime), zones(zones), hrZones(hrZones), notesFileName(notesFileName) + dateTime(dateTime), zones(zones), hrZones(hrZones) { setText(0, dateTime.toString("ddd")); setText(1, dateTime.toString("MMM d, yyyy")); diff --git a/src/RideItem.h b/src/RideItem.h index 51fa52430..5036a28be 100644 --- a/src/RideItem.h +++ b/src/RideItem.h @@ -74,11 +74,10 @@ class RideItem : public QObject, public QTreeWidgetItem //<< for signals/slots const QStringList errors() { return errors_; } const Zones *zones; const HrZones *hrZones; - QString notesFileName; RideItem(int type, QString path, QString fileName, const QDateTime &dateTime, - const Zones *zones, const HrZones *hrZones, QString notesFileName, MainWindow *main); + const Zones *zones, const HrZones *hrZones, MainWindow *main); void setDirty(bool); bool isDirty() { return isdirty; } From 40baed9272b4f7b80637f7c45b1c800ea4b3d771 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Mon, 11 Feb 2013 09:40:42 +0000 Subject: [PATCH 3/7] Code Cleanup: src.pro Removed deprecated / unused code, includes; - racedispatcher.cpp - simplenetworkcontroller.cpp - simplenetworkclient.cpp Will look at the network stuff in OpenTrainer. --- src/src.pro | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/src.pro b/src/src.pro index b5bf1a6e5..99dd6e973 100644 --- a/src/src.pro +++ b/src/src.pro @@ -352,7 +352,6 @@ HEADERS += \ QuarqRideFile.h \ QxtScheduleViewProxy.h \ RawRideFile.h \ - RaceDispatcher.h \ RealtimeData.h \ RealtimePlotWindow.h \ RealtimeController.h \ @@ -380,8 +379,6 @@ HEADERS += \ SeasonParser.h \ Serial.h \ Settings.h \ - SimpleNetworkController.h \ - SimpleNetworkClient.h \ SpecialFields.h \ SpinScanPlot.h \ SpinScanPolarPlot.h \ @@ -548,7 +545,6 @@ SOURCES += \ QuarqdClient.cpp \ QuarqParser.cpp \ QuarqRideFile.cpp \ - RaceDispatcher.cpp \ RawRideFile.cpp \ RealtimeData.cpp \ RealtimeController.cpp \ @@ -575,8 +571,6 @@ SOURCES += \ SeasonParser.cpp \ Serial.cpp \ Settings.cpp \ - SimpleNetworkController.cpp \ - SimpleNetworkClient.cpp \ SmallPlot.cpp \ SpecialFields.cpp \ SpinScanPlot.cpp \ From 9f94ba823d16607533f9e92e071f17ee27f24175 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Mon, 11 Feb 2013 10:03:21 +0000 Subject: [PATCH 4/7] Code Cleanup: Deprecating stuff Train view - race* - out of date and no used Train view - SimpleNetwork - not used Analysis view - WeeklySummaryWindow - not used MainWindow - RideCalendar - deprecated 2 years ago --- src/DiaryWindow.cpp | 39 ------------------- src/DiaryWindow.h | 9 ----- src/GcWindowRegistry.cpp | 3 +- src/MainWindow.cpp | 2 - src/NullController.cpp | 1 - src/{ => deprecated}/RaceCourse.cpp | 0 src/{ => deprecated}/RaceCourse.h | 0 src/{ => deprecated}/RaceDispatcher.cpp | 0 src/{ => deprecated}/RaceDispatcher.h | 0 src/{ => deprecated}/RaceLeaderboard.cpp | 0 src/{ => deprecated}/RaceLeaderboard.h | 0 src/{ => deprecated}/RaceRider.cpp | 0 src/{ => deprecated}/RaceRider.h | 0 src/{ => deprecated}/RaceRiders.cpp | 0 src/{ => deprecated}/RaceRiders.h | 0 src/{ => deprecated}/RaceWindow.cpp | 0 src/{ => deprecated}/RaceWindow.h | 0 src/{ => deprecated}/RideCalendar.cpp | 0 src/{ => deprecated}/RideCalendar.h | 0 src/{ => deprecated}/SimpleNetworkClient.cpp | 0 src/{ => deprecated}/SimpleNetworkClient.h | 0 .../SimpleNetworkController.cpp | 0 .../SimpleNetworkController.h | 0 src/{ => deprecated}/WeeklySummaryWindow.cpp | 0 src/{ => deprecated}/WeeklySummaryWindow.h | 0 src/{ => deprecated}/WeeklyViewItemDelegate.h | 0 src/src.pro | 27 ++----------- 27 files changed, 5 insertions(+), 76 deletions(-) rename src/{ => deprecated}/RaceCourse.cpp (100%) rename src/{ => deprecated}/RaceCourse.h (100%) rename src/{ => deprecated}/RaceDispatcher.cpp (100%) rename src/{ => deprecated}/RaceDispatcher.h (100%) rename src/{ => deprecated}/RaceLeaderboard.cpp (100%) rename src/{ => deprecated}/RaceLeaderboard.h (100%) rename src/{ => deprecated}/RaceRider.cpp (100%) rename src/{ => deprecated}/RaceRider.h (100%) rename src/{ => deprecated}/RaceRiders.cpp (100%) rename src/{ => deprecated}/RaceRiders.h (100%) rename src/{ => deprecated}/RaceWindow.cpp (100%) rename src/{ => deprecated}/RaceWindow.h (100%) rename src/{ => deprecated}/RideCalendar.cpp (100%) rename src/{ => deprecated}/RideCalendar.h (100%) rename src/{ => deprecated}/SimpleNetworkClient.cpp (100%) rename src/{ => deprecated}/SimpleNetworkClient.h (100%) rename src/{ => deprecated}/SimpleNetworkController.cpp (100%) rename src/{ => deprecated}/SimpleNetworkController.h (100%) rename src/{ => deprecated}/WeeklySummaryWindow.cpp (100%) rename src/{ => deprecated}/WeeklySummaryWindow.h (100%) rename src/{ => deprecated}/WeeklyViewItemDelegate.h (100%) diff --git a/src/DiaryWindow.cpp b/src/DiaryWindow.cpp index 684354fdb..9b76e9776 100644 --- a/src/DiaryWindow.cpp +++ b/src/DiaryWindow.cpp @@ -48,17 +48,6 @@ DiaryWindow::DiaryWindow(MainWindow *mainWindow) : prev->setFlat(true); #endif -#if 0 - // viewMode - monthly or weekly - viewMode = new QComboBox; - viewMode->addItem("View Month"); - viewMode->addItem("View Week"); // we can add more later... - viewMode->addItem("View Ride"); // we can add more later... - viewMode->setFixedWidth(120); - - viewMode->setCurrentIndex(appsettings->cvalue(mainWindow->cyclist, GC_DIARY_VIEW, "1").toInt()); -#endif - controls->addWidget(prev); controls->addWidget(next); controls->addStretch(); @@ -84,19 +73,8 @@ DiaryWindow::DiaryWindow(MainWindow *mainWindow) : monthlyView->setGridStyle(Qt::DotLine); monthlyView->setFrameStyle(QFrame::NoFrame); - // weekly view via QxtScheduleView - weeklyView = new QxtScheduleView; - weeklyViewProxy = new QxtScheduleViewProxy(this, &fieldDefinitions, mainWindow); - weeklyViewProxy->setSourceModel(mainWindow->listView->sqlModel); - weeklyView->setCurrentZoomDepth (30, Qxt::Minute); - weeklyView->setDateRange(QDate(2010,9,2), QDate(2010,9,8)); - weeklyView->setModel(weeklyViewProxy); - - RideSummaryWindow *rideSummary = new RideSummaryWindow(mainWindow); allViews = new QStackedWidget(this); allViews->addWidget(monthlyView); - allViews->addWidget(weeklyView); - allViews->addWidget(rideSummary); //allViews->setCurrentIndex(viewMode->currentIndex()); allViews->setCurrentIndex(0); @@ -108,7 +86,6 @@ DiaryWindow::DiaryWindow(MainWindow *mainWindow) : connect(this, SIGNAL(rideItemChanged(RideItem*)), this, SLOT(rideSelected())); //connect(mainWindow, SIGNAL(rideSelected()), this, SLOT(rideSelected())); connect(mainWindow, SIGNAL(configChanged()), this, SLOT(configChanged())); - connect(weeklyView, SIGNAL(indexSelected(QModelIndex)), this, SLOT(weeklySelected(QModelIndex))); connect(next, SIGNAL(clicked()), this, SLOT(nextClicked())); connect(prev, SIGNAL(clicked()), this, SLOT(prevClicked())); } @@ -151,8 +128,6 @@ DiaryWindow::rideSelected() calendarModel->setMonth(when.month(), when.year()); when = when.addDays(Qt::Monday - when.dayOfWeek()); - weeklyView->setDateRange(when, when.addDays(6)); - weeklyView->setViewMode(QxtScheduleView::DayView); #if 0 // ok update title @@ -238,20 +213,6 @@ DiaryWindow::nextClicked() #endif } -void -DiaryWindow::weeklySelected(QModelIndex index) -{ - if (active) return; - - // lets select it in the ride list then! - QString filename = weeklyViewProxy->data(index, QxtScheduleViewProxy::FilenameRole).toString(); - active = true; - mainWindow->selectRideFile(QFileInfo(filename).fileName()); - //weeklyView->setViewMode(QxtScheduleView::DayView); - active = false; - rideSelected(); -} - bool DiaryWindow::eventFilter(QObject *object, QEvent *e) { diff --git a/src/DiaryWindow.h b/src/DiaryWindow.h index b104c7c09..5f03cd5d2 100644 --- a/src/DiaryWindow.h +++ b/src/DiaryWindow.h @@ -31,11 +31,6 @@ // list view #include "RideNavigator.h" -// weekly view -#include "qxtscheduleview.h" -#include "QxtScheduleViewProxy.h" -#include "WeeklyViewItemDelegate.h" - // monthly view #include #include "GcCalendarModel.h" @@ -63,7 +58,6 @@ class DiaryWindow : public GcWindow void configChanged(); void nextClicked(); void prevClicked(); - void weeklySelected(QModelIndex); void setDefaultView(int); bool eventFilter(QObject *object, QEvent *e); // traps monthly view @@ -79,9 +73,6 @@ class DiaryWindow : public GcWindow QTableView *monthlyView; GcCalendarModel *calendarModel; - QxtScheduleView *weeklyView; - QxtScheduleViewProxy *weeklyViewProxy; - bool active; QList fieldDefinitions; }; diff --git a/src/GcWindowRegistry.cpp b/src/GcWindowRegistry.cpp index 1ceb7a89c..35961558b 100644 --- a/src/GcWindowRegistry.cpp +++ b/src/GcWindowRegistry.cpp @@ -48,7 +48,6 @@ #include "SummaryWindow.h" #include "MetadataWindow.h" #include "TreeMapWindow.h" -#include "WeeklySummaryWindow.h" #include "DialWindow.h" #include "RealtimePlotWindow.h" #include "SpinScanPlotWindow.h" @@ -137,7 +136,7 @@ GcWindowRegistry::newGcWindow(GcWinID id, MainWindow *main) case GcWindowTypes::Scatter: returning = new ScatterWindow(main, main->home); break; case GcWindowTypes::Summary: returning = new SummaryWindow(main); break; case GcWindowTypes::TreeMap: returning = new TreeMapWindow(main, main->useMetricUnits, main->home); break; - case GcWindowTypes::WeeklySummary: returning = new WeeklySummaryWindow(main->useMetricUnits, main); break; + case GcWindowTypes::WeeklySummary: returning = new SummaryWindow(main); break; // deprecated #if defined Q_OS_MAC || defined GC_HAVE_VLC // mac uses Quicktime / Win/Linux uses VLC case GcWindowTypes::VideoPlayer: returning = new VideoWindow(main, main->home); break; #else diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 814d8f69f..5f497e8c5 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -19,7 +19,6 @@ #include "MainWindow.h" #include "AboutDialog.h" #include "AddIntervalDialog.h" -#include "AthleteTool.h" #include "BestIntervalDialog.h" #include "BlankState.h" #include "ChooseCyclistDialog.h" @@ -52,7 +51,6 @@ #include "Units.h" #include "Zones.h" -#include "RideCalendar.h" #include "DatePickerDialog.h" #include "ToolsDialog.h" #include "ToolsRhoEstimator.h" diff --git a/src/NullController.cpp b/src/NullController.cpp index 9094fbd09..8a81337d5 100644 --- a/src/NullController.cpp +++ b/src/NullController.cpp @@ -20,7 +20,6 @@ #include #include "NullController.h" -#include "RaceDispatcher.h" #include "RealtimeData.h" #include diff --git a/src/RaceCourse.cpp b/src/deprecated/RaceCourse.cpp similarity index 100% rename from src/RaceCourse.cpp rename to src/deprecated/RaceCourse.cpp diff --git a/src/RaceCourse.h b/src/deprecated/RaceCourse.h similarity index 100% rename from src/RaceCourse.h rename to src/deprecated/RaceCourse.h diff --git a/src/RaceDispatcher.cpp b/src/deprecated/RaceDispatcher.cpp similarity index 100% rename from src/RaceDispatcher.cpp rename to src/deprecated/RaceDispatcher.cpp diff --git a/src/RaceDispatcher.h b/src/deprecated/RaceDispatcher.h similarity index 100% rename from src/RaceDispatcher.h rename to src/deprecated/RaceDispatcher.h diff --git a/src/RaceLeaderboard.cpp b/src/deprecated/RaceLeaderboard.cpp similarity index 100% rename from src/RaceLeaderboard.cpp rename to src/deprecated/RaceLeaderboard.cpp diff --git a/src/RaceLeaderboard.h b/src/deprecated/RaceLeaderboard.h similarity index 100% rename from src/RaceLeaderboard.h rename to src/deprecated/RaceLeaderboard.h diff --git a/src/RaceRider.cpp b/src/deprecated/RaceRider.cpp similarity index 100% rename from src/RaceRider.cpp rename to src/deprecated/RaceRider.cpp diff --git a/src/RaceRider.h b/src/deprecated/RaceRider.h similarity index 100% rename from src/RaceRider.h rename to src/deprecated/RaceRider.h diff --git a/src/RaceRiders.cpp b/src/deprecated/RaceRiders.cpp similarity index 100% rename from src/RaceRiders.cpp rename to src/deprecated/RaceRiders.cpp diff --git a/src/RaceRiders.h b/src/deprecated/RaceRiders.h similarity index 100% rename from src/RaceRiders.h rename to src/deprecated/RaceRiders.h diff --git a/src/RaceWindow.cpp b/src/deprecated/RaceWindow.cpp similarity index 100% rename from src/RaceWindow.cpp rename to src/deprecated/RaceWindow.cpp diff --git a/src/RaceWindow.h b/src/deprecated/RaceWindow.h similarity index 100% rename from src/RaceWindow.h rename to src/deprecated/RaceWindow.h diff --git a/src/RideCalendar.cpp b/src/deprecated/RideCalendar.cpp similarity index 100% rename from src/RideCalendar.cpp rename to src/deprecated/RideCalendar.cpp diff --git a/src/RideCalendar.h b/src/deprecated/RideCalendar.h similarity index 100% rename from src/RideCalendar.h rename to src/deprecated/RideCalendar.h diff --git a/src/SimpleNetworkClient.cpp b/src/deprecated/SimpleNetworkClient.cpp similarity index 100% rename from src/SimpleNetworkClient.cpp rename to src/deprecated/SimpleNetworkClient.cpp diff --git a/src/SimpleNetworkClient.h b/src/deprecated/SimpleNetworkClient.h similarity index 100% rename from src/SimpleNetworkClient.h rename to src/deprecated/SimpleNetworkClient.h diff --git a/src/SimpleNetworkController.cpp b/src/deprecated/SimpleNetworkController.cpp similarity index 100% rename from src/SimpleNetworkController.cpp rename to src/deprecated/SimpleNetworkController.cpp diff --git a/src/SimpleNetworkController.h b/src/deprecated/SimpleNetworkController.h similarity index 100% rename from src/SimpleNetworkController.h rename to src/deprecated/SimpleNetworkController.h diff --git a/src/WeeklySummaryWindow.cpp b/src/deprecated/WeeklySummaryWindow.cpp similarity index 100% rename from src/WeeklySummaryWindow.cpp rename to src/deprecated/WeeklySummaryWindow.cpp diff --git a/src/WeeklySummaryWindow.h b/src/deprecated/WeeklySummaryWindow.h similarity index 100% rename from src/WeeklySummaryWindow.h rename to src/deprecated/WeeklySummaryWindow.h diff --git a/src/WeeklyViewItemDelegate.h b/src/deprecated/WeeklyViewItemDelegate.h similarity index 100% rename from src/WeeklyViewItemDelegate.h rename to src/deprecated/WeeklyViewItemDelegate.h diff --git a/src/src.pro b/src/src.pro index 99dd6e973..356a44c21 100644 --- a/src/src.pro +++ b/src/src.pro @@ -211,13 +211,10 @@ win32 { # local qxt widgets - rather than add another dependency on libqxt DEFINES += QXT_STATIC SOURCES += ../qxt/src/qxtspanslider.cpp \ - ../qxt/src/qxtscheduleview.cpp \ - ../qxt/src/qxtscheduleview_p.cpp \ - ../qxt/src/qxtscheduleheaderwidget.cpp \ - ../qxt/src/qxtscheduleviewheadermodel_p.cpp \ - ../qxt/src/qxtscheduleitemdelegate.cpp \ - ../qxt/src/qxtstyleoptionscheduleviewitem.cpp \ - ../qxt/src/qxtstringspinbox.cpp \ + ../qxt/src/qxtstringspinbox.cpp +HEADERS += ../qxt/src/qxtspanslider.h \ + ../qxt/src/qxtspanslider_p.h \ + ../qxt/src/qxtstringspinbox.h isEmpty( QTSOAP_INSTALL ) { include( ../qtsolutions/soap/qtsoap.pri ) @@ -228,23 +225,12 @@ HEADERS += TPUpload.h TPUploadDialog.h TPDownload.h TPDownloadDialog.h SOURCES += TPUpload.cpp TPUploadDialog.cpp TPDownload.cpp TPDownloadDialog.cpp DEFINES += GC_HAVE_SOAP -HEADERS += ../qxt/src/qxtspanslider.h \ - ../qxt/src/qxtspanslider_p.h \ - ../qxt/src/qxtscheduleview.h \ - ../qxt/src/qxtscheduleview_p.h \ - ../qxt/src/qxtscheduleheaderwidget.h \ - ../qxt/src/qxtscheduleviewheadermodel_p.h \ - ../qxt/src/qxtscheduleitemdelegate.h \ - ../qxt/src/qxtstyleoptionscheduleviewitem.h \ - ../qxt/src/qxtstringspinbox.h \ - HEADERS += \ AboutDialog.h \ AddDeviceWizard.h \ AddIntervalDialog.h \ Aerolab.h \ AerolabWindow.h \ - AthleteTool.h \ AllPlot.h \ AllPlotWindow.h \ ANT.h \ @@ -350,7 +336,6 @@ HEADERS += \ QuarqdClient.h \ QuarqParser.h \ QuarqRideFile.h \ - QxtScheduleViewProxy.h \ RawRideFile.h \ RealtimeData.h \ RealtimePlotWindow.h \ @@ -408,8 +393,6 @@ HEADERS += \ TreeMapPlot.h \ TtbDialog.h \ Units.h \ - WeeklySummaryWindow.h \ - WeeklyViewItemDelegate.h \ WithingsDownload.h \ WkoRideFile.h \ WorkoutPlotWindow.h \ @@ -433,7 +416,6 @@ SOURCES += \ AerolabWindow.cpp \ AllPlot.cpp \ AllPlotWindow.cpp \ - AthleteTool.cpp \ ANT.cpp \ ANTChannel.cpp \ ANTLogger.cpp \ @@ -605,7 +587,6 @@ SOURCES += \ TRIMPPoints.cpp \ WattsPerKilogram.cpp \ WithingsDownload.cpp \ - WeeklySummaryWindow.cpp \ WkoRideFile.cpp \ WorkoutPlotWindow.cpp \ WorkoutWizard.cpp \ From dd62b5587f8261a401ee1bd84573b9f1d656815b Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Mon, 11 Feb 2013 10:09:00 +0000 Subject: [PATCH 5/7] Code Cleanup: Deprecated MainWindow - AthleteTool - not used. --- src/{ => deprecated}/AthleteTool.cpp | 0 src/{ => deprecated}/AthleteTool.h | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/{ => deprecated}/AthleteTool.cpp (100%) rename src/{ => deprecated}/AthleteTool.h (100%) diff --git a/src/AthleteTool.cpp b/src/deprecated/AthleteTool.cpp similarity index 100% rename from src/AthleteTool.cpp rename to src/deprecated/AthleteTool.cpp diff --git a/src/AthleteTool.h b/src/deprecated/AthleteTool.h similarity index 100% rename from src/AthleteTool.h rename to src/deprecated/AthleteTool.h From 147d9c81ed337c119270b32ecdb5fb36f5a07bb0 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Mon, 11 Feb 2013 10:40:08 +0000 Subject: [PATCH 6/7] Code Cleanup: Minor Valgrind grumbles .. uninitialised variables --- src/AllPlot.cpp | 2 +- src/MainWindow.cpp | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/AllPlot.cpp b/src/AllPlot.cpp index 87c8760cf..0a67839ea 100644 --- a/src/AllPlot.cpp +++ b/src/AllPlot.cpp @@ -249,7 +249,7 @@ AllPlot::AllPlot(AllPlotWindow *parent, MainWindow *mainWindow): if (appsettings->value(this, GC_SHADEZONES, true).toBool()==false) shade_zones = false; - if (smooth < 1) smooth = 1; + smooth = 1; // create a background object for shading bg = new AllPlotBackground(this); diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 5f497e8c5..7426a82d3 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -969,9 +969,6 @@ MainWindow::MainWindow(const QDir &home) : if (allRides->childCount() != 0) treeWidget->setCurrentItem(allRides->child(allRides->childCount()-1)); - // default to Analysis - selectAnalysis(); - // now we're up and runnning lets connect the signals connect(treeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(rideTreeWidgetSelectionChanged())); connect(intervalWidget,SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(showContextMenuPopup(const QPoint &))); From d7ec43633fcf1e13ed23d525319fc0cc1dd752d1 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Mon, 11 Feb 2013 11:32:23 +0000 Subject: [PATCH 7/7] Code Cleanup: Valgrind Memory Not sure why, but setting the text on a treewidget item seems to cost a lot of memory. So we don't bother since it is never used. In general the valgrind output is ok, quite surprised. There are very few non-widget items that are alloced but never free'd in the GC code. --- src/RideItem.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/RideItem.cpp b/src/RideItem.cpp index 8de48593f..766ad8393 100644 --- a/src/RideItem.cpp +++ b/src/RideItem.cpp @@ -31,13 +31,7 @@ RideItem::RideItem(int type, const Zones *zones, const HrZones *hrZones, MainWindow *main) : QTreeWidgetItem(type), ride_(NULL), main(main), isdirty(false), isedit(false), path(path), fileName(fileName), dateTime(dateTime), zones(zones), hrZones(hrZones) -{ - setText(0, dateTime.toString("ddd")); - setText(1, dateTime.toString("MMM d, yyyy")); - setText(2, dateTime.toString("h:mm AP")); - setTextAlignment(1, Qt::AlignRight); - setTextAlignment(2, Qt::AlignRight); -} +{ } RideFile *RideItem::ride() {