summaryrefslogtreecommitdiffhomepage
path: root/proto-ft/ftnoir_protocol_ft.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2021-09-03 23:32:05 +0200
committerStanislaw Halik <sthalik@misaki.pl>2021-09-03 23:32:11 +0200
commit0ede90f736caffdf600583a7826fc5d0c76c91c9 (patch)
treec20c763a6a8a27ac968101410332f2546e299722 /proto-ft/ftnoir_protocol_ft.cpp
parent4478909bbf018e814591077dfb98eb9b785eeadf (diff)
proto/freetrack: fix broken interface selection
Diffstat (limited to 'proto-ft/ftnoir_protocol_ft.cpp')
-rw-r--r--proto-ft/ftnoir_protocol_ft.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/proto-ft/ftnoir_protocol_ft.cpp b/proto-ft/ftnoir_protocol_ft.cpp
index 69a3c23f..09e71911 100644
--- a/proto-ft/ftnoir_protocol_ft.cpp
+++ b/proto-ft/ftnoir_protocol_ft.cpp
@@ -159,10 +159,17 @@ module_status freetrack::set_protocols()
QSettings settings_npclient("NaturalPoint", "NATURALPOINT\\NPClient Location");
QString location = *s.custom_location_pathname;
- const auto selection = *s.used_interface;
- bool use_freetrack = ~selection & settings::enable_freetrack,
- use_npclient = ~selection & settings::enable_npclient;
+ bool use_freetrack, use_npclient;
+ switch (*s.used_interface)
+ {
+ case settings::enable_npclient: use_freetrack = false; break;
+ case settings::enable_freetrack: use_npclient = false; break;
+ case settings::enable_both: use_freetrack = true; use_npclient = true; break;
+ default:
+ return error(tr("proto/freetrack: wrong interface selection '%1'")
+ .arg(*s.used_interface));
+ }
if (!s.use_custom_location || s.custom_location_pathname->isEmpty() || !QDir{s.custom_location_pathname}.exists())
location = program_dir;