mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-15 09:15:34 +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);
|
IContextSettings::SettingsType settingsType = static_cast<IContextSettings::SettingsType>(type);
|
||||||
if (settingsType == IContextSettings::SettingsSimulator)
|
if (settingsType == IContextSettings::SettingsSimulator)
|
||||||
{
|
{
|
||||||
CSimulatorInfo driver = this->getIContextSettings()->getSimulatorSettings().getSelectedPlugin();
|
CSimulatorInfo plugin = this->getIContextSettings()->getSimulatorSettings().getSelectedPlugin();
|
||||||
if (this->loadSimulatorPlugin(driver))
|
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));
|
this->getRuntime()->sendStatusMessage(CStatusMessage::getInfoMessage(m, CStatusMessage::TypeSimulator));
|
||||||
}
|
}
|
||||||
else
|
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));
|
this->getRuntime()->sendStatusMessage(CStatusMessage::getErrorMessage(m, CStatusMessage::TypeSimulator));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -309,7 +314,9 @@ namespace BlackCore
|
|||||||
m_pluginsDir = QDir(path);
|
m_pluginsDir = QDir(path);
|
||||||
if (!m_pluginsDir.exists())
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -333,7 +340,9 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
else
|
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";
|
qDebug() << "Also check if required dll/libs of plugin exists";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,12 @@ namespace BlackSim
|
|||||||
this->m_simsetup = setup;
|
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
|
QString CSimulatorInfo::convertToQString(bool i18n) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(i18n);
|
Q_UNUSED(i18n);
|
||||||
|
|||||||
@@ -46,6 +46,9 @@ namespace BlackSim
|
|||||||
//! Short name
|
//! Short name
|
||||||
const QString &getFullName() const { return m_fullName; }
|
const QString &getFullName() const { return m_fullName; }
|
||||||
|
|
||||||
|
//! Compare on names only, ignore setup
|
||||||
|
bool isSameSimulator(const CSimulatorInfo &otherSimulator) const;
|
||||||
|
|
||||||
//! \copydoc CValueObject::toJson
|
//! \copydoc CValueObject::toJson
|
||||||
virtual QJsonObject toJson() const override;
|
virtual QJsonObject toJson() const override;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user