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/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/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; 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 6efc31874..7426a82d3 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" @@ -664,11 +662,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); } } @@ -972,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 &))); @@ -1813,13 +1807,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 +2478,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 +2496,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/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/RideItem.cpp b/src/RideItem.cpp index ce7a15d29..766ad8393 100644 --- a/src/RideItem.cpp +++ b/src/RideItem.cpp @@ -28,16 +28,10 @@ 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) -{ - 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); -} + dateTime(dateTime), zones(zones), hrZones(hrZones) +{ } RideFile *RideItem::ride() { 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; } 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 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 b5bf1a6e5..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,9 +336,7 @@ HEADERS += \ QuarqdClient.h \ QuarqParser.h \ QuarqRideFile.h \ - QxtScheduleViewProxy.h \ RawRideFile.h \ - RaceDispatcher.h \ RealtimeData.h \ RealtimePlotWindow.h \ RealtimeController.h \ @@ -380,8 +364,6 @@ HEADERS += \ SeasonParser.h \ Serial.h \ Settings.h \ - SimpleNetworkController.h \ - SimpleNetworkClient.h \ SpecialFields.h \ SpinScanPlot.h \ SpinScanPolarPlot.h \ @@ -411,8 +393,6 @@ HEADERS += \ TreeMapPlot.h \ TtbDialog.h \ Units.h \ - WeeklySummaryWindow.h \ - WeeklyViewItemDelegate.h \ WithingsDownload.h \ WkoRideFile.h \ WorkoutPlotWindow.h \ @@ -436,7 +416,6 @@ SOURCES += \ AerolabWindow.cpp \ AllPlot.cpp \ AllPlotWindow.cpp \ - AthleteTool.cpp \ ANT.cpp \ ANTChannel.cpp \ ANTLogger.cpp \ @@ -548,7 +527,6 @@ SOURCES += \ QuarqdClient.cpp \ QuarqParser.cpp \ QuarqRideFile.cpp \ - RaceDispatcher.cpp \ RawRideFile.cpp \ RealtimeData.cpp \ RealtimeController.cpp \ @@ -575,8 +553,6 @@ SOURCES += \ SeasonParser.cpp \ Serial.cpp \ Settings.cpp \ - SimpleNetworkController.cpp \ - SimpleNetworkClient.cpp \ SmallPlot.cpp \ SpecialFields.cpp \ SpinScanPlot.cpp \ @@ -611,7 +587,6 @@ SOURCES += \ TRIMPPoints.cpp \ WattsPerKilogram.cpp \ WithingsDownload.cpp \ - WeeklySummaryWindow.cpp \ WkoRideFile.cpp \ WorkoutPlotWindow.cpp \ WorkoutWizard.cpp \