mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 21:56:43 +08:00
refs #917, fixed plugin ids in wizard
utility functions CSimulatorInfo -> plugin
This commit is contained in:
committed by
Mathew Sutcliffe
parent
0942d007d5
commit
0544ab0193
@@ -8,10 +8,11 @@
|
||||
*/
|
||||
|
||||
#include "blackconfig/buildconfig.h"
|
||||
#include "blackmisc/comparefunctions.h"
|
||||
#include "blackmisc/db/datastoreutility.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfo.h"
|
||||
#include "blackmisc/simulation/fscommon/fscommonutil.h"
|
||||
#include "blackmisc/simulation/simulatorinfo.h"
|
||||
#include "blackmisc/comparefunctions.h"
|
||||
#include <QJsonValue>
|
||||
#include <QtGlobal>
|
||||
#include <algorithm>
|
||||
@@ -136,7 +137,7 @@ namespace BlackMisc
|
||||
QString CSimulatorInfo::convertToQString(bool i18n) const
|
||||
{
|
||||
Q_UNUSED(i18n);
|
||||
Simulator s = getSimulator();
|
||||
const Simulator s = getSimulator();
|
||||
QString str;
|
||||
if (s.testFlag(FSX)) { str.append("FSX "); }
|
||||
if (s.testFlag(FS9)) { str.append("FS9 "); }
|
||||
@@ -161,6 +162,18 @@ namespace BlackMisc
|
||||
return set;
|
||||
}
|
||||
|
||||
const QString &CSimulatorInfo::toPluginIdentifier() const
|
||||
{
|
||||
static const QString e;
|
||||
if (!this->isSingleSimulator()) { return e; }
|
||||
const Simulator s = getSimulator();
|
||||
if (s.testFlag(FSX)) { return CSimulatorPluginInfo::fsxPluginIndentifier(); }
|
||||
if (s.testFlag(FS9)) { return CSimulatorPluginInfo::fs9PluginIndentifier(); }
|
||||
if (s.testFlag(P3D)) { return CSimulatorPluginInfo::p3dPluginIndentifier(); }
|
||||
if (s.testFlag(XPLANE)) { return CSimulatorPluginInfo::xplanePluginIndentifier(); }
|
||||
return e;
|
||||
}
|
||||
|
||||
CSimulatorInfo::Simulator CSimulatorInfo::boolToFlag(bool fsx, bool fs9, bool xp, bool p3d)
|
||||
{
|
||||
Simulator s = fsx ? FSX : None;
|
||||
@@ -188,7 +201,7 @@ namespace BlackMisc
|
||||
{
|
||||
s |= XPLANE;
|
||||
}
|
||||
if (i.contains("3d") || i.contains("prepare") || i.contains("martin") || i.contains("lm") || i.contains("lock"))
|
||||
if (i.contains("3d") || i.contains("prepar") || i.contains("martin") || i.contains("lm") || i.contains("lock"))
|
||||
{
|
||||
s |= P3D;
|
||||
}
|
||||
@@ -260,7 +273,6 @@ namespace BlackMisc
|
||||
return sim;
|
||||
}
|
||||
|
||||
|
||||
CSimulatorInfo CSimulatorInfo::fromDatabaseJson(const QJsonObject &json, const QString prefix)
|
||||
{
|
||||
const bool fsx = CDatastoreUtility::dbBoolStringToBool(json.value(prefix + "simfsx").toString());
|
||||
|
||||
Reference in New Issue
Block a user