summaryrefslogtreecommitdiffstats
path: root/qthelper.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-08-22 07:05:13 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-08-22 07:05:13 -0700
commitccd2cb25020e62f37fbf15dcc8b6eccbd643b7f0 (patch)
treed18a50a7448fc6b71ac18c2f99c54c938843dc8b /qthelper.cpp
parente86fd45efde7e8314b8045cb88495c48838bb4bd (diff)
downloadsubsurface-ccd2cb25020e62f37fbf15dcc8b6eccbd643b7f0.tar.gz
Continue to separate logic code from UI code
We don't want to call into the MainWindow from C code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qthelper.cpp')
-rw-r--r--qthelper.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/qthelper.cpp b/qthelper.cpp
index 44bb8a33a..de1d893df 100644
--- a/qthelper.cpp
+++ b/qthelper.cpp
@@ -1274,7 +1274,19 @@ extern "C" void parse_display_units(char *line)
qDebug() << line;
}
+static QByteArray currentApplicationState;
+
+QByteArray getCurrentAppState()
+{
+ return currentApplicationState;
+}
+
+void setCurrentAppState(QByteArray state)
+{
+ currentApplicationState = state;
+}
+
extern "C" bool in_planner()
{
- return MainWindow::instance()->inPlanner();
+ return (currentApplicationState == "PlanDive" || currentApplicationState == "EditPlannedDive");
}