Skip to content

Commit 0ede90f

Browse files
committed
proto/freetrack: fix broken interface selection
1 parent 4478909 commit 0ede90f

File tree

6 files changed

+27
-4
lines changed

6 files changed

+27
-4
lines changed

proto-ft/ftnoir_protocol_ft.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,17 @@ module_status freetrack::set_protocols()
159159
QSettings settings_npclient("NaturalPoint", "NATURALPOINT\\NPClient Location");
160160

161161
QString location = *s.custom_location_pathname;
162-
const auto selection = *s.used_interface;
163162

164-
bool use_freetrack = ~selection & settings::enable_freetrack,
165-
use_npclient = ~selection & settings::enable_npclient;
163+
bool use_freetrack, use_npclient;
164+
switch (*s.used_interface)
165+
{
166+
case settings::enable_npclient: use_freetrack = false; break;
167+
case settings::enable_freetrack: use_npclient = false; break;
168+
case settings::enable_both: use_freetrack = true; use_npclient = true; break;
169+
default:
170+
return error(tr("proto/freetrack: wrong interface selection '%1'")
171+
.arg(*s.used_interface));
172+
}
166173

167174
if (!s.use_custom_location || s.custom_location_pathname->isEmpty() || !QDir{s.custom_location_pathname}.exists())
168175
location = program_dir;

proto-ft/ftnoir_protocol_ft.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
using namespace options;
2828

2929
struct settings : opts {
30-
enum enable_status { enable_both, enable_freetrack, enable_npclient, };
30+
enum enable_status : int { enable_both, enable_freetrack, enable_npclient, };
3131
value<int> used_interface{b, "used-interfaces", (int)enable_both};
3232
value<bool> ephemeral_library_location{b, "ephemeral-library-location", false};
3333
value<bool> use_custom_location{b, "use-custom-location", false};

proto-ft/lang/nl_NL.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ Starting tracking will again overwrite the DLL locations.</source>
9191
<source>Can&apos;t copy library to selected custom location &apos;%1&apos;</source>
9292
<translation type="unfinished"></translation>
9393
</message>
94+
<message>
95+
<source>proto/freetrack: wrong interface selection &apos;%1&apos;</source>
96+
<translation type="unfinished"></translation>
97+
</message>
9498
</context>
9599
<context>
96100
<name>freetrackDll</name>

proto-ft/lang/ru_RU.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ Starting tracking will again overwrite the DLL locations.</source>
9393
<source>Can&apos;t copy library to selected custom location &apos;%1&apos;</source>
9494
<translation type="unfinished"></translation>
9595
</message>
96+
<message>
97+
<source>proto/freetrack: wrong interface selection &apos;%1&apos;</source>
98+
<translation type="unfinished"></translation>
99+
</message>
96100
</context>
97101
<context>
98102
<name>freetrackDll</name>

proto-ft/lang/stub.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ Starting tracking will again overwrite the DLL locations.</source>
9191
<source>Can&apos;t copy library to selected custom location &apos;%1&apos;</source>
9292
<translation type="unfinished"></translation>
9393
</message>
94+
<message>
95+
<source>proto/freetrack: wrong interface selection &apos;%1&apos;</source>
96+
<translation type="unfinished"></translation>
97+
</message>
9498
</context>
9599
<context>
96100
<name>freetrackDll</name>

proto-ft/lang/zh_CN.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ Starting tracking will again overwrite the DLL locations.</source>
9191
<source>Can&apos;t copy library to selected custom location &apos;%1&apos;</source>
9292
<translation type="unfinished"></translation>
9393
</message>
94+
<message>
95+
<source>proto/freetrack: wrong interface selection &apos;%1&apos;</source>
96+
<translation type="unfinished"></translation>
97+
</message>
9498
</context>
9599
<context>
96100
<name>freetrackDll</name>

0 commit comments

Comments
 (0)