mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Profile: add a flag to force redrawing the profile
This is needed if something has changed that requires a redraw, but the plotDives() function can't tell (for example when a dive computer has been deleted and there's now a different DC in the same spot, with the same number - see next commit). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
397e39eb4f
commit
c4aa1f542c
2 changed files with 5 additions and 1 deletions
|
@ -69,6 +69,7 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent),
|
||||||
backgroundFile(":poster"),
|
backgroundFile(":poster"),
|
||||||
toolTipItem(new ToolTipItem()),
|
toolTipItem(new ToolTipItem()),
|
||||||
isPlotZoomed(prefs.zoomed_plot),
|
isPlotZoomed(prefs.zoomed_plot),
|
||||||
|
forceReplot(false),
|
||||||
profileYAxis(new DepthAxis()),
|
profileYAxis(new DepthAxis()),
|
||||||
gasYAxis(new PartialGasPressureAxis()),
|
gasYAxis(new PartialGasPressureAxis()),
|
||||||
temperatureAxis(new TemperatureAxis()),
|
temperatureAxis(new TemperatureAxis()),
|
||||||
|
@ -401,9 +402,11 @@ void ProfileWidget2::plotDives(QList<dive *> dives)
|
||||||
// showing (can't compare the dive pointers as those might change).
|
// showing (can't compare the dive pointers as those might change).
|
||||||
// I'm unclear what the semantics are supposed to be if we actually
|
// 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 :-)
|
// use more than one 'dives' as argument - so ignoring that right now :-)
|
||||||
if (d->id == dataModel->id() && dc_number == dataModel->dcShown())
|
if (d->id == dataModel->id() && dc_number == dataModel->dcShown() &&
|
||||||
|
!forceReplot)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
forceReplot = false;
|
||||||
if (currentState == EMPTY)
|
if (currentState == EMPTY)
|
||||||
setProfileState();
|
setProfileState();
|
||||||
|
|
||||||
|
|
|
@ -131,6 +131,7 @@ private:
|
||||||
QString backgroundFile;
|
QString backgroundFile;
|
||||||
ToolTipItem *toolTipItem;
|
ToolTipItem *toolTipItem;
|
||||||
bool isPlotZoomed;
|
bool isPlotZoomed;
|
||||||
|
bool forceReplot;
|
||||||
// All those here should probably be merged into one structure,
|
// All those here should probably be merged into one structure,
|
||||||
// So it's esyer to replicate for more dives later.
|
// So it's esyer to replicate for more dives later.
|
||||||
// In the meantime, keep it here.
|
// In the meantime, keep it here.
|
||||||
|
|
Loading…
Add table
Reference in a new issue