From a07b6b4d9714e32cb28b903bc89889853e30c410 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 24 Jan 2018 21:23:55 +0100 Subject: Remove function-call indirection in qmlmanager.cpp QMLManager::tryRetrieveDataFromBackend() was a one-liner calling void QMLManager::checkCredentialsAndExecute() with a pointer-to-member. The latter was never called with a different pointer, therefore fold the latter into the former and remove the indirection. Signed-off-by: Berthold Stoeger --- mobile-widgets/qmlmanager.cpp | 9 ++------- mobile-widgets/qmlmanager.h | 2 -- 2 files changed, 2 insertions(+), 9 deletions(-) (limited to 'mobile-widgets') diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 8bea69577..5685d71a8 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -426,7 +426,7 @@ void QMLManager::saveCloudCredentials() } } -void QMLManager::checkCredentialsAndExecute(execute_function_type execute) +void QMLManager::tryRetrieveDataFromBackend() { // if the cloud credentials are present, we should try to get the GPS Webservice ID // and (if we haven't done so) load the dive list @@ -477,15 +477,10 @@ void QMLManager::checkCredentialsAndExecute(execute_function_type execute) reply = manager()->get(request); connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(handleError(QNetworkReply::NetworkError))); connect(reply, &QNetworkReply::sslErrors, this, &QMLManager::handleSslErrors); - connect(reply, &QNetworkReply::finished, this, execute, Qt::UniqueConnection); + connect(reply, &QNetworkReply::finished, this, &QMLManager::retrieveUserid, Qt::UniqueConnection); } } -void QMLManager::tryRetrieveDataFromBackend() -{ - checkCredentialsAndExecute(&QMLManager::retrieveUserid); -} - void QMLManager::provideAuth(QNetworkReply *reply, QAuthenticator *auth) { if (auth->user() == QString(prefs.cloud_storage_email) && diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h index 5bd597887..6917a6818 100644 --- a/mobile-widgets/qmlmanager.h +++ b/mobile-widgets/qmlmanager.h @@ -126,7 +126,6 @@ public: bool btEnabled() const; void setBtEnabled(bool value); - typedef void (QMLManager::*execute_function_type)(); DiveListSortModel *dlSortModel; QStringList suitInit() const; @@ -146,7 +145,6 @@ public slots: void applicationStateChanged(Qt::ApplicationState state); void savePreferences(); void saveCloudCredentials(); - void checkCredentialsAndExecute(execute_function_type execute); void tryRetrieveDataFromBackend(); void handleError(QNetworkReply::NetworkError nError); void handleSslErrors(const QList &errors); -- cgit v1.2.3-70-g09d2