mirror of
https://github.com/EdgeTX/edgetx.git
synced 2025-07-19 22:35:10 +03:00
Also search for simulators in companion.exe path on Windows (Fix #3012)
This commit is contained in:
parent
3b4a6fb49b
commit
22c429a1a7
1 changed files with 9 additions and 2 deletions
|
@ -6,6 +6,9 @@
|
|||
#include <QMap>
|
||||
#include <QMessageBox>
|
||||
#include "version.h"
|
||||
#if defined WIN32 || !defined __GNUC__
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
QMap<QString, SimulatorFactory *> registered_simulators;
|
||||
|
||||
|
@ -47,10 +50,15 @@ void registerSimulators()
|
|||
simulatorsFound = true;
|
||||
}
|
||||
|
||||
#if defined(__APPLE__) || !( (!defined __GNUC__) || (defined __CYGWIN__) )
|
||||
if (!simulatorsFound) {
|
||||
#if defined(__APPLE__)
|
||||
dir = QLibraryInfo::location(QLibraryInfo::PrefixPath) + "/Resources";
|
||||
#elif (!defined __GNUC__) || (defined __CYGWIN__)
|
||||
char name[MAX_PATH];
|
||||
GetModuleFileName(NULL, name, MAX_PATH);
|
||||
QString path(name);
|
||||
path.truncate(path.lastIndexOf('\\'));
|
||||
dir.setPath(path);
|
||||
#else
|
||||
dir = SIMULATOR_LIB_SEARCH_PATH;
|
||||
#endif
|
||||
|
@ -59,7 +67,6 @@ void registerSimulators()
|
|||
simulatorsFound = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
SimulatorFactory *getSimulatorFactory(const QString &name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue