mirror of
https://github.com/EdgeTX/edgetx.git
synced 2025-07-19 22:35:10 +03:00
Fix detection of other language simulators
This commit is contained in:
parent
07bbcce093
commit
3edacafcf1
1 changed files with 9 additions and 8 deletions
|
@ -46,15 +46,16 @@ SimulatorFactory *getSimulatorFactory(const QString &name)
|
|||
QString simuName = name;
|
||||
while(1) {
|
||||
qDebug() << "searching" << simuName << "simulator";
|
||||
if (registered_simulators.contains(simuName)) {
|
||||
return registered_simulators[simuName];
|
||||
}
|
||||
else {
|
||||
int pos = simuName.lastIndexOf('-');
|
||||
if (pos <= 0)
|
||||
break;
|
||||
simuName = simuName.mid(0, pos);
|
||||
foreach (QString name, registered_simulators.keys()) {
|
||||
if (name.contains(simuName)) {
|
||||
simuName = name;
|
||||
return registered_simulators[simuName];
|
||||
}
|
||||
}
|
||||
int pos = simuName.lastIndexOf('-');
|
||||
if (pos <= 0)
|
||||
break;
|
||||
simuName = simuName.mid(0, pos);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue