mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
refs #921, adjusted application class to use distribution info
This commit is contained in:
committed by
Mathew Sutcliffe
parent
d1a72f8d62
commit
09a71feef4
@@ -66,6 +66,7 @@
|
||||
|
||||
using namespace BlackConfig;
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Db;
|
||||
using namespace BlackMisc::Network;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::Simulation;
|
||||
@@ -144,7 +145,7 @@ namespace BlackCore
|
||||
sApp = this;
|
||||
this->m_setupReader.reset(new CSetupReader(this));
|
||||
connect(this->m_setupReader.data(), &CSetupReader::setupHandlingCompleted, this, &CApplication::ps_setupHandlingCompleted);
|
||||
connect(this->m_setupReader.data(), &CSetupReader::updateInfoAvailable, this, &CApplication::updateInfoAvailable);
|
||||
connect(this->m_setupReader.data(), &CSetupReader::distributionInfoAvailable, this, &CApplication::distributionInfoAvailable);
|
||||
|
||||
this->m_parser.addOptions(this->m_setupReader->getCmdLineOptions());
|
||||
|
||||
@@ -285,12 +286,12 @@ namespace BlackCore
|
||||
return r->getSetup();
|
||||
}
|
||||
|
||||
CUpdateInfo CApplication::getUpdateInfo() const
|
||||
CDistributionList CApplication::getDistributionInfo() const
|
||||
{
|
||||
if (this->m_shutdown) { return CUpdateInfo(); }
|
||||
if (this->m_shutdown) { return CDistributionList(); }
|
||||
const CSetupReader *r = this->m_setupReader.data();
|
||||
if (!r) { return CUpdateInfo(); }
|
||||
return r->getUpdateInfo();
|
||||
if (!r) { return CDistributionList(); }
|
||||
return r->getDistributionInfo();
|
||||
}
|
||||
|
||||
bool CApplication::start()
|
||||
@@ -419,29 +420,29 @@ namespace BlackCore
|
||||
return CThreadUtils::isCurrentThreadApplicationThread();
|
||||
}
|
||||
|
||||
const QString &CApplication::versionStringDevBetaInfo() const
|
||||
const QString &CApplication::versionStringDetailed() const
|
||||
{
|
||||
if (isRunningInDeveloperEnvironment() && CBuildConfig::isBetaTest())
|
||||
if (isRunningInDeveloperEnvironment() && CBuildConfig::isDevBranch())
|
||||
{
|
||||
static const QString s(CVersion::version() + " [DEV, BETA]");
|
||||
static const QString s(CBuildConfig::getVersionString() + " [dev,DEV]");
|
||||
return s;
|
||||
}
|
||||
if (isRunningInDeveloperEnvironment())
|
||||
{
|
||||
static const QString s(CVersion::version() + " [DEV]");
|
||||
static const QString s(CBuildConfig::getVersionString() + " [dev]");
|
||||
return s;
|
||||
}
|
||||
if (CBuildConfig::isBetaTest())
|
||||
if (CBuildConfig::isDevBranch())
|
||||
{
|
||||
static const QString s(CVersion::version() + " [BETA]");
|
||||
static const QString s(CBuildConfig::getVersionString() + " [DEV]");
|
||||
return s;
|
||||
}
|
||||
return CVersion::version();
|
||||
return CBuildConfig::getVersionString();
|
||||
}
|
||||
|
||||
const QString &CApplication::swiftVersionString() const
|
||||
{
|
||||
static const QString s(QString("swift %1").arg(versionStringDevBetaInfo()));
|
||||
static const QString s(QString("swift %1").arg(versionStringDetailed()));
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,15 +29,13 @@
|
||||
#include "blackcore/cookiemanager.h"
|
||||
#include "blackcore/corefacadeconfig.h"
|
||||
#include "blackcore/data/globalsetup.h"
|
||||
#include "blackcore/data/updateinfo.h"
|
||||
#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/db/distributionlist.h"
|
||||
#include "blackmisc/network/urllist.h"
|
||||
#include "blackmisc/slot.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
#include "blackmisc/applicationinfolist.h"
|
||||
#include "blackmisc/statusmessagelist.h"
|
||||
|
||||
#if defined(Q_CC_MSVC) || defined(Q_OS_OSX) // Crashpad only supported on MSVC and MacOS/X
|
||||
@@ -150,9 +148,9 @@ namespace BlackCore
|
||||
//! \threadsafe
|
||||
BlackCore::Data::CGlobalSetup getGlobalSetup() const;
|
||||
|
||||
//! Update info
|
||||
//! Distributions
|
||||
//! \threadsafe
|
||||
BlackCore::Data::CUpdateInfo getUpdateInfo() const;
|
||||
BlackMisc::Db::CDistributionList getDistributionInfo() const;
|
||||
|
||||
//! Delete all cookies from cookier manager
|
||||
void deleteAllCookies();
|
||||
@@ -176,7 +174,7 @@ namespace BlackCore
|
||||
bool isApplicationThread() const;
|
||||
|
||||
//! String with beta, dev. and version
|
||||
const QString &versionStringDevBetaInfo() const;
|
||||
const QString &versionStringDetailed() const;
|
||||
|
||||
//! swift info string
|
||||
const QString &swiftVersionString() const;
|
||||
@@ -375,7 +373,7 @@ namespace BlackCore
|
||||
void setupHandlingCompleted(bool success);
|
||||
|
||||
//! Update info available (cache, web load)
|
||||
void updateInfoAvailable(bool success);
|
||||
void distributionInfoAvailable(bool success);
|
||||
|
||||
//! Startup has been completed
|
||||
//! \remark needs to be triggered by application when it think it is done
|
||||
|
||||
Reference in New Issue
Block a user