Data Filter (Part 3 of 3)

Last part of the search/filter functionality;

* SearchBox now incorporates filter and search
  with a new widget. We can update this widget
  to include more fancy UI/Interactions without
  having to change the ride list or charts etc.

* Added search/filter widget to the relevant charts
  and screens; Metrics, TreeMap, CP, Histogram,
  Activity Log, Ride list (refactored out of MainWindow)

* Added namedsearches.xml and adding/selecting them
  from a drop down menu on the search box.

* Fixed some performance bugs related to duplicate
  signals and redraw/reprocessing. Also ensured that
  CLucene remains optional -- but means no search or
  filter functionality unless it is available.
This commit is contained in:
Mark Liversedge
2012-10-30 21:32:38 +00:00
parent 2e9507b292
commit a5bcec5265
36 changed files with 802 additions and 119 deletions

View File

@@ -869,7 +869,7 @@ static void distAggregate(QVector<double> &into, QVector<double> &other)
}
RideFileCache::RideFileCache(MainWindow *main, QDate start, QDate end)
RideFileCache::RideFileCache(MainWindow *main, QDate start, QDate end, bool filter, QStringList files)
: main(main), rideFileName(""), ride(0)
{
// resize all the arrays to zero - expand as neccessary
@@ -905,7 +905,9 @@ RideFileCache::RideFileCache(MainWindow *main, QDate start, QDate end)
// exist, or /might/ be out of date.
foreach (QString rideFileName, RideFileFactory::instance().listRideFiles(main->home)) {
QDate rideDate = dateFromFileName(rideFileName);
if (rideDate >= start && rideDate <= end) {
if (((filter == true && files.contains(rideFileName)) || filter == false) &&
rideDate >= start && rideDate <= end) {
// get its cached values (will refresh if needed...)
RideFileCache rideCache(main, main->home.absolutePath() + "/" + rideFileName);