aboutsummaryrefslogtreecommitdiffstats
path: root/subsurface-helper.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2021-01-14 17:04:37 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-01-19 12:35:29 -0800
commit14721175416772d23c9757e74b78ec8be448aac7 (patch)
tree78b957b2548c3c7806c95c4007410eae7186e8c6 /subsurface-helper.cpp
parent3469fa70eba9a0687d9130cf79e914d4ba242fd8 (diff)
downloadsubsurface-14721175416772d23c9757e74b78ec8be448aac7.tar.gz
cleanup: create separate UI entry points for desktop and mobile
This doesn't really change anything, but makes the code easier to read. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-helper.cpp')
-rw-r--r--subsurface-helper.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/subsurface-helper.cpp b/subsurface-helper.cpp
index 6b92fe203..c8cb8f8ee 100644
--- a/subsurface-helper.cpp
+++ b/subsurface-helper.cpp
@@ -68,9 +68,9 @@ void exit_ui()
free((void *)existing_filename);
}
-void run_ui()
-{
#ifdef SUBSURFACE_MOBILE
+void run_mobile_ui()
+{
#if defined(Q_OS_ANDROID)
// work around an odd interaction between the OnePlus flavor of Android and Qt font handling
if (getAndroidHWInfo().contains("/OnePlus/")) {
@@ -187,11 +187,16 @@ void run_ui()
qml_window->setWidth(width);
#endif // not Q_OS_ANDROID and not Q_OS_IOS
qml_window->show();
-#else
+ qApp->exec();
+}
+#else // SUBSURFACE_MOBILE
+// just run the desktop UI
+void run_ui()
+{
MainWindow::instance()->show();
-#endif // SUBSURFACE_MOBILE
qApp->exec();
}
+#endif // SUBSURFACE_MOBILE
Q_DECLARE_METATYPE(duration_t)
static void register_meta_types()