summaryrefslogtreecommitdiffhomepage
path: root/opentrack/plugin-support.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'opentrack/plugin-support.hpp')
-rw-r--r--opentrack/plugin-support.hpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/opentrack/plugin-support.hpp b/opentrack/plugin-support.hpp
index dbb985dc..a26d7f08 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>
@@ -63,8 +62,7 @@ struct dylib final {
if (filename.size() == 0)
return;
- QString fullPath = QCoreApplication::applicationDirPath() + "/" + filename;
- handle = new QLibrary(fullPath);
+ handle = new QLibrary(filename);
handle->setLoadHints(QLibrary::PreventUnloadHint | handle->loadHints());
struct _foo {
@@ -106,7 +104,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,9 +112,7 @@ struct dylib final {
};
const Type filters_t[] = { Filter, Tracker, Protocol };
- static const QString libexec_path(QStringLiteral("./") + opentrack_library_path);
-
- QDir settingsDir(libexec_path);
+ QDir settingsDir(library_path);
QList<mem<dylib>> ret;
@@ -130,7 +126,7 @@ struct dylib final {
{
QIcon icon;
QString longName;
- auto lib = std::make_shared<dylib>(libexec_path + QStringLiteral("/") + filename, t);
+ auto lib = std::make_shared<dylib>(library_path + filename, t);
qDebug() << "Loading" << filename;
std::cout.flush();
if (!get_metadata(lib, longName, icon))
@@ -174,9 +170,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))