From 0bbad2ff83ce1e623e6ec95470b35b70f536b39e Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Tue, 15 Aug 2017 02:05:43 +0200 Subject: [PATCH] Minor tweaks (found during T125) * formatting/typos * authentication: private slots => private --- src/blackcore/data/globalsetup.cpp | 1 - src/blackcore/db/databaseauthentication.cpp | 8 ++++---- src/blackcore/db/databaseauthentication.h | 11 +++++----- src/blackcore/db/databaseutils.cpp | 6 +++--- src/blackcore/db/infodatareader.h | 2 +- .../components/dbownmodelscomponent.cpp | 2 +- src/blackgui/overlaymessages.h | 12 +++++------ src/swiftlauncher/swiftlauncher.cpp | 2 +- src/swiftlauncher/swiftlauncher.ui | 20 +++++++++---------- 9 files changed, 31 insertions(+), 33 deletions(-) diff --git a/src/blackcore/data/globalsetup.cpp b/src/blackcore/data/globalsetup.cpp index 3eb5bb1b6..9d7ef0f37 100644 --- a/src/blackcore/data/globalsetup.cpp +++ b/src/blackcore/data/globalsetup.cpp @@ -258,7 +258,6 @@ namespace BlackCore % "swift DB datafile locations: " % getSwiftDbDataFileLocationUrls().toQString(i18n) % separator; - s += "VATSIM bookings: " % getVatsimBookingsUrl().toQString(i18n) diff --git a/src/blackcore/db/databaseauthentication.cpp b/src/blackcore/db/databaseauthentication.cpp index c3fc0e319..b1b3ae022 100644 --- a/src/blackcore/db/databaseauthentication.cpp +++ b/src/blackcore/db/databaseauthentication.cpp @@ -89,7 +89,7 @@ namespace BlackCore QString query = params.toString(); const QNetworkRequest request(CNetworkUtils::getNetworkRequest(url, CNetworkUtils::PostUrlEncoded)); - sApp->postToNetwork(request, query.toUtf8(), { this, &CDatabaseAuthenticationService::ps_parseServerResponse}); + sApp->postToNetwork(request, query.toUtf8(), { this, &CDatabaseAuthenticationService::parseServerResponse}); QString rm("Sent request to authentication server %1"); msgs.push_back(CStatusMessage(cats, CStatusMessage::SeverityInfo, rm.arg(url.toQString()))); return msgs; @@ -100,11 +100,11 @@ namespace BlackCore CUrl url(sApp->getGlobalSetup().getDbLoginServiceUrl()); url.setQuery("logoff=true"); QNetworkRequest request(CNetworkUtils::getNetworkRequest(url)); - sApp->getFromNetwork(request, { this, &CDatabaseAuthenticationService::ps_parseServerResponse }); + sApp->getFromNetwork(request, { this, &CDatabaseAuthenticationService::parseServerResponse }); this->m_swiftDbUser.set(CAuthenticatedUser()); } - void CDatabaseAuthenticationService::ps_parseServerResponse(QNetworkReply *nwReplyPtr) + void CDatabaseAuthenticationService::parseServerResponse(QNetworkReply *nwReplyPtr) { // always cleanup reply QScopedPointer nwReply(nwReplyPtr); @@ -170,7 +170,7 @@ namespace BlackCore } } - void CDatabaseAuthenticationService::ps_userChanged() + void CDatabaseAuthenticationService::userChanged() { // code goes here } diff --git a/src/blackcore/db/databaseauthentication.h b/src/blackcore/db/databaseauthentication.h index 3c6f5519d..9542dafd0 100644 --- a/src/blackcore/db/databaseauthentication.h +++ b/src/blackcore/db/databaseauthentication.h @@ -28,7 +28,7 @@ namespace BlackCore namespace Db { //! Databse user used with swift DB. Features role and cookie handling. - class BLACKCORE_EXPORT CDatabaseAuthenticationService: public QObject + class BLACKCORE_EXPORT CDatabaseAuthenticationService: public QObject { Q_OBJECT @@ -59,15 +59,14 @@ namespace BlackCore //! Logoff completed void logoffFinished(); - private slots: + private: //! Parse login answer - void ps_parseServerResponse(QNetworkReply *nwReplyPtr); + void parseServerResponse(QNetworkReply *nwReplyPtr); //! User object changed - void ps_userChanged(); + void userChanged(); - private: - BlackMisc::CData m_swiftDbUser {this, &CDatabaseAuthenticationService::ps_userChanged}; + BlackMisc::CData m_swiftDbUser {this, &CDatabaseAuthenticationService::userChanged}; bool m_shutdown = false; }; } // ns diff --git a/src/blackcore/db/databaseutils.cpp b/src/blackcore/db/databaseutils.cpp index 43ddb09d0..9cde234ec 100644 --- a/src/blackcore/db/databaseutils.cpp +++ b/src/blackcore/db/databaseutils.cpp @@ -239,8 +239,8 @@ namespace BlackCore CAircraftModelList stashModels; if (dbFsFamilyModels.isEmpty() || ownModels.isEmpty()) { return stashModels; } const QSet dbKeys = dbFsFamilyModels.getModelStringSet(); - const int mexModelsCount = maxToStash >= 0 ? maxToStash : ownModels.size(); - if (mexModelsCount < 1) { return stashModels; } + const int maxModelsCount = maxToStash >= 0 ? maxToStash : ownModels.size(); + if (maxModelsCount < 1) { return stashModels; } int c = 0; // counter for (const CAircraftModel &ownModel : ownModels) @@ -252,7 +252,7 @@ namespace BlackCore { if (progressIndicator) { - const int percentage = c * 100 / mexModelsCount; + const int percentage = c * 100 / maxModelsCount; progressIndicator->updateProgressIndicatorAndProcessEvents(percentage); } else diff --git a/src/blackcore/db/infodatareader.h b/src/blackcore/db/infodatareader.h index 3bf77f9c1..7c83ccc31 100644 --- a/src/blackcore/db/infodatareader.h +++ b/src/blackcore/db/infodatareader.h @@ -50,7 +50,7 @@ namespace BlackCore //! Allow to call directly, special for info objects reader void read(); - //! URL depending on mode + //! URL depending on mode, i.e. shared/DB BlackMisc::Network::CUrl getInfoObjectsUrl() const; // cache handling for base class: no cache handling here in that case diff --git a/src/blackgui/components/dbownmodelscomponent.cpp b/src/blackgui/components/dbownmodelscomponent.cpp index 2403446fe..8a87e30bb 100644 --- a/src/blackgui/components/dbownmodelscomponent.cpp +++ b/src/blackgui/components/dbownmodelscomponent.cpp @@ -436,7 +436,7 @@ namespace BlackGui if (this->m_modelLoader->isLoadingInProgress()) { - CLogMessage(this).info("Loading for %1 already in progress") << simulator.toQString(); + CLogMessage(this).info("Loading for '%1' already in progress") << simulator.toQString(); return; } diff --git a/src/blackgui/overlaymessages.h b/src/blackgui/overlaymessages.h index 1b5020608..580546c95 100644 --- a/src/blackgui/overlaymessages.h +++ b/src/blackgui/overlaymessages.h @@ -141,12 +141,12 @@ namespace BlackGui private: QScopedPointer ui; BlackMisc::CSettingReadOnly m_messageSettings { this }; - QString m_header; - int m_lastConfirmation = QMessageBox::Cancel; - bool m_awaitingConfirmation = false; - bool m_hasKillButton = false; - std::function m_okLambda; - QTimer m_autoCloseTimer { this }; + QString m_header; + int m_lastConfirmation = QMessageBox::Cancel; + bool m_awaitingConfirmation = false; + bool m_hasKillButton = false; + std::function m_okLambda; + QTimer m_autoCloseTimer { this }; QList> m_pendingMessageCalls; //! Init widget diff --git a/src/swiftlauncher/swiftlauncher.cpp b/src/swiftlauncher/swiftlauncher.cpp index b71e0d888..63e5c64fc 100644 --- a/src/swiftlauncher/swiftlauncher.cpp +++ b/src/swiftlauncher/swiftlauncher.cpp @@ -409,7 +409,7 @@ QString CSwiftLauncher::toCmdLine(const QString &exe, const QStringList &exeArgs void CSwiftLauncher::ps_startButtonPressed() { - QObject *sender = QObject::sender(); + const QObject *sender = QObject::sender(); if (sender == ui->tb_SwiftGui) { if (this->setSwiftGuiExecutable()) diff --git a/src/swiftlauncher/swiftlauncher.ui b/src/swiftlauncher/swiftlauncher.ui index b5c5902a6..c0ad6fba9 100644 --- a/src/swiftlauncher/swiftlauncher.ui +++ b/src/swiftlauncher/swiftlauncher.ui @@ -92,8 +92,8 @@ 0 0 - 392 - 349 + 98 + 88 @@ -123,8 +123,8 @@ 0 0 - 392 - 349 + 199 + 63 @@ -188,8 +188,8 @@ 0 0 - 392 - 349 + 277 + 244 @@ -475,7 +475,7 @@ 0 - 80 + 100 @@ -515,7 +515,7 @@ 0 0 376 - 199 + 179 @@ -565,8 +565,8 @@ 0 0 - 392 - 349 + 98 + 88