refs #404 Added human-readable plugin names

* Added new "identifier" attribute in JSON metadata files
* "identifier" is now the one that makes plugins unique
* "name" attribute is a human-readable name
This commit is contained in:
Michał Garapich
2015-04-11 14:36:47 +02:00
parent 2b07dfb789
commit 1d5cbb7a9d
7 changed files with 23 additions and 12 deletions

View File

@@ -22,17 +22,20 @@ namespace BlackMisc
//! Describing a simulator plugin
class CSimulatorPluginInfo : public BlackMisc::CValueObject<CSimulatorPluginInfo>
{
//! The _name_ property identifies the plugin itself and must be uniqe.
Q_PROPERTY(QString getName READ getName)
//! The _identifier_ property identifies the plugin itself and must be uniqe.
Q_PROPERTY(QString identifier READ getIdentifier)
//! The _name_ property is a human-readable plugin name.
Q_PROPERTY(QString same READ getName)
//! The _simulator_ property specifies which simulator the plugin handles.
//! There cannot be two plugins loaded for the same simulator.
//! swift enables some features for particular simulators. Currently recognized are:
//! fsx, fs9, xplane
Q_PROPERTY(QString getSimulator READ getSimulator)
Q_PROPERTY(QString simulator READ getSimulator)
//! The _description_ property provides a short, human-readable description of the plugin.
Q_PROPERTY(QString getDescription READ getDescription)
Q_PROPERTY(QString description READ getDescription)
public:
//! Default constructor
@@ -52,7 +55,10 @@ namespace BlackMisc
bool isValid() const { return m_valid; }
//! Equals
bool operator==(const CSimulatorPluginInfo &other) { return getName() == other.getName(); }
bool operator==(const CSimulatorPluginInfo &other) { return getIdentifier() == other.getIdentifier(); }
//! Identifier
const QString &getIdentifier() const { return m_identifier; }
//! Name
const QString &getName() const { return m_name; }
@@ -69,6 +75,7 @@ namespace BlackMisc
private:
BLACK_ENABLE_TUPLE_CONVERSION(CSimulatorPluginInfo)
QString m_identifier;
QString m_name;
QString m_simulator;
QString m_description;
@@ -78,6 +85,7 @@ namespace BlackMisc
} // ns
BLACK_DECLARE_TUPLE_CONVERSION(BlackMisc::Simulation::CSimulatorPluginInfo, (
attr(o.m_identifier),
attr(o.m_name),
attr(o.m_simulator),
attr(o.m_description),