mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
refs #438, adjusted plugin info
* removed == * auto info object * removed unused .h files
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
*/
|
||||
|
||||
#include "simulatorplugininfo.h"
|
||||
#include "blackmisc/blackmiscfreefunctions.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
|
||||
@@ -54,10 +53,21 @@ namespace BlackMisc
|
||||
return m_identifier.isEmpty();
|
||||
}
|
||||
|
||||
bool CSimulatorPluginInfo::isAuto() const
|
||||
{
|
||||
return (*this) == autoPlugin();
|
||||
}
|
||||
|
||||
QString CSimulatorPluginInfo::convertToQString(bool i18n) const
|
||||
{
|
||||
Q_UNUSED(i18n);
|
||||
return QString("%1 (%2)").arg(m_name, m_identifier);
|
||||
}
|
||||
|
||||
const CSimulatorPluginInfo &CSimulatorPluginInfo::autoPlugin()
|
||||
{
|
||||
static const CSimulatorPluginInfo p("auto", "auto", "auto", "automatic plugin selection", false);
|
||||
return p;
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#define BLACKMISC_SIMULATION_SIMULATORPLUGININFO_H
|
||||
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include "blackmisc/propertyindexvariantmap.h"
|
||||
#include "blackmisc/valueobject.h"
|
||||
|
||||
namespace BlackMisc
|
||||
@@ -60,9 +59,6 @@ namespace BlackMisc
|
||||
//! Unspecified sim is considered as invalid.
|
||||
bool isValid() const { return m_valid; }
|
||||
|
||||
//! Equals
|
||||
bool operator==(const CSimulatorPluginInfo &other) { return getIdentifier() == other.getIdentifier(); }
|
||||
|
||||
//! Identifier
|
||||
const QString &getIdentifier() const { return m_identifier; }
|
||||
|
||||
@@ -75,9 +71,15 @@ namespace BlackMisc
|
||||
//! Description
|
||||
const QString &getDescription() const { return m_description; }
|
||||
|
||||
//! Special info of type auto?
|
||||
bool isAuto() const;
|
||||
|
||||
//! \copydoc CValueObject::convertToQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
//! Info representing a entry representing automatic plugin selection
|
||||
static const CSimulatorPluginInfo &autoPlugin();
|
||||
|
||||
private:
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(CSimulatorPluginInfo)
|
||||
QString m_identifier;
|
||||
@@ -90,11 +92,11 @@ 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),
|
||||
attr(o.m_valid)
|
||||
attr(o.m_identifier, flags <CaseInsensitiveComparison> ()),
|
||||
attr(o.m_name, flags < DisabledForComparison | DisabledForHashing > ()),
|
||||
attr(o.m_simulator, flags < DisabledForComparison | DisabledForHashing > ()),
|
||||
attr(o.m_description, flags < DisabledForComparison | DisabledForHashing > ()),
|
||||
attr(o.m_valid, flags < DisabledForComparison | DisabledForHashing > ())
|
||||
))
|
||||
Q_DECLARE_METATYPE(BlackMisc::Simulation::CSimulatorPluginInfo)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user