Ref T169, formatting

This commit is contained in:
Klaus Basan
2017-10-08 19:31:23 +02:00
committed by Mathew Sutcliffe
parent 193565e27c
commit 6ce80bbd8e
4 changed files with 46 additions and 45 deletions

View File

@@ -76,7 +76,7 @@ namespace BlackCore
const CUrlList &CGlobalSetup::getSwiftSharedUrls() const const CUrlList &CGlobalSetup::getSwiftSharedUrls() const
{ {
return this->m_sharedUrls; return m_sharedUrls;
} }
CUrl CGlobalSetup::getCorrespondingSharedUrl(const CUrl &candidate) const CUrl CGlobalSetup::getCorrespondingSharedUrl(const CUrl &candidate) const
@@ -102,7 +102,7 @@ namespace BlackCore
CUrl CGlobalSetup::getHelpPageUrl(const QString &context) const CUrl CGlobalSetup::getHelpPageUrl(const QString &context) const
{ {
const CUrlList urls(this->m_onlineHelpUrls); const CUrlList urls(m_onlineHelpUrls);
// we display in the standard browser, // we display in the standard browser,
// so the user will realize if the URL does not work // so the user will realize if the URL does not work
@@ -320,23 +320,23 @@ namespace BlackCore
const ColumnIndex i = index.frontCasted<ColumnIndex>(); const ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i) switch (i)
{ {
case IndexDbRootDirectory: return CVariant::fromValue(this->m_dbRootDirectoryUrl); case IndexDbRootDirectory: return CVariant::fromValue(m_dbRootDirectoryUrl);
case IndexDbHttpPort: return CVariant::fromValue(this->m_dbHttpPort); case IndexDbHttpPort: return CVariant::fromValue(m_dbHttpPort);
case IndexDbHttpsPort: return CVariant::fromValue(this->m_dbHttpsPort); case IndexDbHttpsPort: return CVariant::fromValue(m_dbHttpsPort);
case IndexDbLoginService: return CVariant::fromValue(this->getDbLoginServiceUrl()); case IndexDbLoginService: return CVariant::fromValue(this->getDbLoginServiceUrl());
case IndexDbClientPingService: return CVariant::fromValue(this->getDbClientPingServiceUrl()); case IndexDbClientPingService: return CVariant::fromValue(this->getDbClientPingServiceUrl());
case IndexVatsimStatus: return CVariant::fromValue(this->m_vatsimStatusFileUrls); case IndexVatsimStatus: return CVariant::fromValue(m_vatsimStatusFileUrls);
case IndexVatsimData: return CVariant::fromValue(this->m_vatsimDataFileUrls); case IndexVatsimData: return CVariant::fromValue(m_vatsimDataFileUrls);
case IndexVatsimBookings: return CVariant::fromValue(this->m_vatsimDataFileUrls); case IndexVatsimBookings: return CVariant::fromValue(m_vatsimDataFileUrls);
case IndexVatsimMetars: return CVariant::fromValue(this->m_vatsimMetarsUrls); case IndexVatsimMetars: return CVariant::fromValue(m_vatsimMetarsUrls);
case IndexBootstrapFileUrls: return CVariant::fromValue(this->getSwiftBootstrapFileUrls()); case IndexBootstrapFileUrls: return CVariant::fromValue(this->getSwiftBootstrapFileUrls());
case IndexDistributionFileUrls: return CVariant::fromValue(this->getSwiftDistributionFileUrls()); case IndexDistributionFileUrls: return CVariant::fromValue(this->getSwiftDistributionFileUrls());
case IndexSharedUrls: return CVariant::fromValue(this->m_sharedUrls); case IndexSharedUrls: return CVariant::fromValue(m_sharedUrls);
case IndexNewsUrls: return CVariant::fromValue(this->m_newsUrls); case IndexNewsUrls: return CVariant::fromValue(m_newsUrls);
case IndexSwiftMapUrls: return CVariant::fromValue(this->m_mapUrls); case IndexSwiftMapUrls: return CVariant::fromValue(m_mapUrls);
case IndexOnlineHelpUrls: return CVariant::fromValue(this->m_onlineHelpUrls); case IndexOnlineHelpUrls: return CVariant::fromValue(m_onlineHelpUrls);
case IndexCrashReportServerUrl: return CVariant::fromValue(this->m_crashReportServerUrl); case IndexCrashReportServerUrl: return CVariant::fromValue(m_crashReportServerUrl);
case IndexWasLoaded: return CVariant::fromValue(this->m_wasLoaded); case IndexWasLoaded: return CVariant::fromValue(m_wasLoaded);
default: return CValueObject::propertyByIndex(index); default: return CValueObject::propertyByIndex(index);
} }
} }
@@ -353,20 +353,20 @@ namespace BlackCore
const ColumnIndex i = index.frontCasted<ColumnIndex>(); const ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i) switch (i)
{ {
case IndexDbRootDirectory: this->m_dbRootDirectoryUrl.setPropertyByIndex(index.copyFrontRemoved(), variant); break; case IndexDbRootDirectory: m_dbRootDirectoryUrl.setPropertyByIndex(index.copyFrontRemoved(), variant); break;
case IndexDbHttpPort: this->m_dbHttpPort = variant.toInt(); break; case IndexDbHttpPort: m_dbHttpPort = variant.toInt(); break;
case IndexDbHttpsPort: this->m_dbHttpsPort = variant.toInt(); break; case IndexDbHttpsPort: m_dbHttpsPort = variant.toInt(); break;
case IndexDbLoginService: break; // cannot be changed case IndexDbLoginService: break; // cannot be changed
case IndexDbClientPingService: break; // cannot be changed case IndexDbClientPingService: break; // cannot be changed
case IndexVatsimData: this->m_vatsimDataFileUrls = variant.value<CUrlList>(); break; case IndexVatsimData: m_vatsimDataFileUrls = variant.value<CUrlList>(); break;
case IndexVatsimBookings: this->m_vatsimBookingsUrl.setPropertyByIndex(index.copyFrontRemoved(), variant); break; case IndexVatsimBookings: m_vatsimBookingsUrl.setPropertyByIndex(index.copyFrontRemoved(), variant); break;
case IndexVatsimMetars: this->m_vatsimMetarsUrls = variant.value<CUrlList>(); break; case IndexVatsimMetars: m_vatsimMetarsUrls = variant.value<CUrlList>(); break;
case IndexSharedUrls: this->m_sharedUrls = variant.value<CUrlList>(); break; case IndexSharedUrls: m_sharedUrls = variant.value<CUrlList>(); break;
case IndexNewsUrls: this->m_newsUrls = variant.value<CUrlList>(); break; case IndexNewsUrls: m_newsUrls = variant.value<CUrlList>(); break;
case IndexOnlineHelpUrls: this->m_onlineHelpUrls = variant.value<CUrlList>(); break; case IndexOnlineHelpUrls: m_onlineHelpUrls = variant.value<CUrlList>(); break;
case IndexSwiftMapUrls: this->m_mapUrls = variant.value<CUrlList>(); break; case IndexSwiftMapUrls: m_mapUrls = variant.value<CUrlList>(); break;
case IndexCrashReportServerUrl: this->m_crashReportServerUrl = variant.value<CUrl>(); break; case IndexCrashReportServerUrl: m_crashReportServerUrl = variant.value<CUrl>(); break;
case IndexWasLoaded: this->m_wasLoaded = variant.toBool(); break; case IndexWasLoaded: m_wasLoaded = variant.toBool(); break;
default: CValueObject::setPropertyByIndex(index, variant); break; default: CValueObject::setPropertyByIndex(index, variant); break;
} }
} }

