refs #404 Use domain-based identifiers for plugins

* Changed all plugin identifier to org.swift-project.plugins.simulator.*
* Fixed a small bug that caused settings be parsed wrong
This commit is contained in:
Michał Garapich
2015-04-13 00:57:07 +02:00
parent 1d5cbb7a9d
commit f9de3ad409
4 changed files with 23 additions and 19 deletions

View File

@@ -19,29 +19,33 @@ namespace BlackMisc
void CSimulatorPluginInfo::convertFromJson(const QJsonObject &json)
{
if (json["IID"].toString() != QStringLiteral("org.swift.pilotclient.BlackCore.SimulatorInterface"))
{
return;
}
if (json.contains("IID")) { // comes from the plugin
if (json["IID"].toString() != QStringLiteral("org.swift.pilotclient.BlackCore.SimulatorInterface"))
{
return;
}
if (!json["MetaData"].isObject())
{
return;
}
if (!json["MetaData"].isObject())
{
return;
}
QJsonObject data = json["MetaData"].toObject();
if (data.value("identifier").isUndefined() || data.value("simulator").isUndefined())
{
return;
}
QJsonObject data = json["MetaData"].toObject();
if (data.value("identifier").isUndefined() || data.value("simulator").isUndefined())
{
return;
}
CValueObject::convertFromJson(data);
m_valid = true;
CValueObject::convertFromJson(data);
m_valid = true;
} else {
CValueObject::convertFromJson(json);
}
}
bool CSimulatorPluginInfo::isUnspecified() const
{
return m_name.isEmpty();
return m_identifier.isEmpty();
}
QString CSimulatorPluginInfo::convertToQString(bool i18n) const