Replace global in_planner variable by helper function

as promised earlier

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Robert C. Helling 2015-08-18 10:03:51 +02:00 committed by Dirk Hohndel
parent 4e89a6020e
commit 72806e42bc
4 changed files with 12 additions and 9 deletions

View file

@ -1716,7 +1716,6 @@ void MainWindow::setApplicationState(const QByteArray& state) {
return;
currentApplicationState = state;
in_planner = (state == "PlanDive" || state == "EditPlannedDive");
#define SET_CURRENT_INDEX( X ) \
if (applicationState[state].X) { \
@ -1732,3 +1731,8 @@ void MainWindow::setApplicationState(const QByteArray& state) {
SET_CURRENT_INDEX( bottomRight )
#undef SET_CURRENT_INDEX
}
bool MainWindow::inPlanner()
{
return (currentApplicationState == "PlanDive" || currentApplicationState == "EditPlannedDive");
}