View File

@@ -70,7 +70,7 @@ namespace BlackCore
bool wasLoaded() const { return m_wasLoaded; } bool wasLoaded() const { return m_wasLoaded; }
//! Mark as loaded //! Mark as loaded
void markAsLoaded(bool loaded) { this->m_wasLoaded = loaded; } void markAsLoaded(bool loaded) { m_wasLoaded = loaded; }
//! Http port //! Http port
int getDbHttpPort() const { return m_dbHttpPort; } int getDbHttpPort() const { return m_dbHttpPort; }
@@ -147,7 +147,7 @@ namespace BlackCore
const BlackMisc::Network::CUrl &getVatsimBookingsUrl() const { return m_vatsimBookingsUrl; } const BlackMisc::Network::CUrl &getVatsimBookingsUrl() const { return m_vatsimBookingsUrl; }
//! VATSIM METAR URL //! VATSIM METAR URL
const BlackMisc::Network::CUrlList &getVatsimMetarsUrls() const { return this->m_vatsimMetarsUrls; } const BlackMisc::Network::CUrlList &getVatsimMetarsUrls() const { return m_vatsimMetarsUrls; }
//! VATSIM status file URLs //! VATSIM status file URLs
const BlackMisc::Network::CUrlList &getVatsimStatusFileUrls() const { return m_vatsimStatusFileUrls; } const BlackMisc::Network::CUrlList &getVatsimStatusFileUrls() const { return m_vatsimStatusFileUrls; }
@@ -180,7 +180,7 @@ namespace BlackCore
//! \copydoc BlackMisc::Mixin::String::toQString //! \copydoc BlackMisc::Mixin::String::toQString
QString convertToQString(bool i18n = false) const; QString convertToQString(bool i18n = false) const;
//! To string //! To string with separator
QString convertToQString(const QString &separator, bool i18n = false) const; QString convertToQString(const QString &separator, bool i18n = false) const;
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex //! \copydoc BlackMisc::Mixin::Index::propertyByIndex

