Commit d418067e authored by Jan Grulich's avatar Jan Grulich
Browse files

Use Qt5 syntax for all signals/slots

REVIEW:123474
parent 649345e7
......@@ -98,10 +98,8 @@ ConnectionEditor::ConnectionEditor(QWidget* parent, Qt::WindowFlags flags)
connect(m_editor->connectionsWidget->selectionModel(), &QItemSelectionModel::currentChanged, this, &ConnectionEditor::slotSelectionChanged);
connect(m_editor->connectionsWidget, &QTreeView::doubleClicked, this, &ConnectionEditor::slotItemDoubleClicked);
connect(m_editor->connectionsWidget, &QTreeView::customContextMenuRequested, this, &ConnectionEditor::slotContextMenuRequested);
connect(m_menu->menu(), SIGNAL(triggered(QAction*)),
SLOT(addConnection(QAction*)));
connect(NetworkManager::settingsNotifier(), SIGNAL(connectionAdded(QString)),
SLOT(connectionAdded(QString)));
connect(m_menu->menu(), &QMenu::triggered, this, static_cast<void (ConnectionEditor::*)(QAction*)>(&ConnectionEditor::addConnection));
connect(NetworkManager::settingsNotifier(), &NetworkManager::SettingsNotifier::connectionAdded, this, &ConnectionEditor::connectionAdded);
QLoggingCategory::setFilterRules(QStringLiteral("plasma-nm.debug = false"));
QLoggingCategory::setFilterRules(QStringLiteral("plasma-nm.warning = true"));
......@@ -228,7 +226,6 @@ void ConnectionEditor::initializeMenu()
KStandardAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), actionCollection());
KStandardAction::quit(this, SLOT(close()), actionCollection());
setupGUI(QSize(480, 480));
setAutoSaveSettings();
......@@ -362,7 +359,7 @@ void ConnectionEditor::connectionAdded(const QString& connection)
m_editor->messageWidget->animatedShow();
m_editor->messageWidget->setMessageType(KMessageWidget::Positive);
m_editor->messageWidget->setText(i18n("Connection %1 has been added", con->name()));
QTimer::singleShot(5000, m_editor->messageWidget, SLOT(animatedHide()));
QTimer::singleShot(5000, m_editor->messageWidget, &KMessageWidget::animatedHide);
}
void ConnectionEditor::connectConnection()
......@@ -633,7 +630,7 @@ void ConnectionEditor::importVpn()
m_editor->messageWidget->animatedShow();
m_editor->messageWidget->setMessageType(KMessageWidget::Error);
m_editor->messageWidget->setText(i18n("Importing VPN connection %1 failed\n%2", fi.fileName(), vpnPlugin->lastErrorMessage()));
QTimer::singleShot(5000, m_editor->messageWidget, SLOT(animatedHide()));
QTimer::singleShot(5000, m_editor->messageWidget, &KMessageWidget::animatedHide);
} else {
delete vpnPlugin;
break; // stop iterating over the plugins if the import produced at least some output
......@@ -677,7 +674,7 @@ void ConnectionEditor::exportVpn()
m_editor->messageWidget->animatedShow();
m_editor->messageWidget->setMessageType(KMessageWidget::Error);
m_editor->messageWidget->setText(i18n("Export is not supported by this VPN type"));
QTimer::singleShot(5000, m_editor->messageWidget, SLOT(animatedHide()));
QTimer::singleShot(5000, m_editor->messageWidget, &KMessageWidget::animatedHide);
return;
}
......@@ -688,12 +685,12 @@ void ConnectionEditor::exportVpn()
m_editor->messageWidget->animatedShow();
m_editor->messageWidget->setMessageType(KMessageWidget::Error);
m_editor->messageWidget->setText(i18n("Exporting VPN connection %1 failed\n%2", connection->name(), vpnPlugin->lastErrorMessage()));
QTimer::singleShot(5000, m_editor->messageWidget, SLOT(animatedHide()));
QTimer::singleShot(5000, m_editor->messageWidget, &KMessageWidget::animatedHide);
} else {
m_editor->messageWidget->animatedShow();
m_editor->messageWidget->setMessageType(KMessageWidget::Positive);
m_editor->messageWidget->setText(i18n("VPN connection %1 exported successfully", connection->name()));
QTimer::singleShot(5000, m_editor->messageWidget, SLOT(animatedHide()));
QTimer::singleShot(5000, m_editor->messageWidget, &KMessageWidget::animatedHide);
}
}
delete vpnPlugin;
......
......@@ -47,7 +47,7 @@ ModemMonitor::ModemMonitor(QObject * parent)
Q_D(ModemMonitor);
d->dialog.clear();
QObject::connect(ModemManager::notifier(), SIGNAL(modemAdded(QString)), SLOT(unlockModem(QString)));
connect(ModemManager::notifier(), &ModemManager::Notifier::modemAdded, this, &ModemMonitor::unlockModem);
Q_FOREACH (const ModemManager::ModemDevice::Ptr &iface, ModemManager::modemDevices()) {
unlockModem(iface->uni());
}
......@@ -70,7 +70,7 @@ void ModemMonitor::unlockModem(const QString &modemUni)
return;
}
connect(modem.data(), SIGNAL(unlockRequiredChanged(MMModemLock)), SLOT(requestPin(MMModemLock)), Qt::UniqueConnection);
connect(modem.data(), &ModemManager::Modem::unlockRequiredChanged, this, &ModemMonitor::requestPin, Qt::UniqueConnection);
if (d->dialog || (modem && modem->unlockRequired() == MM_MODEM_LOCK_NONE) || (modem && modem->unlockRequired() == MM_MODEM_LOCK_UNKNOWN)) {
return;
......@@ -169,7 +169,7 @@ void ModemMonitor::requestPin(MMModemLock lock)
watcher = new QDBusPendingCallWatcher(reply, sim.data());
}
connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), SLOT(onSendPinArrived(QDBusPendingCallWatcher*)));
connect(watcher, &QDBusPendingCallWatcher::finished, this, &ModemMonitor::onSendPinArrived);
}
OUT:
......
......@@ -42,14 +42,14 @@ Notification::Notification(QObject *parent) :
addDevice(device);
}
connect(NetworkManager::notifier(), SIGNAL(deviceAdded(QString)), this, SLOT(deviceAdded(QString)));
connect(NetworkManager::notifier(), &NetworkManager::Notifier::deviceAdded, this, &Notification::deviceAdded);
// connections
Q_FOREACH (const NetworkManager::ActiveConnection::Ptr &ac, NetworkManager::activeConnections()) {
addActiveConnection(ac);
}
connect(NetworkManager::notifier(), SIGNAL(activeConnectionAdded(QString)), this, SLOT(addActiveConnection(QString)));
connect(NetworkManager::notifier(), &NetworkManager::Notifier::activeConnectionAdded, this, static_cast<void (Notification::*)(const QString&)>(&Notification::addActiveConnection));
}
void Notification::deviceAdded(const QString &uni)
......@@ -60,8 +60,7 @@ void Notification::deviceAdded(const QString &uni)
void Notification::addDevice(const NetworkManager::Device::Ptr &device)
{
connect(device.data(), SIGNAL(stateChanged(NetworkManager::Device::State,NetworkManager::Device::State,NetworkManager::Device::StateChangeReason)),
this, SLOT(stateChanged(NetworkManager::Device::State,NetworkManager::Device::State,NetworkManager::Device::StateChangeReason)));
connect(device.data(), &NetworkManager::Device::stateChanged, this, &Notification::stateChanged);
}
void Notification::stateChanged(NetworkManager::Device::State newstate, NetworkManager::Device::State oldstate, NetworkManager::Device::StateChangeReason reason)
......@@ -315,7 +314,7 @@ void Notification::stateChanged(NetworkManager::Device::State newstate, NetworkM
notify->update();
} else {
KNotification *notify = new KNotification("DeviceFailed", KNotification::CloseOnTimeout, this);
connect(notify, SIGNAL(closed()), this, SLOT(notificationClosed()));
connect(notify, &KNotification::closed, this, &Notification::notificationClosed);
notify->setProperty("uni", device->uni());
notify->setComponentName("networkmanagement");
notify->setPixmap(QIcon::fromTheme("dialog-warning").pixmap(KIconLoader::SizeHuge));
......@@ -338,15 +337,13 @@ void Notification::addActiveConnection(const NetworkManager::ActiveConnection::P
{
if (ac->vpn()) {
NetworkManager::VpnConnection::Ptr vpnConnection = ac.objectCast<NetworkManager::VpnConnection>();
connect(vpnConnection.data(), SIGNAL(stateChanged(NetworkManager::VpnConnection::State,NetworkManager::VpnConnection::StateChangeReason)),
this, SLOT(onVpnConnectionStateChanged(NetworkManager::VpnConnection::State,NetworkManager::VpnConnection::StateChangeReason)));
connect(vpnConnection.data(), &NetworkManager::VpnConnection::stateChanged, this, &Notification::onVpnConnectionStateChanged);
#if NM_CHECK_VERSION(0, 9, 10)
} else if (ac->type() != NetworkManager::ConnectionSettings::Generic) {
#else
} else {
#endif
connect(ac.data(), SIGNAL(stateChanged(NetworkManager::ActiveConnection::State)),
this, SLOT(onActiveConnectionStateChanged(NetworkManager::ActiveConnection::State)));
connect(ac.data(), &NetworkManager::ActiveConnection::stateChanged, this, &Notification::onActiveConnectionStateChanged);
}
}
......@@ -370,7 +367,7 @@ void Notification::onActiveConnectionStateChanged(NetworkManager::ActiveConnecti
}
KNotification *notify = new KNotification(eventId, KNotification::CloseOnTimeout, this);
connect(notify, SIGNAL(closed()), this, SLOT(notificationClosed()));
connect(notify, &KNotification::closed, this, &Notification::notificationClosed);
notify->setProperty("uni", connectionId);
notify->setComponentName("networkmanagement");
if (state == NetworkManager::ActiveConnection::Activated) {
......@@ -444,7 +441,7 @@ void Notification::onVpnConnectionStateChanged(NetworkManager::VpnConnection::St
}
KNotification *notify = new KNotification(eventId, KNotification::CloseOnTimeout, this);
connect(notify, SIGNAL(closed()), this, SLOT(notificationClosed()));
connect(notify, &KNotification::closed, this, &Notification::notificationClosed);
notify->setProperty("uni", connectionId);
notify->setComponentName("networkmanagement");
if (state == NetworkManager::VpnConnection::Activated) {
......
......@@ -44,10 +44,8 @@ AvailableDevices::AvailableDevices(QObject* parent)
}
}
connect(NetworkManager::notifier(), SIGNAL(deviceAdded(QString)),
SLOT(deviceAdded(QString)));
connect(NetworkManager::notifier(), SIGNAL(deviceRemoved(QString)),
SLOT(deviceRemoved()));
connect(NetworkManager::notifier(), &NetworkManager::Notifier::deviceAdded, this, &AvailableDevices::deviceAdded);
connect(NetworkManager::notifier(), &NetworkManager::Notifier::deviceRemoved, this, &AvailableDevices::deviceRemoved);
}
AvailableDevices::~AvailableDevices()
......
......@@ -46,45 +46,30 @@ ConnectionIcon::ConnectionIcon(QObject* parent)
, m_modemNetwork(0)
#endif
{
connect(NetworkManager::notifier(), SIGNAL(primaryConnectionChanged(QString)),
SLOT(primaryConnectionChanged(QString)));
connect(NetworkManager::notifier(), SIGNAL(activatingConnectionChanged(QString)),
SLOT(activatingConnectionChanged(QString)));
connect(NetworkManager::notifier(), SIGNAL(activeConnectionAdded(QString)),
SLOT(activeConnectionAdded(QString)));
connect(NetworkManager::notifier(), SIGNAL(connectivityChanged(NetworkManager::Connectivity)),
SLOT(connectivityChanged()));
connect(NetworkManager::notifier(), SIGNAL(deviceAdded(QString)),
SLOT(deviceAdded(QString)));
connect(NetworkManager::notifier(), SIGNAL(deviceRemoved(QString)),
SLOT(deviceRemoved(QString)));
connect(NetworkManager::notifier(), SIGNAL(networkingEnabledChanged(bool)),
SLOT(networkingEnabledChanged(bool)));
connect(NetworkManager::notifier(), SIGNAL(statusChanged(NetworkManager::Status)),
SLOT(statusChanged(NetworkManager::Status)));
connect(NetworkManager::notifier(), SIGNAL(wirelessEnabledChanged(bool)),
SLOT(wirelessEnabledChanged(bool)));
connect(NetworkManager::notifier(), SIGNAL(wirelessHardwareEnabledChanged(bool)),
SLOT(wirelessEnabledChanged(bool)));
connect(NetworkManager::notifier(), SIGNAL(wwanEnabledChanged(bool)),
SLOT(wwanEnabledChanged(bool)));
connect(NetworkManager::notifier(), SIGNAL(wwanHardwareEnabledChanged(bool)),
SLOT(wwanEnabledChanged(bool)));
connect(NetworkManager::notifier(), &NetworkManager::Notifier::primaryConnectionChanged, this, &ConnectionIcon::primaryConnectionChanged);
connect(NetworkManager::notifier(), &NetworkManager::Notifier::activatingConnectionChanged, this, &ConnectionIcon::activatingConnectionChanged);
connect(NetworkManager::notifier(), &NetworkManager::Notifier::activeConnectionAdded, this, &ConnectionIcon::activeConnectionAdded);
connect(NetworkManager::notifier(), &NetworkManager::Notifier::connectivityChanged, this, &ConnectionIcon::connectivityChanged);
connect(NetworkManager::notifier(), &NetworkManager::Notifier::deviceAdded, this, &ConnectionIcon::deviceAdded);
connect(NetworkManager::notifier(), &NetworkManager::Notifier::deviceRemoved, this, &ConnectionIcon::deviceRemoved);
connect(NetworkManager::notifier(), &NetworkManager::Notifier::networkingEnabledChanged, this, &ConnectionIcon::networkingEnabledChanged);
connect(NetworkManager::notifier(), &NetworkManager::Notifier::statusChanged, this, &ConnectionIcon::statusChanged);
connect(NetworkManager::notifier(), &NetworkManager::Notifier::wirelessEnabledChanged, this, &ConnectionIcon::wirelessEnabledChanged);
connect(NetworkManager::notifier(), &NetworkManager::Notifier::wirelessHardwareEnabledChanged, this, &ConnectionIcon::wirelessEnabledChanged);
connect(NetworkManager::notifier(), &NetworkManager::Notifier::wwanEnabledChanged, this, &ConnectionIcon::wwanEnabledChanged);
connect(NetworkManager::notifier(), &NetworkManager::Notifier::wwanHardwareEnabledChanged, this, &ConnectionIcon::wwanEnabledChanged);
Q_FOREACH (NetworkManager::Device::Ptr device, NetworkManager::networkInterfaces()) {
if (device->type() == NetworkManager::Device::Ethernet) {
NetworkManager::WiredDevice::Ptr wiredDevice = device.staticCast<NetworkManager::WiredDevice>();
if (wiredDevice) {
connect(wiredDevice.data(), SIGNAL(carrierChanged(bool)),
SLOT(carrierChanged(bool)));
connect(wiredDevice.data(), &NetworkManager::WiredDevice::carrierChanged, this, &ConnectionIcon::carrierChanged);
}
} else if (device->type() == NetworkManager::Device::Wifi) {
NetworkManager::WirelessDevice::Ptr wifiDevice = device.staticCast<NetworkManager::WirelessDevice>();
if (wifiDevice) {
connect(wifiDevice.data(), SIGNAL(availableConnectionAppeared(QString)),
SLOT(wirelessNetworkAppeared(QString)));
connect(wifiDevice.data(), SIGNAL(networkAppeared(QString)),
SLOT(wirelessNetworkAppeared(QString)));
connect(wifiDevice.data(), &NetworkManager::WirelessDevice::availableConnectionAppeared, this, &ConnectionIcon::wirelessNetworkAppeared);
connect(wifiDevice.data(), &NetworkManager::WirelessDevice::networkAppeared, this, &ConnectionIcon::wirelessNetworkAppeared);
}
}
}
......@@ -136,15 +121,12 @@ void ConnectionIcon::addActiveConnection(const QString &activeConnection)
if (active) {
NetworkManager::VpnConnection::Ptr vpnConnection;
connect(active.data(), SIGNAL(destroyed(QObject*)),
SLOT(activeConnectionDestroyed()));
connect(active.data(), &NetworkManager::ActiveConnection::destroyed, this, &ConnectionIcon::activeConnectionDestroyed);
if (active->vpn()) {
vpnConnection = active.objectCast<NetworkManager::VpnConnection>();
connect(vpnConnection.data(), SIGNAL(stateChanged(NetworkManager::VpnConnection::State,NetworkManager::VpnConnection::StateChangeReason)),
SLOT(vpnConnectionStateChanged(NetworkManager::VpnConnection::State,NetworkManager::VpnConnection::StateChangeReason)), Qt::UniqueConnection);
connect(vpnConnection.data(), &NetworkManager::VpnConnection::stateChanged, this, &ConnectionIcon::vpnConnectionStateChanged);
} else {
connect(active.data(), SIGNAL(stateChanged(NetworkManager::ActiveConnection::State)),
SLOT(activeConnectionStateChanged(NetworkManager::ActiveConnection::State)), Qt::UniqueConnection);
connect(active.data(), &NetworkManager::ActiveConnection::stateChanged, this, &ConnectionIcon::activeConnectionStateChanged, Qt::UniqueConnection);
}
}
}
......@@ -191,8 +173,7 @@ void ConnectionIcon::deviceAdded(const QString& device)
if (dev->type() == NetworkManager::Device::Ethernet) {
NetworkManager::WiredDevice::Ptr wiredDev = dev.objectCast<NetworkManager::WiredDevice>();
connect(wiredDev.data(), SIGNAL(carrierChanged(bool)),
SLOT(carrierChanged(bool)));
connect(wiredDev.data(), &NetworkManager::WiredDevice::carrierChanged, this, &ConnectionIcon::carrierChanged);
}
}
......@@ -211,13 +192,13 @@ void ConnectionIcon::modemNetworkRemoved()
m_modemNetwork.clear();
}
void ConnectionIcon::modemSignalChanged(uint signal)
void ConnectionIcon::modemSignalChanged(const ModemManager::SignalQualityPair &signalQuality)
{
int diff = m_signal - signal;
int diff = m_signal - signalQuality.signal;
if (diff >= 10 ||
diff <= -10) {
m_signal = signal;
m_signal = signalQuality.signal;
setIconForModem();
}
......@@ -486,12 +467,9 @@ void ConnectionIcon::setModemIcon(const NetworkManager::Device::Ptr & device)
}
if (m_modemNetwork) {
connect(m_modemNetwork.data(), SIGNAL(signalQualityChanged(uint)),
SLOT(modemSignalChanged(uint)), Qt::UniqueConnection);
connect(m_modemNetwork.data(), SIGNAL(accessTechnologyChanged(ModemManager::Modem::AccessTechnologies)),
SLOT(setIconForModem()), Qt::UniqueConnection);
connect(m_modemNetwork.data(), SIGNAL(destroyed(QObject*)),
SLOT(modemNetworkRemoved()));
connect(m_modemNetwork.data(), &ModemManager::Modem::signalQualityChanged, this, &ConnectionIcon::modemSignalChanged, Qt::UniqueConnection);
connect(m_modemNetwork.data(), &ModemManager::Modem::accessTechnologiesChanged, this, &ConnectionIcon::setIconForModem, Qt::UniqueConnection);
connect(m_modemNetwork.data(), &ModemManager::Modem::destroyed, this, &ConnectionIcon::modemNetworkRemoved);
m_signal = m_modemNetwork->signalQuality().signal;
setIconForModem();
......@@ -572,8 +550,7 @@ void ConnectionIcon::setWirelessIcon(const NetworkManager::Device::Ptr &device,
}
if (m_wirelessNetwork) {
connect(m_wirelessNetwork.data(), SIGNAL(signalStrengthChanged(int)),
SLOT(setWirelessIconForSignalStrength(int)), Qt::UniqueConnection);
connect(m_wirelessNetwork.data(), &NetworkManager::WirelessNetwork::signalStrengthChanged, this, &ConnectionIcon::setWirelessIconForSignalStrength, Qt::UniqueConnection);
setWirelessIconForSignalStrength(m_wirelessNetwork->signalStrength());
} else {
......
......@@ -58,7 +58,7 @@ private Q_SLOTS:
void primaryConnectionChanged(const QString & connection);
#if WITH_MODEMMANAGER_SUPPORT
void modemNetworkRemoved();
void modemSignalChanged(uint signal);
void modemSignalChanged(const ModemManager::SignalQualityPair &signalQuality);
void setIconForModem();
#endif
void statusChanged(NetworkManager::Status status);
......
......@@ -33,20 +33,13 @@ EnabledConnections::EnabledConnections(QObject* parent)
, m_wwanEnabled(NetworkManager::isWwanEnabled())
, m_wwanHwEnabled(NetworkManager::isWwanHardwareEnabled())
{
connect(NetworkManager::notifier(), SIGNAL(networkingEnabledChanged(bool)),
SLOT(onNetworkingEnabled(bool)));
connect(NetworkManager::notifier(), SIGNAL(wirelessEnabledChanged(bool)),
SLOT(onWirelessEnabled(bool)));
connect(NetworkManager::notifier(), SIGNAL(wirelessHardwareEnabledChanged(bool)),
SLOT(onWirelessHwEnabled(bool)));
connect(NetworkManager::notifier(), SIGNAL(wimaxEnabledChanged(bool)),
SLOT(onWimaxEnabled(bool)));
connect(NetworkManager::notifier(), SIGNAL(wimaxHardwareEnabledChanged(bool)),
SLOT(onWimaxHwEnabled(bool)));
connect(NetworkManager::notifier(), SIGNAL(wwanEnabledChanged(bool)),
SLOT(onWwanEnabled(bool)));
connect(NetworkManager::notifier(), SIGNAL(wwanHardwareEnabledChanged(bool)),
SLOT(onWwanHwEnabled(bool)));
connect(NetworkManager::notifier(), &NetworkManager::Notifier::networkingEnabledChanged, this, &EnabledConnections::onNetworkingEnabled);
connect(NetworkManager::notifier(), &NetworkManager::Notifier::wirelessEnabledChanged, this, &EnabledConnections::onWirelessEnabled);
connect(NetworkManager::notifier(), &NetworkManager::Notifier::wirelessHardwareEnabledChanged, this, &EnabledConnections::onWirelessHwEnabled);
connect(NetworkManager::notifier(), &NetworkManager::Notifier::wimaxEnabledChanged, this, &EnabledConnections::onWimaxEnabled);
connect(NetworkManager::notifier(), &NetworkManager::Notifier::wimaxHardwareEnabledChanged, this, &EnabledConnections::onWimaxHwEnabled);
connect(NetworkManager::notifier(), &NetworkManager::Notifier::wwanEnabledChanged, this, &EnabledConnections::onWwanEnabled);
connect(NetworkManager::notifier(), &NetworkManager::Notifier::wwanHardwareEnabledChanged, this, &EnabledConnections::onWwanHwEnabled);
}
EnabledConnections::~EnabledConnections()
......
......@@ -31,10 +31,8 @@
NetworkStatus::NetworkStatus(QObject* parent)
: QObject(parent)
{
connect(NetworkManager::notifier(), SIGNAL(statusChanged(NetworkManager::Status)),
SLOT(statusChanged(NetworkManager::Status)));
connect(NetworkManager::notifier(), SIGNAL(activeConnectionsChanged()),
SLOT(activeConnectionsChanged()));
connect(NetworkManager::notifier(), &NetworkManager::Notifier::statusChanged, this, &NetworkStatus::statusChanged);
connect(NetworkManager::notifier(), &NetworkManager::Notifier::activeConnectionsChanged, this, static_cast<void (NetworkStatus::*)(void)>(&NetworkStatus::activeConnectionsChanged));
activeConnectionsChanged();
statusChanged(NetworkManager::status());
......@@ -57,12 +55,9 @@ QString NetworkStatus::networkStatus() const
void NetworkStatus::activeConnectionsChanged()
{
Q_FOREACH (const NetworkManager::ActiveConnection::Ptr & active, NetworkManager::activeConnections()) {
connect(active.data(), SIGNAL(default4Changed(bool)),
SLOT(defaultChanged()), Qt::UniqueConnection);
connect(active.data(), SIGNAL(default6Changed(bool)),
SLOT(defaultChanged()), Qt::UniqueConnection);
connect(active.data(), SIGNAL(stateChanged(NetworkManager::ActiveConnection::State)),
SLOT(changeActiveConnections()));
connect(active.data(), &NetworkManager::ActiveConnection::default4Changed, this, &NetworkStatus::defaultChanged, Qt::UniqueConnection);
connect(active.data(), &NetworkManager::ActiveConnection::default6Changed, this, &NetworkStatus::defaultChanged, Qt::UniqueConnection);
connect(active.data(), &NetworkManager::ActiveConnection::stateChanged, this, &NetworkStatus::changeActiveConnections);
}
changeActiveConnections();
......
......@@ -73,7 +73,7 @@ TrafficMonitor::TrafficMonitor(QGraphicsItem* parent)
Plasma::DataEngineManager::self()->loadEngine("systemmonitor");
connect(m_traffic, SIGNAL(heightChanged()), this, SIGNAL(heightChanged()));
connect(m_traffic, &Plasma::Label::heightChanged, this, &TrafficMonitor::heightChanged);
}
TrafficMonitor::~TrafficMonitor()
......
......@@ -52,9 +52,9 @@ BondWidget::BondWidget(const QString & masterUuid, const NetworkManager::Setting
action->setData(NetworkManager::ConnectionSettings::Infiniband);
m_menu->addAction(action);
m_ui->btnAdd->setMenu(m_menu);
connect(m_menu, SIGNAL(triggered(QAction*)), SLOT(addBond(QAction*)));
connect(m_ui->btnEdit, SIGNAL(clicked()), SLOT(editBond()));
connect(m_ui->btnDelete, SIGNAL(clicked()), SLOT(deleteBond()));
connect(m_menu, &QMenu::triggered, this, &BondWidget::addBond);
connect(m_ui->btnEdit, &QPushButton::clicked, this, &BondWidget::editBond);
connect(m_ui->btnDelete, &QPushButton::clicked, this, &BondWidget::deleteBond);
// mode
m_ui->mode->addItem(i18nc("bond mode", "Round-robin"), QLatin1String("balance-rr"));
......@@ -70,12 +70,12 @@ BondWidget::BondWidget(const QString & masterUuid, const NetworkManager::Setting
// bonds
populateBonds();
connect(m_ui->bonds, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), SLOT(currentBondChanged(QListWidgetItem*,QListWidgetItem*)));
connect(m_ui->bonds, SIGNAL(itemDoubleClicked(QListWidgetItem*)), SLOT(editBond()));
connect(m_ui->bonds, &QListWidget::currentItemChanged, this, &BondWidget::currentBondChanged);
connect(m_ui->bonds, &QListWidget::itemDoubleClicked, this, &BondWidget::editBond);
connect(m_ui->ifaceName, SIGNAL(textChanged(QString)), SLOT(slotWidgetChanged()));
connect(m_ui->arpTargets, SIGNAL(textChanged(QString)), SLOT(slotWidgetChanged()));
connect(m_ui->linkMonitoring, SIGNAL(currentIndexChanged(int)), SLOT(slotWidgetChanged()));
connect(m_ui->ifaceName, &KLineEdit::textChanged, this, &BondWidget::slotWidgetChanged);
connect(m_ui->arpTargets, &KLineEdit::textChanged, this, &BondWidget::slotWidgetChanged);
connect(m_ui->linkMonitoring, static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &BondWidget::slotWidgetChanged);
KAcceleratorManager::manage(this);
KAcceleratorManager::manage(m_menu);
......@@ -235,7 +235,7 @@ void BondWidget::editBond()
connect(bondEditor.data(), &ConnectionDetailEditor::accepted,
[connection, bondEditor, this] () {
connection->update(bondEditor->setting());
connect(connection.data(), SIGNAL(updated()), this, SLOT(populateBonds()));
connect(connection.data(), &NetworkManager::Connection::updated, this, &BondWidget::populateBonds);
});
connect(bondEditor.data(), &ConnectionDetailEditor::finished,
[bondEditor] () {
......
......@@ -52,16 +52,16 @@ BridgeWidget::BridgeWidget(const QString & masterUuid, const NetworkManager::Set
action->setData(NetworkManager::ConnectionSettings::Wireless);
m_menu->addAction(action);
m_ui->btnAdd->setMenu(m_menu);
connect(m_menu, SIGNAL(triggered(QAction*)), SLOT(addBridge(QAction*)));
connect(m_ui->btnEdit, SIGNAL(clicked()), SLOT(editBridge()));
connect(m_ui->btnDelete, SIGNAL(clicked()), SLOT(deleteBridge()));
connect(m_menu, &QMenu::triggered, this, &BridgeWidget::addBridge);
connect(m_ui->btnEdit, &QPushButton::clicked, this, &BridgeWidget::editBridge);
connect(m_ui->btnDelete, &QPushButton::clicked, this, &BridgeWidget::deleteBridge);
// bridges
populateBridges();
connect(m_ui->bridges, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), SLOT(currentBridgeChanged(QListWidgetItem*,QListWidgetItem*)));
connect(m_ui->bridges, SIGNAL(itemDoubleClicked(QListWidgetItem*)), SLOT(editBridge()));
connect(m_ui->bridges, &QListWidget::currentItemChanged, this, &BridgeWidget::currentBridgeChanged);
connect(m_ui->bridges, &QListWidget::itemDoubleClicked, this, &BridgeWidget::editBridge);
connect(m_ui->ifaceName, SIGNAL(textChanged(QString)), SLOT(slotWidgetChanged()));
connect(m_ui->ifaceName, &KLineEdit::textChanged, this, &BridgeWidget::slotWidgetChanged);
KAcceleratorManager::manage(this);
KAcceleratorManager::manage(m_menu);
......@@ -185,7 +185,7 @@ void BridgeWidget::editBridge()
connect(bridgeEditor.data(), &ConnectionDetailEditor::accepted,
[connection, bridgeEditor, this] () {
connection->update(bridgeEditor->setting());
connect(connection.data(), SIGNAL(updated()), this, SLOT(populateBridges()));
connect(connection.data(), &NetworkManager::Connection::updated, this, &BridgeWidget::populateBridges);
});
connect(bridgeEditor.data(), &ConnectionDetailEditor::finished,
[bridgeEditor] () {
......
......@@ -37,7 +37,7 @@ BtWidget::BtWidget(const NetworkManager::Setting::Ptr &setting, QWidget* parent,
m_ui->type->setEnabled(false);
connect(m_ui->bdaddr, SIGNAL(hwAddressChanged()), SLOT(slotWidgetChanged()));
connect(m_ui->bdaddr, &HwAddrComboBox::hwAddressChanged, this, &BtWidget::slotWidgetChanged);
KAcceleratorManager::manage(this);
......
......@@ -29,13 +29,13 @@ CdmaWidget::CdmaWidget(const NetworkManager::Setting::Ptr &setting, QWidget* par
{
m_ui->setupUi(this);
connect(m_ui->cbShowPassword, SIGNAL(toggled(bool)), SLOT(showPassword(bool)));
connect(m_ui->passwordStorage, SIGNAL(currentIndexChanged(int)), SLOT(passwordStorageChanged(int)));
connect(m_ui->cbShowPassword, &QCheckBox::toggled, this, &CdmaWidget::showPassword);
connect(m_ui->passwordStorage, static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &CdmaWidget::passwordStorageChanged);
connect(m_ui->number, SIGNAL(textChanged(QString)), SLOT(slotWidgetChanged()));
connect(m_ui->password, SIGNAL(textChanged(QString)), SLOT(slotWidgetChanged()));
connect(m_ui->passwordStorage, SIGNAL(currentIndexChanged(int)), SLOT(slotWidgetChanged()));
connect(m_ui->username, SIGNAL(textChanged(QString)), SLOT(slotWidgetChanged()));
connect(m_ui->number, &KLineEdit::textChanged, this, &CdmaWidget::slotWidgetChanged);
connect(m_ui->password, &KLineEdit::textChanged, this, &CdmaWidget::slotWidgetChanged);
connect(m_ui->passwordStorage, static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &CdmaWidget::slotWidgetChanged);
connect(m_ui->username, &KLineEdit::textChanged, this, &CdmaWidget::slotWidgetChanged);
KAcceleratorManager::manage(this);
......
......@@ -56,7 +56,7 @@ ConnectionWidget::ConnectionWidget(const NetworkManager::ConnectionSettings::Ptr
m_widget->autoconnect->setEnabled(true);
}
connect(m_widget->autoconnectVpn, SIGNAL(toggled(bool)), SLOT(autoVpnToggled(bool)));
connect(m_widget->autoconnectVpn, &QCheckBox::toggled, this, &ConnectionWidget::autoVpnToggled);
if (NetworkManager::compareVersion(QLatin1String("1.0.0")) >= 0) {
m_widget->prioritySpin->setEnabled(true);
......@@ -74,8 +74,7 @@ ConnectionWidget::ConnectionWidget(const NetworkManager::ConnectionSettings::Ptr
KAcceleratorManager::manage(this);
connect(m_widget->pushButtonPermissions, SIGNAL(clicked(bool)),
SLOT(openAdvancedPermissions()));
connect(m_widget->pushButtonPermissions, &QPushButton::clicked, this, &ConnectionWidget::openAdvancedPermissions);
}
ConnectionWidget::~ConnectionWidget()
......
......@@ -43,16 +43,16 @@ GsmWidget::GsmWidget(const NetworkManager::Setting::Ptr &setting, QWidget* paren
m_ui->type->addItem(i18n("Prefer 4G (LTE)"), NetworkManager::GsmSetting::Prefer4GLte);
m_ui->type->addItem(i18n("4G Only (LTE)"), NetworkManager::GsmSetting::Only4GLte);
connect(m_ui->cbShowPasswords, SIGNAL(toggled(bool)), SLOT(showPasswords(bool)));
connect(m_ui->pinStorage, SIGNAL(currentIndexChanged(int)), SLOT(pinStorageChanged(int)));
connect(m_ui->passwordStorage, SIGNAL(currentIndexChanged(int)), SLOT(passwordStorageChanged(int)));
connect(m_ui->apn, SIGNAL(textChanged(QString)), SLOT(slotWidgetChanged()));
connect(m_ui->password, SIGNAL(textChanged(QString)), SLOT(slotWidgetChanged()));
connect(m_ui->pin, SIGNAL(textChanged(QString)), SLOT(slotWidgetChanged()));
connect(m_ui->username, SIGNAL(textChanged(QString)), SLOT(slotWidgetChanged()));
connect(m_ui->passwordStorage, SIGNAL(currentIndexChanged(int)), SLOT(slotWidgetChanged()));
connect(m_ui->pinStorage, SIGNAL(currentIndexChanged(int)), SLOT(slotWidgetChanged()));
connect(m_ui->cbShowPasswords, &QCheckBox::toggled, this, &GsmWidget::showPasswords);
connect(m_ui->pinStorage, static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &GsmWidget::pinStorageChanged);
connect(m_ui->passwordStorage, static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &GsmWidget::passwordStorageChanged);
connect(m_ui->apn, &KLineEdit::textChanged, this, &GsmWidget::slotWidgetChanged);
connect(m_ui->password, &KLineEdit::textChanged, this, &GsmWidget::slotWidgetChanged);
connect(m_ui->pin, &KLineEdit::textChanged, this, &GsmWidget::slotWidgetChanged);
connect(m_ui->username, &KLineEdit::textChanged, this, &GsmWidget::slotWidgetChanged);
connect(m_ui->passwordStorage, static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &GsmWidget::slotWidgetChanged);
connect(m_ui->pinStorage, static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &GsmWidget::slotWidgetChanged);
KAcceleratorManager::manage(this);
......
......@@ -37,7 +37,7 @@ InfinibandWidget::InfinibandWidget(const NetworkManager::Setting::Ptr &setting,
m_ui->transport->addItem(i18nc("infiniband transport mode", "Connected"), NetworkManager::InfinibandSetting::Connected);
m_ui->transport->setCurrentIndex(0);
connect(m_ui->macAddress, SIGNAL(hwAddressChanged()), SLOT(slotWidgetChanged()));
connect(m_ui->macAddress, &HwAddrComboBox::hwAddressChanged, this, &InfinibandWidget::slotWidgetChanged);
KAcceleratorManager::manage(this);
......