mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Ref T210, removed ApplicationModeFlag
This commit is contained in:
@@ -13,19 +13,30 @@
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
CApplicationInfo::CApplicationInfo() = default;
|
||||
CApplicationInfo::CApplicationInfo() {}
|
||||
|
||||
CApplicationInfo::CApplicationInfo(Application app, ApplicationMode mode, const QString &exePath, const QString &version, const CProcessInfo &process) :
|
||||
CApplicationInfo::CApplicationInfo(Application app, const QString &exePath, const QString &version, const CProcessInfo &process) :
|
||||
m_app(app),
|
||||
m_mode(mode),
|
||||
m_exePath(exePath),
|
||||
m_version(version),
|
||||
m_process(process)
|
||||
{}
|
||||
|
||||
bool CApplicationInfo::isSampleOrUnitTest() const
|
||||
{
|
||||
const Application a = this->application();
|
||||
return a == CApplicationInfo::Sample || a == CApplicationInfo::UnitTest;
|
||||
}
|
||||
|
||||
bool CApplicationInfo::isUnitTest() const
|
||||
{
|
||||
const Application a = this->application();
|
||||
return a == CApplicationInfo::UnitTest;
|
||||
}
|
||||
|
||||
QString CApplicationInfo::convertToQString(bool i18n) const
|
||||
{
|
||||
return QString("{ %1, %2, %3, %4, %5 }").arg(QString::number(m_app), QString::number(m_mode), m_exePath, m_version, m_process.convertToQString(i18n));
|
||||
return QString("{ %1, %2, %3, %4 }").arg(QString::number(m_app), m_exePath, m_version, m_process.convertToQString(i18n));
|
||||
}
|
||||
|
||||
const QString &CApplicationInfo::swiftPilotClientGui()
|
||||
|
||||
@@ -36,20 +36,11 @@ namespace BlackMisc
|
||||
Sample
|
||||
};
|
||||
|
||||
//! Flags describing application modes
|
||||
enum ApplicationModeFlag
|
||||
{
|
||||
None = 0,
|
||||
Developer = 1 << 0,
|
||||
BetaTest = 1 << 1
|
||||
};
|
||||
Q_DECLARE_FLAGS(ApplicationMode, ApplicationModeFlag)
|
||||
|
||||
//! Default constructor.
|
||||
CApplicationInfo();
|
||||
|
||||
//! Constructor.
|
||||
CApplicationInfo(Application app, ApplicationMode mode, const QString &exePath, const QString &version, const CProcessInfo &process);
|
||||
CApplicationInfo(Application app, const QString &exePath, const QString &version, const CProcessInfo &process);
|
||||
|
||||
//! Set application.
|
||||
void setApplication(Application app) { m_app = static_cast<int>(app); }
|
||||
@@ -57,12 +48,6 @@ namespace BlackMisc
|
||||
//! Get application.
|
||||
Application application() const { return static_cast<Application>(m_app); }
|
||||
|
||||
//! Set application mode.
|
||||
void setApplicationMode(ApplicationMode mode) { m_mode = static_cast<int>(mode); }
|
||||
|
||||
//! Get application mode.
|
||||
ApplicationMode applicationMode() const { return static_cast<ApplicationMode>(m_mode); }
|
||||
|
||||
//! Set executable path.
|
||||
void setExecutablePath(const QString &exePath) { m_exePath = exePath; }
|
||||
|
||||
@@ -81,6 +66,12 @@ namespace BlackMisc
|
||||
//! Get process info.
|
||||
const CProcessInfo &processInfo() const { return m_process; }
|
||||
|
||||
//! Sample or unit test
|
||||
bool isSampleOrUnitTest() const;
|
||||
|
||||
//! Unit test
|
||||
bool isUnitTest() const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
@@ -98,7 +89,6 @@ namespace BlackMisc
|
||||
|
||||
private:
|
||||
int m_app = static_cast<int>(Unknown);
|
||||
int m_mode = 0;
|
||||
QString m_exePath;
|
||||
QString m_version;
|
||||
CProcessInfo m_process;
|
||||
@@ -106,13 +96,12 @@ namespace BlackMisc
|
||||
BLACK_METACLASS(
|
||||
CApplicationInfo,
|
||||
BLACK_METAMEMBER(app),
|
||||
BLACK_METAMEMBER(mode),
|
||||
BLACK_METAMEMBER(exePath),
|
||||
BLACK_METAMEMBER(version),
|
||||
BLACK_METAMEMBER(process)
|
||||
);
|
||||
};
|
||||
}
|
||||
} // ns
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::CApplicationInfo)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user