diff options
author | Robert C. Helling <helling@atdotde.de> | 2017-11-27 22:07:09 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-12-01 15:47:51 -0800 |
commit | 1e678d52b275805f9d9d313a6593fcbc50878e2d (patch) | |
tree | 0d634a6f4bd7852bb3639247991ee92c294fc728 /qt-models/diveplannermodel.cpp | |
parent | a9703628c4c4d3b1226d4ea86b3079718940e14e (diff) | |
download | subsurface-1e678d52b275805f9d9d313a6593fcbc50878e2d.tar.gz |
Make background calculation optional
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'qt-models/diveplannermodel.cpp')
-rw-r--r-- | qt-models/diveplannermodel.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index 6413fc251..2d03a672b 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -13,6 +13,8 @@ #include <QtConcurrent> #include <desktop-widgets/mainwindow.h> +#define VARIATIONS_IN_BACKGROUND 1 + #define UNIT_FACTOR ((prefs.units.length == units::METERS) ? 1000.0 / 60.0 : feet_to_mm(1.0) / 60.0) /* TODO: Port this to CleanerTableModel to remove a bit of boilerplate and @@ -930,7 +932,11 @@ void DivePlannerPointsModel::createTemporaryPlan() lock_planner(); cloneDiveplan(&diveplan, plan_copy); unlock_planner(); +#ifdef VARIATIONS_IN_BACKGROUND QtConcurrent::run(this, &DivePlannerPointsModel::computeVariations, plan_copy, &plan_deco_state); +#else + computeVariations(plan_copy, &plan_deco_state); +#endif final_deco_state = plan_deco_state; emit calculatedPlanNotes(); } |