mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 23:45:35 +08:00
comparing just on name, used with plugin checks
This commit is contained in:
@@ -289,15 +289,20 @@ namespace BlackCore
|
||||
IContextSettings::SettingsType settingsType = static_cast<IContextSettings::SettingsType>(type);
|
||||
if (settingsType == IContextSettings::SettingsSimulator)
|
||||
{
|
||||
CSimulatorInfo driver = this->getIContextSettings()->getSimulatorSettings().getSelectedPlugin();
|
||||
if (this->loadSimulatorPlugin(driver))
|
||||
CSimulatorInfo plugin = this->getIContextSettings()->getSimulatorSettings().getSelectedPlugin();
|
||||
if (this->getSimulatorInfo().isSameSimulator(plugin))
|
||||
{
|
||||
QString m = QString("Driver loaded: '%1'").arg(driver.toQString(true));
|
||||
// nothing to do
|
||||
return;
|
||||
}
|
||||
else if (this->loadSimulatorPlugin(plugin))
|
||||
{
|
||||
QString m = QString("Plugin loaded: '%1'").arg(plugin.toQString(true));
|
||||
this->getRuntime()->sendStatusMessage(CStatusMessage::getInfoMessage(m, CStatusMessage::TypeSimulator));
|
||||
}
|
||||
else
|
||||
{
|
||||
QString m = QString("Cannot load driver: '%1'").arg(driver.toQString(true));
|
||||
QString m = QString("Cannot load driver: '%1'").arg(plugin.toQString(true));
|
||||
this->getRuntime()->sendStatusMessage(CStatusMessage::getErrorMessage(m, CStatusMessage::TypeSimulator));
|
||||
}
|
||||
}
|
||||
@@ -309,7 +314,9 @@ namespace BlackCore
|
||||
m_pluginsDir = QDir(path);
|
||||
if (!m_pluginsDir.exists())
|
||||
{
|
||||
qWarning() << "No plugin directory" << m_pluginsDir.currentPath();
|
||||
QString m = QString("No plugin directory: %1").arg(m_pluginsDir.currentPath());
|
||||
qWarning() << m;
|
||||
this->getRuntime()->sendStatusMessage(CStatusMessage::getErrorMessage(m, CStatusMessage::TypeSimulator));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -333,7 +340,9 @@ namespace BlackCore
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << loader.errorString();
|
||||
QString m = loader.errorString();
|
||||
this->getRuntime()->sendStatusMessage(CStatusMessage::getErrorMessage(m, CStatusMessage::TypeSimulator));
|
||||
qDebug() << m;
|
||||
qDebug() << "Also check if required dll/libs of plugin exists";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,12 @@ namespace BlackSim
|
||||
this->m_simsetup = setup;
|
||||
}
|
||||
|
||||
bool CSimulatorInfo::isSameSimulator(const CSimulatorInfo &otherSimulator) const
|
||||
{
|
||||
return this->getFullName() == otherSimulator.getFullName() &&
|
||||
this->getShortName() == otherSimulator.getShortName();
|
||||
}
|
||||
|
||||
QString CSimulatorInfo::convertToQString(bool i18n) const
|
||||
{
|
||||
Q_UNUSED(i18n);
|
||||
|
||||
@@ -46,6 +46,9 @@ namespace BlackSim
|
||||
//! Short name
|
||||
const QString &getFullName() const { return m_fullName; }
|
||||
|
||||
//! Compare on names only, ignore setup
|
||||
bool isSameSimulator(const CSimulatorInfo &otherSimulator) const;
|
||||
|
||||
//! \copydoc CValueObject::toJson
|
||||
virtual QJsonObject toJson() const override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user