mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
refs #777 Moved enum CApplication::SwiftApplication to CApplicationInfo::Application.
This commit is contained in:
committed by
Klaus Basan
parent
d1c2c96c31
commit
cf9b6f039c
@@ -76,7 +76,7 @@ BlackCore::CApplication *sApp = nullptr; // set by constructor
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
CApplication::CApplication(const QString &applicationName, SwiftApplication application, bool init) :
|
||||
CApplication::CApplication(const QString &applicationName, CApplicationInfo::Application application, bool init) :
|
||||
m_cookieManager( {}, this), m_applicationName(applicationName), m_application(application), m_coreFacadeConfig(CCoreFacadeConfig::allEmpty())
|
||||
{
|
||||
Q_ASSERT_X(!sApp, Q_FUNC_INFO, "already initialized");
|
||||
@@ -155,19 +155,19 @@ namespace BlackCore
|
||||
return s;
|
||||
}
|
||||
|
||||
CApplication::SwiftApplication CApplication::getSwiftApplication() const
|
||||
CApplicationInfo::Application CApplication::getSwiftApplication() const
|
||||
{
|
||||
if (this->isUnitTest()) { return UnitTest; }
|
||||
if (this->m_application != Unknown) { return this->m_application; }
|
||||
if (this->isUnitTest()) { return CApplicationInfo::UnitTest; }
|
||||
if (this->m_application != CApplicationInfo::Unknown) { return this->m_application; }
|
||||
|
||||
// if not set, guess
|
||||
BLACK_VERIFY_X(false, Q_FUNC_INFO, "Missing application");
|
||||
const QString a(QCoreApplication::instance()->applicationName().toLower());
|
||||
if (a.contains("core")) { return PilotClientCore; }
|
||||
if (a.contains("launcher")) { return Laucher; }
|
||||
if (a.contains("gui")) { return PilotClientGui; }
|
||||
if (a.contains("core")) { return PilotClientCore; }
|
||||
return Unknown;
|
||||
if (a.contains("core")) { return CApplicationInfo::PilotClientCore; }
|
||||
if (a.contains("launcher")) { return CApplicationInfo::Laucher; }
|
||||
if (a.contains("gui")) { return CApplicationInfo::PilotClientGui; }
|
||||
if (a.contains("core")) { return CApplicationInfo::PilotClientCore; }
|
||||
return CApplicationInfo::Unknown;
|
||||
}
|
||||
|
||||
bool CApplication::isUnitTest() const
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "blackcore/db/databasereaderconfig.h"
|
||||
#include "blackcore/application/applicationsettings.h"
|
||||
#include "blackcore/webreaderflags.h"
|
||||
#include "blackmisc/applicationinfolist.h"
|
||||
#include "blackmisc/network/url.h"
|
||||
#include "blackmisc/network/urllist.h"
|
||||
#include "blackmisc/slot.h"
|
||||
@@ -95,17 +96,6 @@ namespace BlackCore
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Shich swift application is running?
|
||||
enum SwiftApplication
|
||||
{
|
||||
Unknown,
|
||||
Laucher,
|
||||
PilotClientCore,
|
||||
PilotClientGui,
|
||||
MappingTool,
|
||||
UnitTest
|
||||
};
|
||||
|
||||
//! Similar to \sa QCoreApplication::instance() returns the single instance
|
||||
static CApplication *instance();
|
||||
|
||||
@@ -113,7 +103,7 @@ namespace BlackCore
|
||||
static const BlackMisc::CLogCategoryList &getLogCategories();
|
||||
|
||||
//! Constructor
|
||||
CApplication(const QString &applicationName = executable(), SwiftApplication application = Unknown, bool init = true);
|
||||
CApplication(const QString &applicationName = executable(), BlackMisc::CApplicationInfo::Application application = BlackMisc::CApplicationInfo::Unknown, bool init = true);
|
||||
|
||||
//! Destructor
|
||||
virtual ~CApplication();
|
||||
@@ -125,7 +115,7 @@ namespace BlackCore
|
||||
const QString &getApplicationNameVersionBetaDev() const;
|
||||
|
||||
//! swift application running
|
||||
SwiftApplication getSwiftApplication() const;
|
||||
BlackMisc::CApplicationInfo::Application getSwiftApplication() const;
|
||||
|
||||
//! Unit test?
|
||||
bool isUnitTest() const;
|
||||
@@ -442,7 +432,7 @@ namespace BlackCore
|
||||
QNetworkAccessManager m_accessManager { this }; //!< single network access manager
|
||||
CCookieManager m_cookieManager; //!< single cookie manager for our access manager
|
||||
QString m_applicationName; //!< application name
|
||||
SwiftApplication m_application = Unknown; //!< Application if specified
|
||||
BlackMisc::CApplicationInfo::Application m_application = BlackMisc::CApplicationInfo::Unknown; //!< Application if specified
|
||||
QReadWriteLock m_accessManagerLock; //!< lock to make access manager access threadsafe
|
||||
CCoreFacadeConfig m_coreFacadeConfig; //!< Core facade config if any
|
||||
CWebReaderFlags::WebReader m_webReadersUsed; //!< Readers to be used
|
||||
|
||||
Reference in New Issue
Block a user