diff --git a/kded/notification.cpp b/kded/notification.cpp --- a/kded/notification.cpp +++ b/kded/notification.cpp @@ -51,7 +51,7 @@ addActiveConnection(ac); } - connect(NetworkManager::notifier(), &NetworkManager::Notifier::activeConnectionAdded, this, static_cast(&Notification::addActiveConnection)); + connect(NetworkManager::notifier(), &NetworkManager::Notifier::activeConnectionAdded, this, QOverload::of(&Notification::addActiveConnection)); QDBusConnection::systemBus().connect(QStringLiteral("org.freedesktop.login1"), QStringLiteral("/org/freedesktop/login1"), diff --git a/libs/declarative/networkstatus.cpp b/libs/declarative/networkstatus.cpp --- a/libs/declarative/networkstatus.cpp +++ b/libs/declarative/networkstatus.cpp @@ -71,7 +71,7 @@ : QObject(parent) { connect(NetworkManager::notifier(), &NetworkManager::Notifier::statusChanged, this, &NetworkStatus::statusChanged); - connect(NetworkManager::notifier(), &NetworkManager::Notifier::activeConnectionsChanged, this, static_cast(&NetworkStatus::activeConnectionsChanged)); + connect(NetworkManager::notifier(), &NetworkManager::Notifier::activeConnectionsChanged, this, QOverload<>::of(&NetworkStatus::activeConnectionsChanged)); activeConnectionsChanged(); statusChanged(NetworkManager::status()); diff --git a/libs/editor/connectioneditorbase.cpp b/libs/editor/connectioneditorbase.cpp --- a/libs/editor/connectioneditorbase.cpp +++ b/libs/editor/connectioneditorbase.cpp @@ -203,7 +203,7 @@ m_connection->setting(NetworkManager::Setting::Security8021x).staticCast(), this); addSettingWidget(wifiSecurity, i18n("Wi-Fi Security")); - connect(wifiWidget, static_cast(&WifiConnectionWidget::ssidChanged), wifiSecurity, &WifiSecurity::onSsidChanged); + connect(wifiWidget, QOverload::of(&WifiConnectionWidget::ssidChanged), wifiSecurity, &WifiSecurity::onSsidChanged); } else if (type == NetworkManager::ConnectionSettings::Pppoe) { // DSL PppoeWidget *pppoeWidget = new PppoeWidget(m_connection->setting(NetworkManager::Setting::Pppoe), this); addSettingWidget(pppoeWidget, i18n("DSL")); diff --git a/libs/editor/settings/bondwidget.cpp b/libs/editor/settings/bondwidget.cpp --- a/libs/editor/settings/bondwidget.cpp +++ b/libs/editor/settings/bondwidget.cpp @@ -75,7 +75,7 @@ connect(m_ui->ifaceName, &KLineEdit::textChanged, this, &BondWidget::slotWidgetChanged); connect(m_ui->arpTargets, &KLineEdit::textChanged, this, &BondWidget::slotWidgetChanged); - connect(m_ui->linkMonitoring, static_cast(&KComboBox::currentIndexChanged), this, &BondWidget::slotWidgetChanged); + connect(m_ui->linkMonitoring, QOverload::of(&KComboBox::currentIndexChanged), this, &BondWidget::slotWidgetChanged); // Connect for setting check watchChangedSetting(); diff --git a/libs/editor/settings/connectionwidget.cpp b/libs/editor/settings/connectionwidget.cpp --- a/libs/editor/settings/connectionwidget.cpp +++ b/libs/editor/settings/connectionwidget.cpp @@ -78,11 +78,11 @@ connect(m_widget->allUsers, &QCheckBox::stateChanged, this, &ConnectionWidget::settingChanged); connect(m_widget->autoconnectVpn, &QCheckBox::stateChanged, this, &ConnectionWidget::settingChanged); connect(m_widget->pushButtonPermissions, &QPushButton::clicked, this, &ConnectionWidget::settingChanged); - connect(m_widget->firewallZone, static_cast(&QComboBox::currentIndexChanged), this, &ConnectionWidget::settingChanged); + connect(m_widget->firewallZone, QOverload::of(&QComboBox::currentIndexChanged), this, &ConnectionWidget::settingChanged); connect(m_widget->firewallZone, &QComboBox::currentTextChanged, this, &ConnectionWidget::settingChanged); - connect(m_widget->vpnCombobox, static_cast(&QComboBox::currentIndexChanged), this, &ConnectionWidget::settingChanged); + connect(m_widget->vpnCombobox, QOverload::of(&QComboBox::currentIndexChanged), this, &ConnectionWidget::settingChanged); connect(m_widget->vpnCombobox, &QComboBox::currentTextChanged, this, &ConnectionWidget::settingChanged); - connect(m_widget->prioritySpin, static_cast(&QSpinBox::valueChanged), this, &ConnectionWidget::settingChanged); + connect(m_widget->prioritySpin, QOverload::of(&QSpinBox::valueChanged), this, &ConnectionWidget::settingChanged); connect(m_widget->pushButtonPermissions, &QPushButton::clicked, this, &ConnectionWidget::openAdvancedPermissions); } diff --git a/libs/editor/settings/ipv4widget.cpp b/libs/editor/settings/ipv4widget.cpp --- a/libs/editor/settings/ipv4widget.cpp +++ b/libs/editor/settings/ipv4widget.cpp @@ -104,7 +104,7 @@ loadConfig(setting); } - connect(m_ui->method, static_cast(&KComboBox::currentIndexChanged), this, &IPv4Widget::slotModeComboChanged); + connect(m_ui->method, QOverload::of(&KComboBox::currentIndexChanged), this, &IPv4Widget::slotModeComboChanged); slotModeComboChanged(m_ui->method->currentIndex()); connect(m_ui->btnRoutes, &QPushButton::clicked, this, &IPv4Widget::slotRoutesDialog); @@ -114,7 +114,7 @@ // Connect for validity check connect(m_ui->dns, &KLineEdit::textChanged, this, &IPv4Widget::slotWidgetChanged); - connect(m_ui->method, static_cast(&KComboBox::currentIndexChanged), this, &IPv4Widget::slotWidgetChanged); + connect(m_ui->method, QOverload::of(&KComboBox::currentIndexChanged), this, &IPv4Widget::slotWidgetChanged); connect(&d->model, &QStandardItemModel::dataChanged, this, &IPv4Widget::slotWidgetChanged); connect(&d->model, &QStandardItemModel::rowsRemoved, this, &IPv4Widget::slotWidgetChanged); diff --git a/libs/editor/settings/ipv6widget.cpp b/libs/editor/settings/ipv6widget.cpp --- a/libs/editor/settings/ipv6widget.cpp +++ b/libs/editor/settings/ipv6widget.cpp @@ -93,7 +93,7 @@ loadConfig(setting); } - connect(m_ui->method, static_cast(&KComboBox::currentIndexChanged), this, &IPv6Widget::slotModeComboChanged); + connect(m_ui->method, QOverload::of(&KComboBox::currentIndexChanged), this, &IPv6Widget::slotModeComboChanged); slotModeComboChanged(m_ui->method->currentIndex()); connect(m_ui->btnRoutes, &QPushButton::clicked, this, &IPv6Widget::slotRoutesDialog); @@ -103,7 +103,7 @@ // Connect for validity check connect(m_ui->dns, &KLineEdit::textChanged, this, &IPv6Widget::slotWidgetChanged); - connect(m_ui->method, static_cast(&KComboBox::currentIndexChanged), this, &IPv6Widget::slotWidgetChanged); + connect(m_ui->method, QOverload::of(&KComboBox::currentIndexChanged), this, &IPv6Widget::slotWidgetChanged); connect(&d->model, &QStandardItemModel::dataChanged, this, &IPv6Widget::slotWidgetChanged); connect(&d->model, &QStandardItemModel::rowsRemoved, this, &IPv6Widget::slotWidgetChanged); diff --git a/libs/editor/settings/security802-1x.cpp b/libs/editor/settings/security802-1x.cpp --- a/libs/editor/settings/security802-1x.cpp +++ b/libs/editor/settings/security802-1x.cpp @@ -76,7 +76,7 @@ watchChangedSetting(); // Connect for validity check - connect(m_ui->auth, static_cast(&KComboBox::currentIndexChanged), this, &Security8021x::slotWidgetChanged); + connect(m_ui->auth, QOverload::of(&KComboBox::currentIndexChanged), this, &Security8021x::slotWidgetChanged); connect(m_ui->md5UserName, &KLineEdit::textChanged, this, &Security8021x::slotWidgetChanged); connect(m_ui->md5Password, &PasswordField::textChanged, this, &Security8021x::slotWidgetChanged); connect(m_ui->md5Password, &PasswordField::passwordOptionChanged, this, &Security8021x::slotWidgetChanged); diff --git a/libs/editor/settings/vlanwidget.cpp b/libs/editor/settings/vlanwidget.cpp --- a/libs/editor/settings/vlanwidget.cpp +++ b/libs/editor/settings/vlanwidget.cpp @@ -34,7 +34,7 @@ fillConnections(); connect(m_ui->ifaceName, &KLineEdit::textChanged, this, &VlanWidget::slotWidgetChanged); - connect(m_ui->parent, static_cast(&KComboBox::currentIndexChanged), this, &VlanWidget::slotWidgetChanged); + connect(m_ui->parent, QOverload::of(&KComboBox::currentIndexChanged), this, &VlanWidget::slotWidgetChanged); connect(m_ui->parent->lineEdit(), &QLineEdit::textChanged, this, &VlanWidget::slotWidgetChanged); // Connect for setting check diff --git a/libs/editor/settings/wificonnectionwidget.cpp b/libs/editor/settings/wificonnectionwidget.cpp --- a/libs/editor/settings/wificonnectionwidget.cpp +++ b/libs/editor/settings/wificonnectionwidget.cpp @@ -36,9 +36,9 @@ m_ui->setupUi(this); connect(m_ui->btnRandomMacAddr, &QPushButton::clicked, this, &WifiConnectionWidget::generateRandomClonedMac); - connect(m_ui->SSIDCombo, &SsidComboBox::ssidChanged, this, static_cast(&WifiConnectionWidget::ssidChanged)); - connect(m_ui->modeComboBox, static_cast(&KComboBox::currentIndexChanged), this, &WifiConnectionWidget::modeChanged); - connect(m_ui->band, static_cast(&KComboBox::currentIndexChanged), this, &WifiConnectionWidget::bandChanged); + connect(m_ui->SSIDCombo, &SsidComboBox::ssidChanged, this, QOverload<>::of(&WifiConnectionWidget::ssidChanged)); + connect(m_ui->modeComboBox, QOverload::of(&KComboBox::currentIndexChanged), this, &WifiConnectionWidget::modeChanged); + connect(m_ui->band, QOverload::of(&KComboBox::currentIndexChanged), this, &WifiConnectionWidget::bandChanged); // Connect for setting check watchChangedSetting(); diff --git a/libs/editor/settings/wifisecurity.cpp b/libs/editor/settings/wifisecurity.cpp --- a/libs/editor/settings/wifisecurity.cpp +++ b/libs/editor/settings/wifisecurity.cpp @@ -44,8 +44,8 @@ m_ui->stackedWidget->insertWidget(3, m_8021xWidget); m_ui->stackedWidget->insertWidget(5, m_WPA2Widget); - connect(m_ui->securityCombo, static_cast(&KComboBox::currentIndexChanged), this, &WifiSecurity::securityChanged); - connect(m_ui->wepIndex, static_cast(&KComboBox::currentIndexChanged), this, &WifiSecurity::setWepKey); + connect(m_ui->securityCombo, QOverload::of(&KComboBox::currentIndexChanged), this, &WifiSecurity::securityChanged); + connect(m_ui->wepIndex, QOverload::of(&KComboBox::currentIndexChanged), this, &WifiSecurity::setWepKey); // Connect for setting check watchChangedSetting(); @@ -58,8 +58,8 @@ connect(m_ui->leapPassword, &PasswordField::passwordOptionChanged, this, &WifiSecurity::slotWidgetChanged); connect(m_ui->psk, &PasswordField::textChanged, this, &WifiSecurity::slotWidgetChanged); connect(m_ui->psk, &PasswordField::passwordOptionChanged, this, &WifiSecurity::slotWidgetChanged); - connect(m_ui->wepIndex, static_cast(&KComboBox::currentIndexChanged), this, &WifiSecurity::slotWidgetChanged); - connect(m_ui->securityCombo, static_cast(&KComboBox::currentIndexChanged), this, &WifiSecurity::slotWidgetChanged); + connect(m_ui->wepIndex, QOverload::of(&KComboBox::currentIndexChanged), this, &WifiSecurity::slotWidgetChanged); + connect(m_ui->securityCombo, QOverload::of(&KComboBox::currentIndexChanged), this, &WifiSecurity::slotWidgetChanged); connect(m_8021xWidget, &Security8021x::validChanged, this, &WifiSecurity::slotWidgetChanged); connect(m_WPA2Widget, &Security8021x::validChanged, this, &WifiSecurity::slotWidgetChanged); diff --git a/libs/editor/settings/wiredconnectionwidget.cpp b/libs/editor/settings/wiredconnectionwidget.cpp --- a/libs/editor/settings/wiredconnectionwidget.cpp +++ b/libs/editor/settings/wiredconnectionwidget.cpp @@ -46,7 +46,7 @@ connect(m_widget->autonegotiate, &QCheckBox::stateChanged, this, &WiredConnectionWidget::slotWidgetChanged); connect(m_widget->clonedMacAddress, &KLineEdit::textChanged, this, &WiredConnectionWidget::slotWidgetChanged); connect(m_widget->macAddress, &HwAddrComboBox::hwAddressChanged, this, &WiredConnectionWidget::slotWidgetChanged); - connect(m_widget->speed, static_cast(&QSpinBox::valueChanged), this, &WiredConnectionWidget::slotWidgetChanged); + connect(m_widget->speed, QOverload::of(&QSpinBox::valueChanged), this, &WiredConnectionWidget::slotWidgetChanged); KAcceleratorManager::manage(this); diff --git a/libs/editor/widgets/bssidcombobox.cpp b/libs/editor/widgets/bssidcombobox.cpp --- a/libs/editor/widgets/bssidcombobox.cpp +++ b/libs/editor/widgets/bssidcombobox.cpp @@ -38,7 +38,7 @@ setInsertPolicy(QComboBox::NoInsert); connect(this, &BssidComboBox::editTextChanged, this, &BssidComboBox::slotEditTextChanged); - connect(this, static_cast(&BssidComboBox::activated), this, &BssidComboBox::slotCurrentIndexChanged); + connect(this, QOverload::of(&BssidComboBox::activated), this, &BssidComboBox::slotCurrentIndexChanged); } QString BssidComboBox::bssid() const diff --git a/libs/editor/widgets/hwaddrcombobox.cpp b/libs/editor/widgets/hwaddrcombobox.cpp --- a/libs/editor/widgets/hwaddrcombobox.cpp +++ b/libs/editor/widgets/hwaddrcombobox.cpp @@ -38,7 +38,7 @@ setInsertPolicy(QComboBox::NoInsert); connect(this, &HwAddrComboBox::editTextChanged, this, &HwAddrComboBox::slotEditTextChanged); - connect(this, static_cast(&HwAddrComboBox::currentIndexChanged), this, &HwAddrComboBox::slotCurrentIndexChanged); + connect(this, QOverload::of(&HwAddrComboBox::currentIndexChanged), this, &HwAddrComboBox::slotCurrentIndexChanged); } bool HwAddrComboBox::isValid() const diff --git a/libs/editor/widgets/mobileconnectionwizard.cpp b/libs/editor/widgets/mobileconnectionwizard.cpp --- a/libs/editor/widgets/mobileconnectionwizard.cpp +++ b/libs/editor/widgets/mobileconnectionwizard.cpp @@ -141,7 +141,7 @@ break; case 3: // Plans Page - disconnect(mPlanComboBox, static_cast(&KComboBox::currentIndexChanged), this, &MobileConnectionWizard::slotEnablePlanEditBox); + disconnect(mPlanComboBox, QOverload::of(&KComboBox::currentIndexChanged), this, &MobileConnectionWizard::slotEnablePlanEditBox); mPlanComboBox->clear(); if (type() != NetworkManager::ConnectionSettings::Gsm) { goto OUT_3; @@ -170,7 +170,7 @@ mPlanComboBox->setCurrentIndex(0); slotEnablePlanEditBox(mPlanComboBox->currentText()); OUT_3: - connect(mPlanComboBox, static_cast(&KComboBox::currentIndexChanged), this, &MobileConnectionWizard::slotEnablePlanEditBox); + connect(mPlanComboBox, QOverload::of(&KComboBox::currentIndexChanged), this, &MobileConnectionWizard::slotEnablePlanEditBox); break; case 4: // Confirm Page diff --git a/libs/editor/widgets/passwordfield.cpp b/libs/editor/widgets/passwordfield.cpp --- a/libs/editor/widgets/passwordfield.cpp +++ b/libs/editor/widgets/passwordfield.cpp @@ -65,7 +65,7 @@ m_currentPasswordOption = StoreForAllUsers; } - connect(m_passwordOptionsMenu, static_cast(&QComboBox::currentIndexChanged), this, &PasswordField::changePasswordOption); + connect(m_passwordOptionsMenu, QOverload::of(&QComboBox::currentIndexChanged), this, &PasswordField::changePasswordOption); // Disable by default m_passwordOptionsMenu->setVisible(false); diff --git a/libs/editor/widgets/settingwidget.cpp b/libs/editor/widgets/settingwidget.cpp --- a/libs/editor/widgets/settingwidget.cpp +++ b/libs/editor/widgets/settingwidget.cpp @@ -69,7 +69,7 @@ // Connect all QComboBox widgets QList comboboxes = findChildren(); Q_FOREACH (QComboBox *combobox, comboboxes) { - connect(combobox, static_cast(&QComboBox::currentIndexChanged), this, &SettingWidget::settingChanged); + connect(combobox, QOverload::of(&QComboBox::currentIndexChanged), this, &SettingWidget::settingChanged); connect(combobox, &QComboBox::currentTextChanged, this, &SettingWidget::settingChanged); } @@ -88,7 +88,7 @@ // Connect all QSpinBox widgets QList spinboxes = findChildren(); Q_FOREACH (QSpinBox *spinbox, spinboxes) { - connect(spinbox, static_cast(&QSpinBox::valueChanged), this, &SettingWidget::settingChanged); + connect(spinbox, QOverload::of(&QSpinBox::valueChanged), this, &SettingWidget::settingChanged); } // Connect all KUrlRequester widgets diff --git a/libs/editor/widgets/ssidcombobox.cpp b/libs/editor/widgets/ssidcombobox.cpp --- a/libs/editor/widgets/ssidcombobox.cpp +++ b/libs/editor/widgets/ssidcombobox.cpp @@ -39,7 +39,7 @@ setInsertPolicy(QComboBox::NoInsert); connect(this, &SsidComboBox::editTextChanged, this, &SsidComboBox::slotEditTextChanged); - connect(this, static_cast(&SsidComboBox::activated), this, &SsidComboBox::slotCurrentIndexChanged); + connect(this, QOverload::of(&SsidComboBox::activated), this, &SsidComboBox::slotCurrentIndexChanged); } QString SsidComboBox::ssid() const diff --git a/vpn/openconnect/openconnectauth.cpp b/vpn/openconnect/openconnectauth.cpp --- a/vpn/openconnect/openconnectauth.cpp +++ b/vpn/openconnect/openconnectauth.cpp @@ -103,7 +103,7 @@ d->cancelPipes[1] = -1; } - connect(d->ui.cmbLogLevel, static_cast(&QComboBox::currentIndexChanged), this, &OpenconnectAuthWidget::logLevelChanged); + connect(d->ui.cmbLogLevel, QOverload::of(&QComboBox::currentIndexChanged), this, &OpenconnectAuthWidget::logLevelChanged); connect(d->ui.viewServerLog, &QCheckBox::toggled, this, &OpenconnectAuthWidget::viewServerLogToggled); connect(d->ui.btnConnect, &QPushButton::clicked, this, &OpenconnectAuthWidget::connectHost); @@ -117,17 +117,17 @@ // and which needs to be populated with settings we get from NM, like host, certificate or private key d->vpninfo = d->worker->getOpenconnectInfo(); - connect(d->worker, static_cast(&OpenconnectAuthWorkerThread::validatePeerCert), this, &OpenconnectAuthWidget::validatePeerCert); + connect(d->worker, QOverload::of(&OpenconnectAuthWorkerThread::validatePeerCert), this, &OpenconnectAuthWidget::validatePeerCert); connect(d->worker, &OpenconnectAuthWorkerThread::processAuthForm, this, &OpenconnectAuthWidget::processAuthForm); connect(d->worker, &OpenconnectAuthWorkerThread::updateLog, this, &OpenconnectAuthWidget::updateLog); - connect(d->worker, static_cast(&OpenconnectAuthWorkerThread::writeNewConfig), this, &OpenconnectAuthWidget::writeNewConfig); + connect(d->worker, QOverload::of(&OpenconnectAuthWorkerThread::writeNewConfig), this, &OpenconnectAuthWidget::writeNewConfig); connect(d->worker, &OpenconnectAuthWorkerThread::cookieObtained, this, &OpenconnectAuthWidget::workerFinished); readConfig(); readSecrets(); // This might be set by readSecrets() so don't connect it until now - connect(d->ui.cmbHosts, static_cast(&QComboBox::currentIndexChanged), this, &OpenconnectAuthWidget::connectHost); + connect(d->ui.cmbHosts, QOverload::of(&QComboBox::currentIndexChanged), this, &OpenconnectAuthWidget::connectHost); KAcceleratorManager::manage(this); } @@ -475,7 +475,7 @@ } } if (sopt == AUTHGROUP_OPT(form)) { - connect(cmb, static_cast(&QComboBox::currentIndexChanged), this, &OpenconnectAuthWidget::formGroupChanged); + connect(cmb, QOverload::of(&QComboBox::currentIndexChanged), this, &OpenconnectAuthWidget::formGroupChanged); } widget = qobject_cast(cmb); } diff --git a/vpn/openvpn/openvpnadvancedwidget.cpp b/vpn/openvpn/openvpnadvancedwidget.cpp --- a/vpn/openvpn/openvpnadvancedwidget.cpp +++ b/vpn/openvpn/openvpnadvancedwidget.cpp @@ -72,9 +72,9 @@ m_ui->proxyPassword->setPasswordOptionsEnabled(true); m_ui->proxyPassword->setPasswordNotRequiredEnabled(true); - connect(m_ui->cbCertCheck, static_cast(&QComboBox::currentIndexChanged), this, &OpenVpnAdvancedWidget::certCheckTypeChanged); - connect(m_ui->cmbProxyType, static_cast(&QComboBox::currentIndexChanged), this, &OpenVpnAdvancedWidget::proxyTypeChanged); - connect(m_ui->cboTLSMode, static_cast(&QComboBox::currentIndexChanged), this, [this] (int index) { + connect(m_ui->cbCertCheck, QOverload::of(&QComboBox::currentIndexChanged), this, &OpenVpnAdvancedWidget::certCheckTypeChanged); + connect(m_ui->cmbProxyType, QOverload::of(&QComboBox::currentIndexChanged), this, &OpenVpnAdvancedWidget::proxyTypeChanged); + connect(m_ui->cboTLSMode, QOverload::of(&QComboBox::currentIndexChanged), this, [this] (int index) { if (index == 0) { m_ui->kurlTlsAuthKey->setDisabled(true); m_ui->cboDirection->setDisabled(true); @@ -95,17 +95,17 @@ d->openvpnCipherProcess = new KProcess(this); d->openvpnCipherProcess->setOutputChannelMode(KProcess::OnlyStdoutChannel); d->openvpnCipherProcess->setReadChannel(QProcess::StandardOutput); - connect(d->openvpnCipherProcess, static_cast(&KProcess::error), this, &OpenVpnAdvancedWidget::openVpnCipherError); + connect(d->openvpnCipherProcess, QOverload::of(&KProcess::error), this, &OpenVpnAdvancedWidget::openVpnCipherError); connect(d->openvpnCipherProcess, &KProcess::readyReadStandardOutput, this, &OpenVpnAdvancedWidget::gotOpenVpnCipherOutput); - connect(d->openvpnCipherProcess, static_cast(&KProcess::finished), this, &OpenVpnAdvancedWidget::openVpnCipherFinished); + connect(d->openvpnCipherProcess, QOverload::of(&KProcess::finished), this, &OpenVpnAdvancedWidget::openVpnCipherFinished); d->openvpnCipherProcess->setProgram(openVpnBinary, ciphersArgs); d->openvpnVersionProcess = new KProcess(this); d->openvpnVersionProcess->setOutputChannelMode(KProcess::OnlyStdoutChannel); d->openvpnVersionProcess->setReadChannel(QProcess::StandardOutput); - connect(d->openvpnVersionProcess, static_cast(&KProcess::error), this, &OpenVpnAdvancedWidget::openVpnVersionError); + connect(d->openvpnVersionProcess, QOverload::of(&KProcess::error), this, &OpenVpnAdvancedWidget::openVpnVersionError); connect(d->openvpnVersionProcess, &KProcess::readyReadStandardOutput, this, &OpenVpnAdvancedWidget::gotOpenVpnVersionOutput); - connect(d->openvpnVersionProcess, static_cast(&KProcess::finished), this, &OpenVpnAdvancedWidget::openVpnVersionFinished); + connect(d->openvpnVersionProcess, QOverload::of(&KProcess::finished), this, &OpenVpnAdvancedWidget::openVpnVersionFinished); d->openvpnVersionProcess->setProgram(openVpnBinary, versionArgs); connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &OpenVpnAdvancedWidget::accept); diff --git a/vpn/ssh/sshwidget.cpp b/vpn/ssh/sshwidget.cpp --- a/vpn/ssh/sshwidget.cpp +++ b/vpn/ssh/sshwidget.cpp @@ -53,7 +53,7 @@ d->ui.le_password->setPasswordOptionsEnabled(true); - connect(d->ui.cmb_authType, static_cast(&QComboBox::currentIndexChanged), this, &SshSettingWidget::authTypeChanged); + connect(d->ui.cmb_authType, QOverload::of(&QComboBox::currentIndexChanged), this, &SshSettingWidget::authTypeChanged); connect(d->ui.btn_advancedOption, &QPushButton::clicked, this, &SshSettingWidget::doAdvancedDialog); d->advancedDlg = new QDialog(this); diff --git a/vpn/vpnc/vpnc.cpp b/vpn/vpnc/vpnc.cpp --- a/vpn/vpnc/vpnc.cpp +++ b/vpn/vpnc/vpnc.cpp @@ -161,8 +161,8 @@ decrPlugin->ciscoDecrypt = new KProcess(decrPlugin); decrPlugin->ciscoDecrypt->setOutputChannelMode(KProcess::OnlyStdoutChannel); decrPlugin->ciscoDecrypt->setReadChannel(QProcess::StandardOutput); - connect(decrPlugin->ciscoDecrypt, static_cast(&KProcess::error), decrPlugin, &VpncUiPluginPrivate::ciscoDecryptError); - connect(decrPlugin->ciscoDecrypt, static_cast(&KProcess::finished), decrPlugin, &VpncUiPluginPrivate::ciscoDecryptFinished); + connect(decrPlugin->ciscoDecrypt, QOverload::of(&KProcess::error), decrPlugin, &VpncUiPluginPrivate::ciscoDecryptError); + connect(decrPlugin->ciscoDecrypt, QOverload::of(&KProcess::finished), decrPlugin, &VpncUiPluginPrivate::ciscoDecryptFinished); connect(decrPlugin->ciscoDecrypt, &KProcess::readyReadStandardOutput, decrPlugin, &VpncUiPluginPrivate::gotCiscoDecryptOutput); NMStringMap data;