mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Don't repopulate the model if the dive didn't change
plotDives takes a list of dives (for future use) but currently only looks at the first dive in this list. With that semantic in mind we can save ourselves some work if we first check if this is the same dive we are already showing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ba6713f0d8
commit
829473ddc6
1 changed files with 8 additions and 0 deletions
|
@ -272,6 +272,14 @@ void ProfileWidget2::plotDives(QList<dive*> dives)
|
|||
if (!d)
|
||||
return;
|
||||
|
||||
// No need to do this again if we are already showing that dive,
|
||||
// so we check the unique id of the dive against the one we are
|
||||
// showing (can't compare the dive pointers as those might change).
|
||||
// I'm unclear what the semantics are supposed to be if we actually
|
||||
// use more than one 'dives' as argument - so ignoring that right now :-)
|
||||
if (d->id == dataModel->id())
|
||||
return;
|
||||
|
||||
setProfileState();
|
||||
// Here we need to probe for the limits of the dive.
|
||||
// There's already a function that does exactly that,
|
||||
|
|
Loading…
Add table
Reference in a new issue