View File

@@ -12,6 +12,8 @@
#include "blackgui/managedstatusbar.h" #include "blackgui/managedstatusbar.h"
#include "blackgui/overlaymessagesframe.h" #include "blackgui/overlaymessagesframe.h"
using namespace BlackMisc;
namespace BlackGui namespace BlackGui
{ {
IMainWindowAccess::~IMainWindowAccess() IMainWindowAccess::~IMainWindowAccess()
@@ -22,26 +24,25 @@ namespace BlackGui
bool IMainWindowAccess::displayTextInConsole(const QString &message) bool IMainWindowAccess::displayTextInConsole(const QString &message)
{ {
if (message.isEmpty()) { return false; } if (message.isEmpty()) { return false; }
if (!this->m_mwaLogComponent) { return false; } if (!m_mwaLogComponent) { return false; }
this->m_mwaLogComponent->appendPlainTextToConsole(message); m_mwaLogComponent->appendPlainTextToConsole(message);
this->m_mwaLogComponent->displayConsole(true); m_mwaLogComponent->displayConsole(true);
return true; return true;
} }
bool IMainWindowAccess::displayInStatusBar(const BlackMisc::CStatusMessage &message) bool IMainWindowAccess::displayInStatusBar(const CStatusMessage &message)
{ {
if (message.isEmpty()) { return false; } if (message.isEmpty()) { return false; }
if (!this->m_mwaStatusBar) { return false; } if (!m_mwaStatusBar) { return false; }
this->m_mwaStatusBar->displayStatusMessage(message); m_mwaStatusBar->displayStatusMessage(message);
return true; return true;
} }
bool IMainWindowAccess::displayInOverlayWindow(const BlackMisc::CStatusMessage &message, int timeOutMs) bool IMainWindowAccess::displayInOverlayWindow(const CStatusMessage &message, int timeOutMs)
{ {
if (message.isEmpty()) { return false; } if (message.isEmpty()) { return false; }
if (!this->m_mwaOverlayFrame) { return false; } if (!m_mwaOverlayFrame) { return false; }
this->m_mwaOverlayFrame->showOverlayMessage(message, timeOutMs); m_mwaOverlayFrame->showOverlayMessage(message, timeOutMs);
return true; return true;
} }
} // ns } // ns

View File

@@ -97,9 +97,9 @@ void CSwiftData::init()
sGui->initMainApplicationWindow(this); sGui->initMainApplicationWindow(this);
this->initLogDisplay(); this->initLogDisplay();
this->m_mwaLogComponent = ui->comp_MainInfoArea->getLogComponent(); m_mwaLogComponent = ui->comp_MainInfoArea->getLogComponent();
this->m_mwaStatusBar = &this->m_statusBar; m_mwaStatusBar = &m_statusBar;
this->m_mwaOverlayFrame = ui->comp_MainInfoArea->getMappingComponent(); m_mwaOverlayFrame = ui->comp_MainInfoArea->getMappingComponent();
this->initStyleSheet(); this->initStyleSheet();
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CSwiftData::onStyleSheetsChanged); connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CSwiftData::onStyleSheetsChanged);
@@ -118,7 +118,7 @@ void CSwiftData::init()
void CSwiftData::initLogDisplay() void CSwiftData::initLogDisplay()
{ {
this->m_statusBar.initStatusBar(ui->sb_SwiftData); m_statusBar.initStatusBar(ui->sb_SwiftData);
CLogHandler::instance()->install(true); CLogHandler::instance()->install(true);
CLogHandler::instance()->enableConsoleOutput(false); // default disable CLogHandler::instance()->enableConsoleOutput(false); // default disable
@@ -147,7 +147,7 @@ void CSwiftData::initMenu()
void CSwiftData::performGracefulShutdown() void CSwiftData::performGracefulShutdown()
{ {
if (this->m_updater) if (m_updater)
{ {
m_updater->abandonAndWait(); m_updater->abandonAndWait();
} }