Remember Trip Selection.

This patch remembers the trip selection across the Dive Tree Model.
It's a tiny bit big because we used to have a variable 'selected
trips' that's now calculed dynamically - this is more future proof.

This is a start of Un-cluttering the view ( for 4.1 I hope to reduce the
code in this class to nearly a half. )

Fixes #303

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2013-11-26 15:44:18 -02:00 committed by Dirk Hohndel
parent e91a1fc26c
commit e175b1d1ab
6 changed files with 76 additions and 24 deletions

View file

@ -145,5 +145,17 @@ bool gpsHasChanged(struct dive *dive, struct dive *master, const QString& gps_te
dive->latitude.udeg = latudeg;
dive->longitude.udeg = longudeg;
return true;
}
QList< int > getDivesInTrip ( dive_trip_t* trip )
{
QList<int> ret;
for(int i = 0; i < dive_table.nr; i++){
struct dive *d = get_dive(i);
if (d->divetrip == trip){
ret.push_back(get_divenr(d));
}
}
return ret;
}