From 3edacafcf11074e6f754d6d9240522ac2a08531b Mon Sep 17 00:00:00 2001 From: Andre Bernet Date: Sun, 15 Mar 2015 01:20:29 +0400 Subject: [PATCH] Fix detection of other language simulators --- companion/src/simulation/simulatorinterface.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/companion/src/simulation/simulatorinterface.cpp b/companion/src/simulation/simulatorinterface.cpp index d70a691c6..4c767f900 100644 --- a/companion/src/simulation/simulatorinterface.cpp +++ b/companion/src/simulation/simulatorinterface.cpp @@ -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; }