Minor tweaks (found during T125)

* formatting/typos
* authentication: private slots => private
This commit is contained in:
Klaus Basan
2017-08-15 02:05:43 +02:00
committed by Mathew Sutcliffe
parent ca651877cd
commit 0bbad2ff83
9 changed files with 31 additions and 33 deletions

View File

@@ -258,7 +258,6 @@ namespace BlackCore
% "swift DB datafile locations: " % "swift DB datafile locations: "
% getSwiftDbDataFileLocationUrls().toQString(i18n) % getSwiftDbDataFileLocationUrls().toQString(i18n)
% separator; % separator;
s += s +=
"VATSIM bookings: " "VATSIM bookings: "
% getVatsimBookingsUrl().toQString(i18n) % getVatsimBookingsUrl().toQString(i18n)

View File

@@ -89,7 +89,7 @@ namespace BlackCore
QString query = params.toString(); QString query = params.toString();
const QNetworkRequest request(CNetworkUtils::getNetworkRequest(url, CNetworkUtils::PostUrlEncoded)); 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"); QString rm("Sent request to authentication server %1");
msgs.push_back(CStatusMessage(cats, CStatusMessage::SeverityInfo, rm.arg(url.toQString()))); msgs.push_back(CStatusMessage(cats, CStatusMessage::SeverityInfo, rm.arg(url.toQString())));
return msgs; return msgs;
@@ -100,11 +100,11 @@ namespace BlackCore
CUrl url(sApp->getGlobalSetup().getDbLoginServiceUrl()); CUrl url(sApp->getGlobalSetup().getDbLoginServiceUrl());
url.setQuery("logoff=true"); url.setQuery("logoff=true");
QNetworkRequest request(CNetworkUtils::getNetworkRequest(url)); QNetworkRequest request(CNetworkUtils::getNetworkRequest(url));
sApp->getFromNetwork(request, { this, &CDatabaseAuthenticationService::ps_parseServerResponse }); sApp->getFromNetwork(request, { this, &CDatabaseAuthenticationService::parseServerResponse });
this->m_swiftDbUser.set(CAuthenticatedUser()); this->m_swiftDbUser.set(CAuthenticatedUser());
} }
void CDatabaseAuthenticationService::ps_parseServerResponse(QNetworkReply *nwReplyPtr) void CDatabaseAuthenticationService::parseServerResponse(QNetworkReply *nwReplyPtr)
{ {
// always cleanup reply // always cleanup reply
QScopedPointer<QNetworkReply, QScopedPointerDeleteLater> nwReply(nwReplyPtr); QScopedPointer<QNetworkReply, QScopedPointerDeleteLater> nwReply(nwReplyPtr);
@@ -170,7 +170,7 @@ namespace BlackCore
} }
} }
void CDatabaseAuthenticationService::ps_userChanged() void CDatabaseAuthenticationService::userChanged()
{ {
// code goes here // code goes here
} }

View File

@@ -59,15 +59,14 @@ namespace BlackCore
//! Logoff completed //! Logoff completed
void logoffFinished(); void logoffFinished();
private slots: private:
//! Parse login answer //! Parse login answer
void ps_parseServerResponse(QNetworkReply *nwReplyPtr); void parseServerResponse(QNetworkReply *nwReplyPtr);
//! User object changed //! User object changed
void ps_userChanged(); void userChanged();
private: BlackMisc::CData<BlackCore::Data::TAuthenticatedDbUser> m_swiftDbUser {this, &CDatabaseAuthenticationService::userChanged};
BlackMisc::CData<BlackCore::Data::TAuthenticatedDbUser> m_swiftDbUser {this, &CDatabaseAuthenticationService::ps_userChanged};
bool m_shutdown = false; bool m_shutdown = false;
}; };
} // ns } // ns

View File

@@ -239,8 +239,8 @@ namespace BlackCore
CAircraftModelList stashModels; CAircraftModelList stashModels;
if (dbFsFamilyModels.isEmpty() || ownModels.isEmpty()) { return stashModels; } if (dbFsFamilyModels.isEmpty() || ownModels.isEmpty()) { return stashModels; }
const QSet<QString> dbKeys = dbFsFamilyModels.getModelStringSet(); const QSet<QString> dbKeys = dbFsFamilyModels.getModelStringSet();
const int mexModelsCount = maxToStash >= 0 ? maxToStash : ownModels.size(); const int maxModelsCount = maxToStash >= 0 ? maxToStash : ownModels.size();
if (mexModelsCount < 1) { return stashModels; } if (maxModelsCount < 1) { return stashModels; }
int c = 0; // counter int c = 0; // counter
for (const CAircraftModel &ownModel : ownModels) for (const CAircraftModel &ownModel : ownModels)
@@ -252,7 +252,7 @@ namespace BlackCore
{ {
if (progressIndicator) if (progressIndicator)
{ {
const int percentage = c * 100 / mexModelsCount; const int percentage = c * 100 / maxModelsCount;
progressIndicator->updateProgressIndicatorAndProcessEvents(percentage); progressIndicator->updateProgressIndicatorAndProcessEvents(percentage);
} }
else else

View File

@@ -50,7 +50,7 @@ namespace BlackCore
//! Allow to call directly, special for info objects reader //! Allow to call directly, special for info objects reader
void read(); void read();
//! URL depending on mode //! URL depending on mode, i.e. shared/DB
BlackMisc::Network::CUrl getInfoObjectsUrl() const; BlackMisc::Network::CUrl getInfoObjectsUrl() const;
// cache handling for base class: no cache handling here in that case // cache handling for base class: no cache handling here in that case

View File

@@ -436,7 +436,7 @@ namespace BlackGui
if (this->m_modelLoader->isLoadingInProgress()) 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; return;
} }

View File

@@ -409,7 +409,7 @@ QString CSwiftLauncher::toCmdLine(const QString &exe, const QStringList &exeArgs
void CSwiftLauncher::ps_startButtonPressed() void CSwiftLauncher::ps_startButtonPressed()
{ {
QObject *sender = QObject::sender(); const QObject *sender = QObject::sender();
if (sender == ui->tb_SwiftGui) if (sender == ui->tb_SwiftGui)
{ {
if (this->setSwiftGuiExecutable()) if (this->setSwiftGuiExecutable())

View File

@@ -92,8 +92,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>392</width> <width>98</width>
<height>349</height> <height>88</height>
</rect> </rect>
</property> </property>
<attribute name="label"> <attribute name="label">
@@ -123,8 +123,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>392</width> <width>199</width>
<height>349</height> <height>63</height>
</rect> </rect>
</property> </property>
<attribute name="label"> <attribute name="label">
@@ -188,8 +188,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>392</width> <width>277</width>
<height>349</height> <height>244</height>
</rect> </rect>
</property> </property>
<attribute name="label"> <attribute name="label">
@@ -475,7 +475,7 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>80</height> <height>100</height>
</size> </size>
</property> </property>
</widget> </widget>
@@ -515,7 +515,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>376</width> <width>376</width>
<height>199</height> <height>179</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="vl_DataUpdatesScrollArea"> <layout class="QVBoxLayout" name="vl_DataUpdatesScrollArea">
@@ -565,8 +565,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>392</width> <width>98</width>
<height>349</height> <height>88</height>
</rect> </rect>
</property> </property>
<attribute name="label"> <attribute name="label">