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 <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-03-09 09:22:34 +01:00 committed by Michael Keller
parent 8980d61786
commit 857148efd6
5 changed files with 4 additions and 8 deletions

View file

@ -96,7 +96,7 @@ void PreferencesCloud::syncSettings()
return; return;
} }
CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this); CloudStorageAuthenticate *cloudAuth = new CloudStorageAuthenticate(this);
connect(cloudAuth, SIGNAL(finishedAuthenticate()), this, SLOT(updateCloudAuthenticationState())); connect(cloudAuth, &CloudStorageAuthenticate::finishedAuthenticate, this, &PreferencesCloud::updateCloudAuthenticationState);
cloudAuth->backend(email, password, pin); cloudAuth->backend(email, password, pin);
} }
} }

View file

@ -37,4 +37,3 @@ void PreferencesDc::refreshSettings()
void PreferencesDc::syncSettings() void PreferencesDc::syncSettings()
{ {
} }

View file

@ -30,8 +30,8 @@ PreferencesLanguage::PreferencesLanguage() : AbstractPreferencesWidget(tr("Langu
foreach (QString format, dateFormatShortMap.keys()) foreach (QString format, dateFormatShortMap.keys())
ui->dateFormatEntry->addItem(format); ui->dateFormatEntry->addItem(format);
ui->dateFormatEntry->completer()->setCaseSensitivity(Qt::CaseSensitive); ui->dateFormatEntry->completer()->setCaseSensitivity(Qt::CaseSensitive);
connect(ui->dateFormatEntry, SIGNAL(currentIndexChanged(const QString&)), connect(ui->dateFormatEntry, &QComboBox::currentTextChanged,
this, SLOT(dateFormatChanged(const QString&))); this, &PreferencesLanguage::dateFormatChanged);
ui->timeFormatEntry->addItem("hh:mm"); ui->timeFormatEntry->addItem("hh:mm");
ui->timeFormatEntry->addItem("h:mm AP"); ui->timeFormatEntry->addItem("h:mm AP");

View file

@ -17,7 +17,7 @@ PreferencesNetwork::PreferencesNetwork() : AbstractPreferencesWidget(tr("Network
ui->proxyType->addItem(tr("SOCKS proxy"), QNetworkProxy::Socks5Proxy); ui->proxyType->addItem(tr("SOCKS proxy"), QNetworkProxy::Socks5Proxy);
ui->proxyType->setCurrentIndex(-1); ui->proxyType->setCurrentIndex(-1);
connect(ui->proxyType, SIGNAL(currentIndexChanged(int)), this, SLOT(proxyType_changed(int))); connect(ui->proxyType, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &PreferencesNetwork::proxyType_changed);
} }
PreferencesNetwork::~PreferencesNetwork() PreferencesNetwork::~PreferencesNetwork()
@ -47,7 +47,6 @@ void PreferencesNetwork::syncSettings()
proxy->set_proxy_pass(ui->proxyPassword->text()); proxy->set_proxy_pass(ui->proxyPassword->text());
} }
void PreferencesNetwork::proxyType_changed(int idx) void PreferencesNetwork::proxyType_changed(int idx)
{ {
if (idx == -1) { if (idx == -1) {
@ -63,4 +62,3 @@ void PreferencesNetwork::proxyType_changed(int idx)
ui->proxyPassword->setEnabled(hpEnabled & ui->proxyAuthRequired->isChecked()); ui->proxyPassword->setEnabled(hpEnabled & ui->proxyAuthRequired->isChecked());
ui->proxyAuthRequired->setChecked(ui->proxyAuthRequired->isChecked()); ui->proxyAuthRequired->setChecked(ui->proxyAuthRequired->isChecked());
} }

View file

@ -30,4 +30,3 @@ void PreferencesReset::refreshSettings()
void PreferencesReset::syncSettings() void PreferencesReset::syncSettings()
{ {
} }