diff options
-rw-r--r-- | csv/csv.cpp | 4 | ||||
-rw-r--r-- | gui/library-path.cpp (renamed from opentrack/library-path.cpp) | 0 | ||||
-rw-r--r-- | gui/library-path.hpp | 1 | ||||
-rw-r--r-- | gui/ui.cpp | 2 | ||||
-rw-r--r-- | opentrack-logic/state.hpp | 6 | ||||
-rw-r--r-- | opentrack/library-path.hpp | 2 | ||||
-rw-r--r-- | opentrack/plugin-support.hpp | 12 |
7 files changed, 15 insertions, 12 deletions
diff --git a/csv/csv.cpp b/csv/csv.cpp index 668da442..9218bb80 100644 --- a/csv/csv.cpp +++ b/csv/csv.cpp @@ -10,7 +10,7 @@ */ #include "csv.h" -#include "opentrack/library-path.hpp" +#include "opentrack-library-path.h" #include <QTextDecoder> #include <QFile> #include <QCoreApplication> @@ -100,7 +100,7 @@ bool CSV::getGameData(int id, unsigned char* table, QString& gamename) QString id_str(move(QString::number(id))); static const QString libexec_path(QStringLiteral("./") + - QString(opentrack_library_path) + + QStringLiteral(OPENTRACK_LIBRARY_PATH) + QStringLiteral("/settings/facetracknoir supported games.csv")); QFile file(QCoreApplication::applicationDirPath() + libexec_path); diff --git a/opentrack/library-path.cpp b/gui/library-path.cpp index 683dc346..683dc346 100644 --- a/opentrack/library-path.cpp +++ b/gui/library-path.cpp diff --git a/gui/library-path.hpp b/gui/library-path.hpp new file mode 100644 index 00000000..b6454852 --- /dev/null +++ b/gui/library-path.hpp @@ -0,0 +1 @@ +extern "C" const char* opentrack_library_path; @@ -9,6 +9,7 @@ #include "ui.h" #include "opentrack-logic/tracker.h" #include "opentrack-compat/options.hpp" +#include "library-path.hpp" #include "new_file_dialog.h" #include <QFileDialog> #include <QDesktopServices> @@ -20,6 +21,7 @@ #endif MainWindow::MainWindow() : + State(opentrack_library_path), pose_update_timer(this), kbd_quit(QKeySequence("Ctrl+Q"), this), is_refreshing_profiles(false) diff --git a/opentrack-logic/state.hpp b/opentrack-logic/state.hpp index 7e9d10cb..1c608f7a 100644 --- a/opentrack-logic/state.hpp +++ b/opentrack-logic/state.hpp @@ -8,7 +8,6 @@ #pragma once -#include <vector> #include "opentrack-compat/options.hpp" using namespace options; #include "opentrack/plugin-support.hpp" @@ -16,10 +15,13 @@ using namespace options; #include "mappings.hpp" #include "selected-libraries.hpp" #include "work.hpp" +#include <vector> +#include <QString> struct State { - State() : + State(const QString& library_path) : + modules(library_path), pose(std::vector<axis_opts*>{&s.a_x, &s.a_y, &s.a_z, &s.a_yaw, &s.a_pitch, &s.a_roll}) {} Modules modules; diff --git a/opentrack/library-path.hpp b/opentrack/library-path.hpp deleted file mode 100644 index 49a3adb4..00000000 --- a/opentrack/library-path.hpp +++ /dev/null @@ -1,2 +0,0 @@ -#include "export.hpp" -extern "C" OPENTRACK_API_EXPORT const char* opentrack_library_path; diff --git a/opentrack/plugin-support.hpp b/opentrack/plugin-support.hpp index dbb985dc..a55526a9 100644 --- a/opentrack/plugin-support.hpp +++ b/opentrack/plugin-support.hpp @@ -9,7 +9,6 @@ #include "plugin-api.hpp" #include "opentrack-compat/options.hpp" -#include "library-path.hpp" #include <QWidget> #include <QDebug> @@ -106,7 +105,7 @@ struct dylib final { delete handle; } - static QList<mem<dylib>> enum_libraries() + static QList<mem<dylib>> enum_libraries(const QString& library_path) { const char* filters_n[] = { OPENTRACK_SOLIB_PREFIX "opentrack-filter-*." OPENTRACK_SOLIB_EXT, OPENTRACK_SOLIB_PREFIX "opentrack-tracker-*." OPENTRACK_SOLIB_EXT, @@ -114,7 +113,7 @@ struct dylib final { }; const Type filters_t[] = { Filter, Tracker, Protocol }; - static const QString libexec_path(QStringLiteral("./") + opentrack_library_path); + static const QString libexec_path(QStringLiteral("./") + library_path); QDir settingsDir(libexec_path); @@ -174,9 +173,10 @@ private: } }; -struct Modules { - Modules() : - module_list(dylib::enum_libraries()), +struct Modules +{ + Modules(const QString& library_path) : + module_list(dylib::enum_libraries(library_path)), filter_modules(filter(dylib::Filter)), tracker_modules(filter(dylib::Tracker)), protocol_modules(filter(dylib::Protocol)) |