Finally remove Old Ride list QTreeWidget !

.. its been there since the beginning at the heart of the code
   as a registry of the rides (RideItem) and controlling the
   selection of rides.

.. in v3.0 we stopped showing it, but it was still created and
   then hidden immediately. But removing the 'spine' of the code
   was seen as a step too far.

.. this is the first part of moving from SQL to a NoSQL cache
   for ride metrics, metadata and measures -- RideItem is now
   no longer inheriting from QTreeWidgetItem with all the issues
   that brings.

.. since its right at the heart there are likely to be unforeseen
   bugs as we go, especially since it affects the ride navigator.

.. add/delete has been tested a fair amount and should be reliable.
This commit is contained in:
Mark Liversedge
2014-12-03 10:33:50 +00:00
parent 43afccd81b
commit f148481ada
22 changed files with 276 additions and 361 deletions

View File

@@ -22,6 +22,7 @@
#include "Context.h"
#include "IntervalItem.h"
#include "RideFile.h"
#include "RideItem.h"
#include "WPrime.h"
#include <QMap>
#include <math.h>
@@ -416,7 +417,7 @@ struct CompareBests {
void
AddIntervalDialog::createClicked()
{
const RideFile *ride = context->currentRide();
const RideFile *ride = context->ride ? context->ride->ride() : NULL;
if (!ride) {
QMessageBox::critical(this, tr("Select Ride"), tr("No ride selected!"));
return;
@@ -861,7 +862,7 @@ AddIntervalDialog::addClicked()
double start = resultsTable->item(i,3)->text().toDouble();
double stop = resultsTable->item(i,4)->text().toDouble();
QString name = resultsTable->item(i,2)->text();
const RideFile *ride = context->currentRide();
const RideFile *ride = context->ride ? context->ride->ride() : NULL;
QTreeWidgetItem *allIntervals = context->athlete->mutableIntervalItems();
QTreeWidgetItem *last =