From 63fbeecc006178d6d630fe5717743b973f9c49d0 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Sat, 18 Nov 2017 18:39:56 +0100 Subject: [PATCH] Ref T192, formatting and minor tweaks --- samples/blackmiscdbus/servicetool.cpp | 2 +- src/blackcore/context/contextnetwork.cpp | 6 ++++-- src/blackcore/context/contextownaircraft.cpp | 4 ++-- src/blackcore/corefacade.h | 7 +++---- src/blackgui/components/infobarstatuscomponent.cpp | 2 +- src/blackgui/components/logincomponent.h | 11 +++++------ src/blackgui/components/mainkeypadareacomponent.cpp | 3 ++- src/blackgui/stylesheetutility.cpp | 6 +++--- src/blackgui/stylesheetutility.h | 7 +++---- src/swiftguistandard/main.cpp | 2 +- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/samples/blackmiscdbus/servicetool.cpp b/samples/blackmiscdbus/servicetool.cpp index d71ce3f77..0727d4575 100644 --- a/samples/blackmiscdbus/servicetool.cpp +++ b/samples/blackmiscdbus/servicetool.cpp @@ -101,7 +101,7 @@ namespace BlackSample // The << operator is used to add the parameters for the slot const QDateTime dtnow = QDateTime::currentDateTimeUtc(); - const QString msg = QString("Message at %1").arg(dtnow.toString("MM/dd/yyyy @ hh:mm:ss")); + const QString msg = QString("Con.: %1, message at %2").arg(connection.name(), dtnow.toString("MM/dd/yyyy @ hh:mm:ss")); m << msg; // We send this as a non-replying message. This is used for sending errors, replys, signals. diff --git a/src/blackcore/context/contextnetwork.cpp b/src/blackcore/context/contextnetwork.cpp index 7f676b4a9..131a00191 100644 --- a/src/blackcore/context/contextnetwork.cpp +++ b/src/blackcore/context/contextnetwork.cpp @@ -14,11 +14,13 @@ #include "blackmisc/dbusserver.h" using namespace BlackCore; +using namespace BlackMisc; + namespace BlackCore { namespace Context { - IContextNetwork *IContextNetwork::create(CCoreFacade *runtime, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &connection) + IContextNetwork *IContextNetwork::create(CCoreFacade *runtime, CCoreFacadeConfig::ContextMode mode, CDBusServer *server, QDBusConnection &connection) { switch (mode) { @@ -26,7 +28,7 @@ namespace BlackCore case CCoreFacadeConfig::LocalInDBusServer: return (new CContextNetwork(mode, runtime))->registerWithDBus(server); case CCoreFacadeConfig::Remote: - return new CContextNetworkProxy(BlackMisc::CDBusServer::coreServiceName(), connection, mode, runtime); + return new CContextNetworkProxy(CDBusServer::coreServiceName(), connection, mode, runtime); case CCoreFacadeConfig::NotUsed: default: return new CContextNetworkEmpty(runtime); diff --git a/src/blackcore/context/contextownaircraft.cpp b/src/blackcore/context/contextownaircraft.cpp index 3f29b3a1e..57b53be1f 100644 --- a/src/blackcore/context/contextownaircraft.cpp +++ b/src/blackcore/context/contextownaircraft.cpp @@ -40,7 +40,7 @@ namespace BlackCore } } - const BlackMisc::Aviation::CAircraftSituation &IContextOwnAircraft::getDefaultSituation() + const CAircraftSituation &IContextOwnAircraft::getDefaultSituation() { static const CAircraftSituation situation( CCoordinateGeodetic( @@ -52,7 +52,7 @@ namespace BlackCore return situation; } - BlackMisc::Simulation::CAircraftModel IContextOwnAircraft::getDefaultOwnAircraftModel() + CAircraftModel IContextOwnAircraft::getDefaultOwnAircraftModel() { // if all fails static const CAircraftModel defaultModel( diff --git a/src/blackcore/corefacade.h b/src/blackcore/corefacade.h index 2fe9bf4ea..8bf131806 100644 --- a/src/blackcore/corefacade.h +++ b/src/blackcore/corefacade.h @@ -75,6 +75,9 @@ namespace BlackCore //! Facade and context shutting down bool isShuttingDown() const { return m_shuttingDown; } + //! Parse command line in all contexts + bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator); + // ------- Context as interface, normal way to access a context //! Context for network @@ -158,10 +161,6 @@ namespace BlackCore //! Register metadata static void registerMetadata(); - public slots: - //! Parse command line in all contexts - bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator); - private: bool m_initalized = false; //!< flag if already initialized bool m_shuttingDown = false; //!< flag if shutting down diff --git a/src/blackgui/components/infobarstatuscomponent.cpp b/src/blackgui/components/infobarstatuscomponent.cpp index 4966ea160..e8a01e90a 100644 --- a/src/blackgui/components/infobarstatuscomponent.cpp +++ b/src/blackgui/components/infobarstatuscomponent.cpp @@ -86,7 +86,7 @@ namespace BlackGui ui->led_DBus->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "DBus connected", "DBus disconnected", 14); ui->led_Network->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "Network connected", "Network disconnected", 14); ui->led_Simulator->setValues(CLedWidget::Yellow, CLedWidget::Black, CLedWidget::Blue, shape, "Simulator running", "Simulator disconnected", "Simulator connected", 14); - ui->led_MapperReady->setValues(CLedWidget::Yellow, CLedWidget::Black, CLedWidget::Blue, shape, "Mapper ready", "Mappings loading", "Mappings loading", 14); + ui->led_MapperReady->setValues(CLedWidget::Yellow, CLedWidget::Black, CLedWidget::Blue, shape, "Mapper ready", "Mappings not yet loaded", "Mappings not yet loaded", 14); shape = CLedWidget::Rounded; ui->led_Ptt->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "Ptt", "Silence", 18); diff --git a/src/blackgui/components/logincomponent.h b/src/blackgui/components/logincomponent.h index 841cdd68e..e0f8a0a16 100644 --- a/src/blackgui/components/logincomponent.h +++ b/src/blackgui/components/logincomponent.h @@ -63,11 +63,14 @@ namespace BlackGui //! Constructor explicit CLoginComponent(QWidget *parent = nullptr); + //! Destructor + virtual ~CLoginComponent(); + //! Automatically popup void setAutoPopupWizad(bool autoPopup); - //! Destructor - virtual ~CLoginComponent(); + //! Main info area changed + void mainInfoAreaChanged(const QWidget *currentWidget); signals: //! Login @@ -82,10 +85,6 @@ namespace BlackGui //! Relevant login data changed (digest version) void loginDataChangedDigest(); - public slots: - //! Main info area changed - void mainInfoAreaChanged(const QWidget *currentWidget); - private: //! Login cancelled void loginCancelled(); diff --git a/src/blackgui/components/mainkeypadareacomponent.cpp b/src/blackgui/components/mainkeypadareacomponent.cpp index cacfaf0d1..cea7e3d2f 100644 --- a/src/blackgui/components/mainkeypadareacomponent.cpp +++ b/src/blackgui/components/mainkeypadareacomponent.cpp @@ -101,7 +101,8 @@ namespace BlackGui void CMainKeypadAreaComponent::buttonSelected() { QPushButton *senderButton = static_cast(QObject::sender()); - Q_ASSERT(senderButton); + Q_ASSERT_X(senderButton, Q_FUNC_INFO, "No sender button"); + Q_ASSERT_X(sGui, Q_FUNC_INFO, "Need sGui"); if (!senderButton) { return; } const CMainInfoAreaComponent::InfoArea ia = buttonToMainInfoArea(senderButton); if (ia != CMainInfoAreaComponent::InfoAreaNone) diff --git a/src/blackgui/stylesheetutility.cpp b/src/blackgui/stylesheetutility.cpp index 75cb98a3f..58411f952 100644 --- a/src/blackgui/stylesheetutility.cpp +++ b/src/blackgui/stylesheetutility.cpp @@ -37,8 +37,8 @@ namespace BlackGui CStyleSheetUtility::CStyleSheetUtility(BlackMisc::Restricted, QObject *parent) : QObject(parent) { this->read(); - connect(&this->m_fileWatcher, &QFileSystemWatcher::directoryChanged, this, &CStyleSheetUtility::ps_qssDirectoryChanged); - connect(&this->m_fileWatcher, &QFileSystemWatcher::fileChanged, this, &CStyleSheetUtility::ps_qssDirectoryChanged); + connect(&this->m_fileWatcher, &QFileSystemWatcher::directoryChanged, this, &CStyleSheetUtility::qssDirectoryChanged); + connect(&this->m_fileWatcher, &QFileSystemWatcher::fileChanged, this, &CStyleSheetUtility::qssDirectoryChanged); } const QString &CStyleSheetUtility::fontStyleAsString(const QFont &font) @@ -465,7 +465,7 @@ namespace BlackGui } } - void CStyleSheetUtility::ps_qssDirectoryChanged(const QString &file) + void CStyleSheetUtility::qssDirectoryChanged(const QString &file) { Q_UNUSED(file); this->read(); diff --git a/src/blackgui/stylesheetutility.h b/src/blackgui/stylesheetutility.h index 882902b54..df694e2a2 100644 --- a/src/blackgui/stylesheetutility.h +++ b/src/blackgui/stylesheetutility.h @@ -162,11 +162,10 @@ namespace BlackGui //! \deprecated use BlackGui::CGuiApplication::styleSheetsChanged void styleSheetsChanged(); - private slots: - //! File changed - void ps_qssDirectoryChanged(const QString &file); - private: + //! File changed + void qssDirectoryChanged(const QString &file); + //! Filename based on OS/existing files static QString getQssFileName(const QString &fileName); diff --git a/src/swiftguistandard/main.cpp b/src/swiftguistandard/main.cpp index afd116b29..576444d37 100644 --- a/src/swiftguistandard/main.cpp +++ b/src/swiftguistandard/main.cpp @@ -26,7 +26,7 @@ int main(int argc, char *argv[]) CGuiApplication::highDpiScreenSupport(); QApplication qa(argc, argv); Q_UNUSED(qa); // application init needed - CSwiftGuiStdApplication a; + CSwiftGuiStdApplication a; // application with contexts a.setSignalStartupAutomatically(false); // application will signal startup on its own a.splashScreen(CIcons::swift256()); if (!a.parseAndSynchronizeSetup()) { return EXIT_FAILURE; }