From d6c515fd856f3f8632d43e6fbd9d0637e2eef15e Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 9 Mar 2024 09:22:34 +0100 Subject: [PATCH] preferences: replace SIGNAL/SLOT by function pointers This give compile time checking. In fact, one of the connections was not working (currentIndexChanged(QString) doesn't exist in newer(?) Qt versions). Signed-off-by: Berthold Stoeger --- desktop-widgets/preferences/preferences_cloud.cpp | 2 +- desktop-widgets/preferences/preferences_dc.cpp | 1 - desktop-widgets/preferences/preferences_language.cpp | 4 ++-- desktop-widgets/preferences/preferences_network.cpp | 4 +--- desktop-widgets/preferences/preferences_reset.cpp | 1 - 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/desktop-widgets/preferences/preferences_cloud.cpp b/desktop-widgets/preferences/preferences_cloud.cpp index 4902e7e10..01545f3b1 100644 --- a/desktop-widgets/preferences/preferences_cloud.cpp +++ b/desktop-widgets/preferences/preferences_cloud.cpp @@ -96,7 +96,7 @@ void PreferencesCloud::syncSettings() return; } CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this); - connect(cloudAuth, SIGNAL(finishedAuthenticate()), this, SLOT(updateCloudAuthenticationState())); + connect(cloudAuth, &CloudStorageAuthenticate::finishedAuthenticate, this, &PreferencesCloud::updateCloudAuthenticationState); cloudAuth->backend(email, password, pin); } } diff --git a/desktop-widgets/preferences/preferences_dc.cpp b/desktop-widgets/preferences/preferences_dc.cpp index f79e11b5a..4319b763a 100644 --- a/desktop-widgets/preferences/preferences_dc.cpp +++ b/desktop-widgets/preferences/preferences_dc.cpp @@ -37,4 +37,3 @@ void PreferencesDc::refreshSettings() void PreferencesDc::syncSettings() { } - diff --git a/desktop-widgets/preferences/preferences_language.cpp b/desktop-widgets/preferences/preferences_language.cpp index 7a8433622..84ee74180 100644 --- a/desktop-widgets/preferences/preferences_language.cpp +++ b/desktop-widgets/preferences/preferences_language.cpp @@ -30,8 +30,8 @@ PreferencesLanguage::PreferencesLanguage() : AbstractPreferencesWidget(tr("Langu foreach (QString format, dateFormatShortMap.keys()) ui->dateFormatEntry->addItem(format); ui->dateFormatEntry->completer()->setCaseSensitivity(Qt::CaseSensitive); - connect(ui->dateFormatEntry, SIGNAL(currentIndexChanged(const QString&)), - this, SLOT(dateFormatChanged(const QString&))); + connect(ui->dateFormatEntry, &QComboBox::currentTextChanged, + this, &PreferencesLanguage::dateFormatChanged); ui->timeFormatEntry->addItem("hh:mm"); ui->timeFormatEntry->addItem("h:mm AP"); diff --git a/desktop-widgets/preferences/preferences_network.cpp b/desktop-widgets/preferences/preferences_network.cpp index 2b2f13ed1..7ea08d077 100644 --- a/desktop-widgets/preferences/preferences_network.cpp +++ b/desktop-widgets/preferences/preferences_network.cpp @@ -17,7 +17,7 @@ PreferencesNetwork::PreferencesNetwork() : AbstractPreferencesWidget(tr("Network ui->proxyType->addItem(tr("SOCKS proxy"), QNetworkProxy::Socks5Proxy); ui->proxyType->setCurrentIndex(-1); - connect(ui->proxyType, SIGNAL(currentIndexChanged(int)), this, SLOT(proxyType_changed(int))); + connect(ui->proxyType, QOverload::of(&QComboBox::currentIndexChanged), this, &PreferencesNetwork::proxyType_changed); } PreferencesNetwork::~PreferencesNetwork() @@ -47,7 +47,6 @@ void PreferencesNetwork::syncSettings() proxy->set_proxy_pass(ui->proxyPassword->text()); } - void PreferencesNetwork::proxyType_changed(int idx) { if (idx == -1) { @@ -63,4 +62,3 @@ void PreferencesNetwork::proxyType_changed(int idx) ui->proxyPassword->setEnabled(hpEnabled & ui->proxyAuthRequired->isChecked()); ui->proxyAuthRequired->setChecked(ui->proxyAuthRequired->isChecked()); } - diff --git a/desktop-widgets/preferences/preferences_reset.cpp b/desktop-widgets/preferences/preferences_reset.cpp index 3fd6aa07e..00d4d1086 100644 --- a/desktop-widgets/preferences/preferences_reset.cpp +++ b/desktop-widgets/preferences/preferences_reset.cpp @@ -30,4 +30,3 @@ void PreferencesReset::refreshSettings() void PreferencesReset::syncSettings() { } -