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,6 +19,7 @@ namespace BlackMisc
void CSimulatorPluginInfo::convertFromJson(const QJsonObject &json) void CSimulatorPluginInfo::convertFromJson(const QJsonObject &json)
{ {
if (json.contains("IID")) { // comes from the plugin
if (json["IID"].toString() != QStringLiteral("org.swift.pilotclient.BlackCore.SimulatorInterface")) if (json["IID"].toString() != QStringLiteral("org.swift.pilotclient.BlackCore.SimulatorInterface"))
{ {
return; return;
@@ -37,11 +38,14 @@ namespace BlackMisc
CValueObject::convertFromJson(data); CValueObject::convertFromJson(data);
m_valid = true; m_valid = true;
} else {
CValueObject::convertFromJson(json);
}
} }
bool CSimulatorPluginInfo::isUnspecified() const bool CSimulatorPluginInfo::isUnspecified() const
{ {
return m_name.isEmpty(); return m_identifier.isEmpty();
} }
QString CSimulatorPluginInfo::convertToQString(bool i18n) const QString CSimulatorPluginInfo::convertToQString(bool i18n) const

View File

@@ -1,5 +1,5 @@
{ {
"identifier" : "swift_generic_fs9", "identifier" : "org.swift-project.plugins.simulator.fs9",
"name" : "Microsoft Flight Simulator 2004", "name" : "Microsoft Flight Simulator 2004",
"simulator" : "fs9", "simulator" : "fs9",
"description" : "Microsoft Flight Simulator 2004" "description" : "Microsoft Flight Simulator 2004"

View File

@@ -1,5 +1,5 @@
{ {
"identifier" : "swift_generic_fsx", "identifier" : "org.swift-project.plugins.simulator.fsx",
"name" : "Microsoft Flight Simulator X", "name" : "Microsoft Flight Simulator X",
"simulator" : "fsx", "simulator" : "fsx",
"description" : "Microsoft Flight Simulator X (2006)" "description" : "Microsoft Flight Simulator X (2006)"

View File

@@ -1,5 +1,5 @@
{ {
"identifier" : "swift_generic_xplane", "identifier" : "org.swift-project.plugins.simulator.xplane",
"name" : "X-Plane", "name" : "X-Plane",
"simulator" : "xplane", "simulator" : "xplane",
"description" : "X-Plane support via the xbus plugin" "description" : "X-Plane support via the xbus plugin"