From fe38a768f2b1375a4201e271da52fc1f5712e9a0 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Wed, 11 Jul 2018 12:54:00 +0200 Subject: [PATCH] ssrf: move functions from mobile-helper to mobile-main Move few mobile only functions from mobile-helper to mobile-main remove subsurface-mobile-helper file structure is now subsurface-*-main.cpp + subsurface-helper.cpp Signed-off-by: Jan Iversen --- CMakeLists.txt | 1 - packaging/ios/Subsurface-mobile.pro | 2 +- subsurface-mobile-helper.cpp | 43 ----------------------------- subsurface-mobile-main.cpp | 18 ++++++++++++ 4 files changed, 19 insertions(+), 45 deletions(-) delete mode 100644 subsurface-mobile-helper.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 30c507e7b..ce8571c8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -290,7 +290,6 @@ if(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "MobileExecutable") mobile-widgets/qml/kirigami/src/libkirigami/platformtheme.cpp mobile-widgets/qml/kirigami/src/libkirigami/tabletmodewatcher.cpp subsurface-mobile-main.cpp - subsurface-mobile-helper.cpp subsurface-helper.cpp profile-widget/qmlprofile.cpp map-widget/qmlmapwidgethelper.cpp diff --git a/packaging/ios/Subsurface-mobile.pro b/packaging/ios/Subsurface-mobile.pro index 5b9313598..cea7fdb28 100644 --- a/packaging/ios/Subsurface-mobile.pro +++ b/packaging/ios/Subsurface-mobile.pro @@ -7,7 +7,7 @@ DEFINES += SUBSURFACE_MOBILE BT_SUPPORT BLE_SUPPORT CONFIG += c++11 SOURCES += ../../subsurface-mobile-main.cpp \ - ../../subsurface-mobile-helper.cpp \ + ../../subsurface-helper.cpp \ ../../map-widget/qmlmapwidgethelper.cpp \ ../../core/cloudstorage.cpp \ ../../core/configuredivecomputerthreads.cpp \ diff --git a/subsurface-mobile-helper.cpp b/subsurface-mobile-helper.cpp deleted file mode 100644 index 1c7474022..000000000 --- a/subsurface-mobile-helper.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* qt-gui.cpp */ -/* Qt UI implementation */ -#include "core/display.h" -#include "core/qthelper.h" - -#include -#include -#include -#include - - -#include -#include -#include -#include -#include -#include "mobile-widgets/qmlmanager.h" -#include "qt-models/gpslistmodel.h" -#include "qt-models/messagehandlermodel.h" -#include "core/settings/qPref.h" - -#include "mobile-widgets/qml/kirigami/src/kirigamiplugin.h" - -#include "core/ssrf.h" - -void set_non_bt_addresses() { -#if defined(Q_OS_ANDROID) - connectionListModel.addAddress("FTDI"); -#elif defined(Q_OS_LINUX) // since this is in the else, it does NOT include Android - connectionListModel.addAddress("/dev/ttyS0"); - connectionListModel.addAddress("/dev/ttyS1"); - connectionListModel.addAddress("/dev/ttyS2"); - connectionListModel.addAddress("/dev/ttyS3"); - // this makes debugging so much easier - use the simulator - connectionListModel.addAddress("/tmp/ttyS1"); -#endif -} - -bool haveFilesOnCommandLine() -{ - return false; -} diff --git a/subsurface-mobile-main.cpp b/subsurface-mobile-main.cpp index 26b8336cc..cd9c9dfa4 100644 --- a/subsurface-mobile-main.cpp +++ b/subsurface-mobile-main.cpp @@ -115,3 +115,21 @@ int main(int argc, char **argv) free_prefs(); return 0; } + +void set_non_bt_addresses() { +#if defined(Q_OS_ANDROID) + connectionListModel.addAddress("FTDI"); +#elif defined(Q_OS_LINUX) // since this is in the else, it does NOT include Android + connectionListModel.addAddress("/dev/ttyS0"); + connectionListModel.addAddress("/dev/ttyS1"); + connectionListModel.addAddress("/dev/ttyS2"); + connectionListModel.addAddress("/dev/ttyS3"); + // this makes debugging so much easier - use the simulator + connectionListModel.addAddress("/tmp/ttyS1"); +#endif +} + +bool haveFilesOnCommandLine() +{ + return false; +}