summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/dive.h2
-rw-r--r--core/subsurfacestartup.c6
-rw-r--r--mobile-widgets/qmlmanager.cpp18
3 files changed, 17 insertions, 9 deletions
diff --git a/core/dive.h b/core/dive.h
index e64164e75..55858932d 100644
--- a/core/dive.h
+++ b/core/dive.h
@@ -257,7 +257,7 @@ extern bool autogroup;
struct dive *unregister_dive(int idx);
extern void delete_single_dive(int idx);
-extern int run_survey, quit, force_root;
+extern int run_survey, quit, force_root, ignore_bt;
#ifdef SUBSURFACE_MOBILE_DESKTOP
extern char *testqml;
#endif
diff --git a/core/subsurfacestartup.c b/core/subsurfacestartup.c
index 85235b9f7..bf61f9878 100644
--- a/core/subsurfacestartup.c
+++ b/core/subsurfacestartup.c
@@ -104,6 +104,7 @@ struct preferences default_prefs = {
};
int run_survey;
+int ignore_bt;
#ifdef SUBSURFACE_MOBILE_DESKTOP
char *testqml = NULL;
#endif
@@ -179,6 +180,7 @@ static void print_help()
printf("\nUsage: subsurface [options] [logfile ...] [--import logfile ...]");
printf("\n\noptions include:");
printf("\n --help|-h This help text");
+ printf("\n --ignore-bt Don't enable Bluetooth support");
printf("\n --import logfile ... Logs before this option is treated as base, everything after is imported");
printf("\n --verbose|-v Verbose debug (repeat to increase verbosity)");
printf("\n --version Prints current version");
@@ -224,6 +226,10 @@ void parse_argument(const char *arg)
print_help();
exit(0);
}
+ if (strcmp(arg, "--ignore-bt") == 0) {
+ ignore_bt = true;
+ return;
+ }
if (strcmp(arg, "--import") == 0) {
imported = true; /* mark the dives so far as the base, * everything after is imported */
return;
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 49556646b..4f16cf1d0 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -230,14 +230,16 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
appendTextToLog(getAndroidHWInfo());
#endif
setStartPageText(tr("Starting..."));
-
- // ensure that we start the BTDiscovery - this should be triggered by the export of the class
- // to QML, but that doesn't seem to always work
- BTDiscovery *btDiscovery = BTDiscovery::instance();
- m_btEnabled = btDiscovery->btAvailable();
- connect(&btDiscovery->localBtDevice, &QBluetoothLocalDevice::hostModeStateChanged,
- this, &QMLManager::btHostModeChange);
-
+ if (ignore_bt) {
+ m_btEnabled = false;
+ } else {
+ // ensure that we start the BTDiscovery - this should be triggered by the export of the class
+ // to QML, but that doesn't seem to always work
+ BTDiscovery *btDiscovery = BTDiscovery::instance();
+ m_btEnabled = btDiscovery->btAvailable();
+ connect(&btDiscovery->localBtDevice, &QBluetoothLocalDevice::hostModeStateChanged,
+ this, &QMLManager::btHostModeChange);
+ }
// create location manager service
locationProvider = new GpsLocation(&appendTextToLogStandalone, this);
progress_callback = &progressCallback;