From 1e85842c71497c3fd0bb84282a2dde64326d2112 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Thu, 29 Dec 2016 00:39:09 +0100 Subject: [PATCH] Some minor fixes (typos, doxygen, etc.) found during #846 --- src/blackcore/corefacadeconfig.cpp | 4 ++-- src/blackgui/components/aircraftpartshistory.cpp | 1 - src/blackgui/components/registercomponent.cpp | 4 ++-- src/blackgui/components/registercomponent.h | 2 +- src/swiftcore/main.cpp | 7 ++++++- src/swiftcore/swiftcore.h | 2 +- src/swiftdata/main.cpp | 1 + 7 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/blackcore/corefacadeconfig.cpp b/src/blackcore/corefacadeconfig.cpp index c3d3693f6..4cd31d96b 100644 --- a/src/blackcore/corefacadeconfig.cpp +++ b/src/blackcore/corefacadeconfig.cpp @@ -35,13 +35,13 @@ namespace BlackCore CCoreFacadeConfig CCoreFacadeConfig::forCoreAllLocalInDBus(const QString &dbusBootstrapAddress) { - const CCoreFacadeConfig cfg = CCoreFacadeConfig(CCoreFacadeConfig(CCoreFacadeConfig::LocalInDbusServer, dbusBootstrapAddress)); + const CCoreFacadeConfig cfg(CCoreFacadeConfig::LocalInDbusServer, dbusBootstrapAddress); return cfg; } CCoreFacadeConfig CCoreFacadeConfig::forCoreAllLocalInDBusNoAudio(const QString &dbusBootstrapAddress) { - CCoreFacadeConfig cfg = CCoreFacadeConfig(CCoreFacadeConfig(CCoreFacadeConfig::LocalInDbusServer, dbusBootstrapAddress)); + CCoreFacadeConfig cfg(CCoreFacadeConfig::LocalInDbusServer, dbusBootstrapAddress); cfg.m_audio = CCoreFacadeConfig::NotUsed; return cfg; } diff --git a/src/blackgui/components/aircraftpartshistory.cpp b/src/blackgui/components/aircraftpartshistory.cpp index d7dcdf7e6..e0b14f06c 100644 --- a/src/blackgui/components/aircraftpartshistory.cpp +++ b/src/blackgui/components/aircraftpartshistory.cpp @@ -112,7 +112,6 @@ namespace BlackGui const auto currentAircraftParts = sGui->getIContextNetwork()->getRemoteAircraftParts(cs, -1).frontOrDefault(); const auto aircraftPartsHistory = sGui->getIContextNetwork()->getAircraftPartsHistory(cs); - QString html; if (currentAircraftParts == CAircraftParts() && aircraftPartsHistory.isEmpty()) { diff --git a/src/blackgui/components/registercomponent.cpp b/src/blackgui/components/registercomponent.cpp index abb269c2e..d05432966 100644 --- a/src/blackgui/components/registercomponent.cpp +++ b/src/blackgui/components/registercomponent.cpp @@ -40,8 +40,8 @@ namespace BlackGui void CRegisterComponent::ps_update() { - if (!sGui) { return; } - Q_ASSERT_X(sGui->supportsContexts(), Q_FUNC_INFO, "Application does not support contexts"); + // if not supported, do nothing + if (!sGui || !sGui->supportsContexts()) { return; } ui->tvp_RegisteredComponents->updateContainer(sGui->getIContextApplication()->getRegisteredApplications()); } } // ns diff --git a/src/blackgui/components/registercomponent.h b/src/blackgui/components/registercomponent.h index 74a73ed0b..24439ea5e 100644 --- a/src/blackgui/components/registercomponent.h +++ b/src/blackgui/components/registercomponent.h @@ -36,7 +36,7 @@ namespace BlackGui explicit CRegisterComponent(QWidget *parent = nullptr); //! Destructor - ~CRegisterComponent(); + virtual ~CRegisterComponent(); private slots: //! Update data diff --git a/src/swiftcore/main.cpp b/src/swiftcore/main.cpp index 9b471b76f..ba999b771 100644 --- a/src/swiftcore/main.cpp +++ b/src/swiftcore/main.cpp @@ -27,6 +27,7 @@ int main(int argc, char *argv[]) //! [SwiftApplicationDemo] CGuiApplication::highDpiScreenSupport(); QApplication qa(argc, argv); + Q_UNUSED(qa); // init of qa is required, but qa not used CGuiApplication a("swift core", CApplicationInfo::PilotClientCore, CIcons::swiftCore24()); a.addWindowStateOption(); a.addDBusAddressOption(); @@ -39,7 +40,11 @@ int main(int argc, char *argv[]) a.useContexts(a.isParserOptionSet("coreaudio") ? CCoreFacadeConfig::forCoreAllLocalInDBus(dBusAdress) : CCoreFacadeConfig::forCoreAllLocalInDBusNoAudio(dBusAdress)); - a.start(); + if (!a.start()) + { + a.gracefulShutdown(); + return EXIT_FAILURE; + } //! [SwiftApplicationDemo] if (!QSystemTrayIcon::isSystemTrayAvailable()) diff --git a/src/swiftcore/swiftcore.h b/src/swiftcore/swiftcore.h index c6422e327..f90c067ea 100644 --- a/src/swiftcore/swiftcore.h +++ b/src/swiftcore/swiftcore.h @@ -41,7 +41,7 @@ public: CSwiftCore(QWidget *parent = nullptr); //! Destructor - ~CSwiftCore(); + virtual ~CSwiftCore(); private slots: //! \name PushButton slots diff --git a/src/swiftdata/main.cpp b/src/swiftdata/main.cpp index 0140765d3..cf45b6b8a 100644 --- a/src/swiftdata/main.cpp +++ b/src/swiftdata/main.cpp @@ -29,6 +29,7 @@ int main(int argc, char *argv[]) CGuiApplication a("swift mapping tool", CApplicationInfo::MappingTool, CIcons::swiftDatabase48()); a.setSignalStartupAutomatically(false); // application will signal startup on its own a.splashScreen(CIcons::swiftDatabase256()); + a.parse(); a.useWebDataServices(BlackCore::CWebReaderFlags::AllSwiftDbReaders, CDatabaseReaderConfigList::forMappingTool()); if (!a.start()) { return EXIT_FAILURE; } CSwiftData w;