diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2016-07-08 10:06:49 +0200 | 
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-07-08 10:27:30 +0200 | 
| commit | e4cb9703cc6810dbe07070b485ea866f00ba9252 (patch) | |
| tree | aa78e77c2ce4520513300d1c06cdb53c5c0cacd7 | |
| parent | 81b49dabaf168b907252affd5412de7744a409de (diff) | |
gui, api, proto/wine: get rid of library path as exported symbol
There's no need to do that. It never changes unless the toolchain
changes.
| -rw-r--r-- | csv/csv.cpp | 4 | ||||
| -rw-r--r-- | gui/library-path.cpp | 4 | ||||
| -rw-r--r-- | gui/library-path.hpp | 1 | ||||
| -rw-r--r-- | gui/ui.cpp | 5 | ||||
| -rw-r--r-- | opentrack/plugin-support.hpp | 9 | ||||
| -rw-r--r-- | proto-wine/ftnoir_protocol_wine.cpp | 7 | 
6 files changed, 12 insertions, 18 deletions
| diff --git a/csv/csv.cpp b/csv/csv.cpp index 74fa5f39..14bcb957 100644 --- a/csv/csv.cpp +++ b/csv/csv.cpp @@ -15,7 +15,6 @@  #include <QFile>  #include <QCoreApplication>  #include <QString> -  #include <QDebug>  #include <utility> @@ -99,7 +98,8 @@ bool CSV::getGameData(int id, unsigned char* table, QString& gamename)      QString id_str(QString::number(id)); -    static const QString libexec_path(QString(OPENTRACK_LIBRARY_PATH) + +    static const QString libexec_path(QCoreApplication::applicationDirPath() + +                                      QString(OPENTRACK_LIBRARY_PATH) +                                        QString("settings/facetracknoir supported games.csv"));      QFile file(QCoreApplication::applicationDirPath() + libexec_path); diff --git a/gui/library-path.cpp b/gui/library-path.cpp deleted file mode 100644 index 683dc346..00000000 --- a/gui/library-path.cpp +++ /dev/null @@ -1,4 +0,0 @@ -#include "library-path.hpp" -#include "opentrack-library-path.h" - -const char* opentrack_library_path = OPENTRACK_LIBRARY_PATH; diff --git a/gui/library-path.hpp b/gui/library-path.hpp deleted file mode 100644 index b6454852..00000000 --- a/gui/library-path.hpp +++ /dev/null @@ -1 +0,0 @@ -extern "C" const char* opentrack_library_path; @@ -9,10 +9,11 @@  #include "ui.h"  #include "opentrack-logic/tracker.h"  #include "opentrack-compat/options.hpp" -#include "library-path.hpp" +#include "opentrack-library-path.h"  #include "new_file_dialog.h"  #include <QFileDialog>  #include <QDesktopServices> +#include <QCoreApplication>  #ifndef _WIN32  #   include <unistd.h> @@ -21,7 +22,7 @@  #endif  MainWindow::MainWindow() : -    State(opentrack_library_path), +    State(QCoreApplication::applicationDirPath() + OPENTRACK_LIBRARY_PATH),      pose_update_timer(this),      kbd_quit(QKeySequence("Ctrl+Q"), this),      is_refreshing_profiles(false) diff --git a/opentrack/plugin-support.hpp b/opentrack/plugin-support.hpp index a55526a9..a26d7f08 100644 --- a/opentrack/plugin-support.hpp +++ b/opentrack/plugin-support.hpp @@ -62,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 { @@ -113,9 +112,7 @@ struct dylib final {                                    };          const Type filters_t[] = { Filter, Tracker, Protocol }; -        static const QString libexec_path(QStringLiteral("./") + library_path); - -        QDir settingsDir(libexec_path); +        QDir settingsDir(library_path);          QList<mem<dylib>> ret; @@ -129,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)) diff --git a/proto-wine/ftnoir_protocol_wine.cpp b/proto-wine/ftnoir_protocol_wine.cpp index d99164c6..f11ed8cb 100644 --- a/proto-wine/ftnoir_protocol_wine.cpp +++ b/proto-wine/ftnoir_protocol_wine.cpp @@ -1,5 +1,5 @@  #include "ftnoir_protocol_wine.h" -#include "opentrack/library-path.hpp" +#include "opentrack-library-path.h"  #include <QString>  #include <QStringList>  #include <QCoreApplication> @@ -15,8 +15,9 @@ FTNoIR_Protocol::FTNoIR_Protocol() : lck_shm(WINE_SHM_NAME, WINE_MTX_NAME, sizeo          shm = (WineSHM*) lck_shm.ptr();          memset(shm, 0, sizeof(*shm));      } -    static const QString library_path(opentrack_library_path); -    wrapper.start("wine", QStringList() << (QCoreApplication::applicationDirPath() + library_path + "opentrack-wrapper-wine.exe.so")); +    static const QString library_path(QCoreApplication::applicationDirPath() + OPENTRACK_LIBRARY_PATH); +    wrapper.setWorkingDirectory(QCoreApplication::applicationDirPath()); +    wrapper.start("wine", QStringList() << (library_path + "opentrack-wrapper-wine.exe.so"));  }  FTNoIR_Protocol::~FTNoIR_Protocol() | 
