From b9a3909834826f035e639a196cc0f8cf7e20ca55 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 19 Dec 2021 16:44:21 +0100 Subject: opentrack: #define to force particular module, overriding .ini --- logic/state.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'logic') diff --git a/logic/state.cpp b/logic/state.cpp index afdf5b12..357430d8 100644 --- a/logic/state.cpp +++ b/logic/state.cpp @@ -1,5 +1,5 @@ #include "state.hpp" - +#include "opentrack/defs.hpp" #include using dylib_ptr = Modules::dylib_ptr; @@ -28,7 +28,13 @@ State::State(const QString& library_path) : dylib_ptr State::current_tracker() { - auto [ptr, idx] = module_by_name(m.tracker_dll, modules.trackers()); + const QString& module = +#ifdef UI_FORCED_TRACKER + UI_FORCED_TRACKER; +#else + m.tracker_dll; +#endif + auto [ptr, idx] = module_by_name(module, modules.trackers()); return ptr; } @@ -40,6 +46,12 @@ dylib_ptr State::current_protocol() dylib_ptr State::current_filter() { - auto [ptr, idx] = module_by_name(m.filter_dll, modules.filters()); + const QString& module = +#ifdef UI_FORCED_FILTER + UI_FORCED_FILTER; +#else + m.filter_dll; +#endif + auto [ptr, idx] = module_by_name(module, modules.filters()); return ptr; } -- cgit v1.2.3