mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile: allow disabling BT support from the command line
This is a quick hack to reduce the noise in the log file when chasing other bugs. Maybe this should not be enabled on release builds, but right now I don't think the harm that having this in would do. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2a97934db4
commit
97e26fd51b
3 changed files with 17 additions and 9 deletions
|
@ -257,7 +257,7 @@ extern bool autogroup;
|
||||||
struct dive *unregister_dive(int idx);
|
struct dive *unregister_dive(int idx);
|
||||||
extern void delete_single_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
|
#ifdef SUBSURFACE_MOBILE_DESKTOP
|
||||||
extern char *testqml;
|
extern char *testqml;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -104,6 +104,7 @@ struct preferences default_prefs = {
|
||||||
};
|
};
|
||||||
|
|
||||||
int run_survey;
|
int run_survey;
|
||||||
|
int ignore_bt;
|
||||||
#ifdef SUBSURFACE_MOBILE_DESKTOP
|
#ifdef SUBSURFACE_MOBILE_DESKTOP
|
||||||
char *testqml = NULL;
|
char *testqml = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
@ -179,6 +180,7 @@ static void print_help()
|
||||||
printf("\nUsage: subsurface [options] [logfile ...] [--import logfile ...]");
|
printf("\nUsage: subsurface [options] [logfile ...] [--import logfile ...]");
|
||||||
printf("\n\noptions include:");
|
printf("\n\noptions include:");
|
||||||
printf("\n --help|-h This help text");
|
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 --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 --verbose|-v Verbose debug (repeat to increase verbosity)");
|
||||||
printf("\n --version Prints current version");
|
printf("\n --version Prints current version");
|
||||||
|
@ -224,6 +226,10 @@ void parse_argument(const char *arg)
|
||||||
print_help();
|
print_help();
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
if (strcmp(arg, "--ignore-bt") == 0) {
|
||||||
|
ignore_bt = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (strcmp(arg, "--import") == 0) {
|
if (strcmp(arg, "--import") == 0) {
|
||||||
imported = true; /* mark the dives so far as the base, * everything after is imported */
|
imported = true; /* mark the dives so far as the base, * everything after is imported */
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -230,14 +230,16 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
|
||||||
appendTextToLog(getAndroidHWInfo());
|
appendTextToLog(getAndroidHWInfo());
|
||||||
#endif
|
#endif
|
||||||
setStartPageText(tr("Starting..."));
|
setStartPageText(tr("Starting..."));
|
||||||
|
if (ignore_bt) {
|
||||||
// ensure that we start the BTDiscovery - this should be triggered by the export of the class
|
m_btEnabled = false;
|
||||||
// to QML, but that doesn't seem to always work
|
} else {
|
||||||
BTDiscovery *btDiscovery = BTDiscovery::instance();
|
// ensure that we start the BTDiscovery - this should be triggered by the export of the class
|
||||||
m_btEnabled = btDiscovery->btAvailable();
|
// to QML, but that doesn't seem to always work
|
||||||
connect(&btDiscovery->localBtDevice, &QBluetoothLocalDevice::hostModeStateChanged,
|
BTDiscovery *btDiscovery = BTDiscovery::instance();
|
||||||
this, &QMLManager::btHostModeChange);
|
m_btEnabled = btDiscovery->btAvailable();
|
||||||
|
connect(&btDiscovery->localBtDevice, &QBluetoothLocalDevice::hostModeStateChanged,
|
||||||
|
this, &QMLManager::btHostModeChange);
|
||||||
|
}
|
||||||
// create location manager service
|
// create location manager service
|
||||||
locationProvider = new GpsLocation(&appendTextToLogStandalone, this);
|
locationProvider = new GpsLocation(&appendTextToLogStandalone, this);
|
||||||
progress_callback = &progressCallback;
|
progress_callback = &progressCallback;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue