mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
New profile: create fake DC if we have no samples
This call got lost when creating the new plot_info structures. dives/test15.xml is a good test case. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
6801c68c2d
commit
30b25d1212
1 changed files with 8 additions and 4 deletions
|
@ -11,6 +11,7 @@
|
||||||
#include "divetooltipitem.h"
|
#include "divetooltipitem.h"
|
||||||
#include "animationfunctions.h"
|
#include "animationfunctions.h"
|
||||||
#include "planner.h"
|
#include "planner.h"
|
||||||
|
#include "device.h"
|
||||||
#include <QSignalTransition>
|
#include <QSignalTransition>
|
||||||
#include <QPropertyAnimation>
|
#include <QPropertyAnimation>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
@ -315,12 +316,15 @@ void ProfileWidget2::plotDives(QList<dive*> dives)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
setProfileState();
|
setProfileState();
|
||||||
// Here we need to probe for the limits of the dive.
|
|
||||||
// There's already a function that does exactly that,
|
// next get the dive computer structure - if there are no samples
|
||||||
// but it's using the graphics context, and I need to
|
// let's create a fake profile that's somewhat reasonable for the
|
||||||
// replace that.
|
// data that we have
|
||||||
struct divecomputer *currentdc = select_dc(&d->dc);
|
struct divecomputer *currentdc = select_dc(&d->dc);
|
||||||
Q_ASSERT(currentdc);
|
Q_ASSERT(currentdc);
|
||||||
|
if (!currentdc || !currentdc->samples) {
|
||||||
|
currentdc = fake_dc(currentdc);
|
||||||
|
}
|
||||||
|
|
||||||
/* This struct holds all the data that's about to be plotted.
|
/* This struct holds all the data that's about to be plotted.
|
||||||
* I'm not sure this is the best approach ( but since we are
|
* I'm not sure this is the best approach ( but since we are
|
||||||
|
|
Loading…
Add table
Reference in a new issue