Commit 3ba931f7 authored by David Edmundson's avatar David Edmundson
Browse files

Port connects to the new format

This commit was created by clazy
parent 2e5512d0
......@@ -53,12 +53,12 @@ BrightnessControl::BrightnessControl(QObject* parent)
QAction* globalAction = actionCollection->addAction(QLatin1String("Increase Screen Brightness"));
globalAction->setText(i18nc("@action:inmenu Global shortcut", "Increase Screen Brightness"));
KGlobalAccel::setGlobalShortcut(globalAction, Qt::Key_MonBrightnessUp);
connect(globalAction, SIGNAL(triggered(bool)), SLOT(increaseBrightness()));
connect(globalAction, &QAction::triggered, this, &BrightnessControl::increaseBrightness);
globalAction = actionCollection->addAction(QLatin1String("Decrease Screen Brightness"));
globalAction->setText(i18nc("@action:inmenu Global shortcut", "Decrease Screen Brightness"));
KGlobalAccel::setGlobalShortcut(globalAction, Qt::Key_MonBrightnessDown);
connect(globalAction, SIGNAL(triggered(bool)), SLOT(decreaseBrightness()));
connect(globalAction, &QAction::triggered, this, &BrightnessControl::decreaseBrightness);
}
void BrightnessControl::onProfileUnload()
......
......@@ -69,7 +69,7 @@ QList< QPair< QString, QWidget* > > BrightnessControlConfig::buildUi()
QList< QPair< QString, QWidget* > > retlist;
retlist.append(qMakePair< QString, QWidget* >(i18nc("Brightness level, label for the slider", "Level"), tempWidget));
connect(m_slider, SIGNAL(valueChanged(int)), this, SLOT(setChanged()));
connect(m_slider, &QAbstractSlider::valueChanged, this, &BrightnessControlConfig::setChanged);
return retlist;
}
......
......@@ -51,8 +51,8 @@ HandleButtonEvents::HandleButtonEvents(QObject *parent)
new HandleButtonEventsAdaptor(this);
// We enforce no policies here - after all, we just call other actions - which have their policies.
setRequiredPolicies(PowerDevil::PolicyAgent::None);
connect(backend(), SIGNAL(buttonPressed(PowerDevil::BackendInterface::ButtonType)),
this, SLOT(onButtonPressed(PowerDevil::BackendInterface::ButtonType)));
connect(backend(), &BackendInterface::buttonPressed,
this, &HandleButtonEvents::onButtonPressed);
KActionCollection* actionCollection = new KActionCollection( this );
actionCollection->setComponentDisplayName(i18nc("Name for powerdevil shortcuts category", "Power Management"));
......@@ -62,19 +62,19 @@ HandleButtonEvents::HandleButtonEvents(QObject *parent)
QAction *globalAction = actionCollection->addAction("Sleep");
globalAction->setText(i18nc("@action:inmenu Global shortcut", "Suspend"));
accel->setGlobalShortcut(globalAction, Qt::Key_Sleep);
connect(globalAction, SIGNAL(triggered(bool)), SLOT(suspendToRam()));
connect(globalAction, &QAction::triggered, this, &HandleButtonEvents::suspendToRam);
globalAction = actionCollection->addAction("Hibernate");
globalAction->setText(i18nc("@action:inmenu Global shortcut", "Hibernate"));
accel->setGlobalShortcut(globalAction, Qt::Key_Hibernate);
connect(globalAction, SIGNAL(triggered(bool)), SLOT(suspendToDisk()));
connect(globalAction, &QAction::triggered, this, &HandleButtonEvents::suspendToDisk);
globalAction = actionCollection->addAction("PowerOff");
globalAction->setText(i18nc("@action:inmenu Global shortcut", "Power Off"));
if (!mobile) {
accel->setGlobalShortcut(globalAction, Qt::Key_PowerOff);
}
connect(globalAction, SIGNAL(triggered(bool)), SLOT(powerOffButtonTriggered()));
connect(globalAction, &QAction::triggered, this, &HandleButtonEvents::powerOffButtonTriggered);
globalAction = actionCollection->addAction("PowerDown");
globalAction->setText(i18nc("@action:inmenu Global shortcut, used for long presses of the power button", "Power Down"));
......
......@@ -114,7 +114,7 @@ QList< QPair< QString, QWidget* > > HandleButtonEventsConfig::buildUi()
}
connect(m_lidCloseCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setChanged()));
connect(m_triggerLidActionWhenExternalMonitorPresent, SIGNAL(stateChanged(int)), this, SLOT(setChanged()));
connect(m_triggerLidActionWhenExternalMonitorPresent, &QCheckBox::stateChanged, this, &HandleButtonEventsConfig::setChanged);
connect(m_powerButtonCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setChanged()));
bool lidFound = false;
......
......@@ -59,17 +59,17 @@ KeyboardBrightnessControl::KeyboardBrightnessControl(QObject* parent)
QAction *globalAction = actionCollection->addAction(QLatin1String("Increase Keyboard Brightness"));
globalAction->setText(i18nc("@action:inmenu Global shortcut", "Increase Keyboard Brightness"));
accel->setGlobalShortcut(globalAction, Qt::Key_KeyboardBrightnessUp);
connect(globalAction, SIGNAL(triggered(bool)), SLOT(increaseKeyboardBrightness()));
connect(globalAction, &QAction::triggered, this, &KeyboardBrightnessControl::increaseKeyboardBrightness);
globalAction = actionCollection->addAction(QLatin1String("Decrease Keyboard Brightness"));
globalAction->setText(i18nc("@action:inmenu Global shortcut", "Decrease Keyboard Brightness"));
accel->setGlobalShortcut(globalAction, Qt::Key_KeyboardBrightnessDown);
connect(globalAction, SIGNAL(triggered(bool)), SLOT(decreaseKeyboardBrightness()));
connect(globalAction, &QAction::triggered, this, &KeyboardBrightnessControl::decreaseKeyboardBrightness);
globalAction = actionCollection->addAction("Toggle Keyboard Backlight");
globalAction->setText(i18nc("@action:inmenu Global shortcut", "Toggle Keyboard Backlight"));
accel->setGlobalShortcut(globalAction, Qt::Key_KeyboardLightOnOff);
connect(globalAction, SIGNAL(triggered(bool)), SLOT(toggleKeyboardBacklight()));
connect(globalAction, &QAction::triggered, this, &KeyboardBrightnessControl::toggleKeyboardBacklight);
// My laptop sets the keyboard brightness to zero when I close the lid and it suspends
// this makes sure the keyboard brightness is restored when we wake up :)
......
......@@ -70,7 +70,7 @@ QList< QPair< QString, QWidget* > > KeyboardBrightnessControlConfig::buildUi()
QList< QPair< QString, QWidget* > > retlist;
retlist.append(qMakePair< QString, QWidget* >(i18nc("@label:slider Brightness level", "Level"), tempWidget));
connect(m_slider, SIGNAL(valueChanged(int)), this, SLOT(setChanged()));
connect(m_slider, &QAbstractSlider::valueChanged, this, &KeyboardBrightnessControlConfig::setChanged);
return retlist;
}
......
......@@ -94,7 +94,7 @@ QList< QPair< QString, QWidget* > > RunScriptConfig::buildUi()
retlist.append(qMakePair< QString, QWidget* >(i18n("Run script"), tempWidget));
connect(m_urlRequester, SIGNAL(textChanged(QString)), this, SLOT(setChanged()));
connect(m_urlRequester, &KUrlRequester::textChanged, this, &RunScriptConfig::setChanged);
connect(m_comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setChanged()));
connect(m_idleTime, SIGNAL(valueChanged(int)), this, SLOT(setChanged()));
......
......@@ -113,7 +113,7 @@ QList< QPair< QString, QWidget* > > SuspendSessionConfig::buildUi()
int comboBoxMaxWidth = 300;
if (PowerManagement::instance()->canSuspendThenHibernate()) {
m_suspendThenHibernateEnabled = new QCheckBox(i18n("While asleep, hibernate after a period of inactivity"));
connect(m_suspendThenHibernateEnabled, SIGNAL(stateChanged(int)), this, SLOT(setChanged()));
connect(m_suspendThenHibernateEnabled, &QCheckBox::stateChanged, this, &SuspendSessionConfig::setChanged);
retlist.append(qMakePair< QString, QWidget* >(QLatin1String("NONE"), m_suspendThenHibernateEnabled));
comboBoxMaxWidth = qMax(comboBoxMaxWidth, m_suspendThenHibernateEnabled->sizeHint().width());
m_suspendThenHibernateEnabled->setMinimumWidth(300);
......
......@@ -49,7 +49,7 @@ Login1SuspendJob::~Login1SuspendJob()
void Login1SuspendJob::start()
{
QTimer::singleShot(0, this, SLOT(doStart()));
QTimer::singleShot(0, this, &Login1SuspendJob::doStart);
}
void Login1SuspendJob::doStart()
......
......@@ -83,9 +83,9 @@ bool PowerDevilUPowerBackend::isAvailable()
timer->setInterval(10000);
timer->setSingleShot(true);
connect(QDBusConnection::systemBus().interface(), SIGNAL(serviceRegistered(QString)),
&e, SLOT(quit()));
connect(timer, SIGNAL(timeout()), &e, SLOT(quit()));
connect(QDBusConnection::systemBus().interface(), &QDBusConnectionInterface::serviceRegistered,
&e, &QEventLoop::quit);
connect(timer, &QTimer::timeout, &e, &QEventLoop::quit);
timer->start();
......@@ -192,7 +192,7 @@ void PowerDevilUPowerBackend::init()
m_isLedBrightnessControl = m_syspath.contains(QLatin1String("/leds/"));
if (!m_isLedBrightnessControl) {
UdevQt::Client *client = new UdevQt::Client(QStringList("backlight"), this);
connect(client, SIGNAL(deviceChanged(UdevQt::Device)), SLOT(onDeviceChanged(UdevQt::Device)));
connect(client, &UdevQt::Client::deviceChanged, this, &PowerDevilUPowerBackend::onDeviceChanged);
}
Q_EMIT brightnessSupportQueried(m_brightnessMax > 0);
......@@ -231,7 +231,7 @@ void PowerDevilUPowerBackend::initWithBrightness(bool screenBrightnessAvailable)
// devices
enumerateDevices();
connect(m_upowerInterface, SIGNAL(Changed()), this, SLOT(slotPropertyChanged()));
connect(m_upowerInterface, &OrgFreedesktopUPowerInterface::Changed, this, &PowerDevilUPowerBackend::slotPropertyChanged);
// for UPower >= 0.99.0, missing Changed() signal
QDBusConnection::systemBus().connect(UPOWER_SERVICE, UPOWER_PATH, "org.freedesktop.DBus.Properties", "PropertiesChanged", this,
SLOT(onPropertiesChanged(QString,QVariantMap,QStringList)));
......@@ -244,7 +244,7 @@ void PowerDevilUPowerBackend::initWithBrightness(bool screenBrightnessAvailable)
QDBusConnection::systemBus().connect(UPOWER_SERVICE, UPOWER_PATH, UPOWER_IFACE, "DeviceRemoved",
this, SLOT(slotDeviceRemoved(QDBusObjectPath)));
connect(m_upowerInterface, SIGNAL(DeviceChanged(QString)), this, SLOT(slotDeviceChanged(QString)));
connect(m_upowerInterface, &OrgFreedesktopUPowerInterface::DeviceChanged, this, &PowerDevilUPowerBackend::slotDeviceChanged);
// for UPower >= 0.99.0, see slotDeviceAdded(const QString & device)
// Brightness Controls available
......@@ -267,7 +267,7 @@ void PowerDevilUPowerBackend::initWithBrightness(bool screenBrightnessAvailable)
controls.insert(QLatin1String("KBD"), Keyboard);
m_cachedBrightnessMap.insert(Keyboard, brightness(Keyboard));
qCDebug(POWERDEVIL) << "current keyboard backlight brightness value: " << m_cachedBrightnessMap.value(Keyboard);
connect(m_kbdBacklight, SIGNAL(BrightnessChanged(int)), this, SLOT(onKeyboardBrightnessChanged(int)));
connect(m_kbdBacklight, &OrgFreedesktopUPowerKbdBacklightInterface::BrightnessChanged, this, &PowerDevilUPowerBackend::onKeyboardBrightnessChanged);
}
}
......
......@@ -38,7 +38,7 @@ UPowerSuspendJob::UPowerSuspendJob(OrgFreedesktopUPowerInterface *upowerInterfac
m_method = method;
m_supported = supported;
connect(m_upowerInterface, SIGNAL(Resuming()), this, SLOT(resumeDone()));
connect(m_upowerInterface, &OrgFreedesktopUPowerInterface::Resuming, this, &UPowerSuspendJob::resumeDone);
}
UPowerSuspendJob::~UPowerSuspendJob()
......@@ -48,7 +48,7 @@ UPowerSuspendJob::~UPowerSuspendJob()
void UPowerSuspendJob::start()
{
QTimer::singleShot(0, this, SLOT(doStart()));
QTimer::singleShot(0, this, &UPowerSuspendJob::doStart);
}
void UPowerSuspendJob::doStart()
......
......@@ -84,7 +84,7 @@ void PowerDevilApp::init()
// where the X connection is already lost leading to a crash (Bug 371127)
m_core = new PowerDevil::Core(nullptr/*, KComponentData(aboutData)*/);
connect(m_core, SIGNAL(coreReady()), this, SLOT(onCoreReady()));
connect(m_core, &PowerDevil::Core::coreReady, this, &PowerDevilApp::onCoreReady);
// Before doing anything, let's set up our backend
const QStringList paths = QCoreApplication::libraryPaths();
......
......@@ -100,7 +100,7 @@ void Core::loadCore(BackendInterface* backend)
// Async backend init - so that KDED gets a bit of a speed up
qCDebug(POWERDEVIL) << "Core loaded, initializing backend";
connect(m_backend, SIGNAL(backendReady()), this, SLOT(onBackendReady()));
connect(m_backend, &BackendInterface::backendReady, this, &Core::onBackendReady);
m_backend->init();
}
......@@ -128,10 +128,10 @@ void Core::onBackendReady()
// Get the battery devices ready
{
using namespace Solid;
connect(DeviceNotifier::instance(), SIGNAL(deviceAdded(QString)),
this, SLOT(onDeviceAdded(QString)));
connect(DeviceNotifier::instance(), SIGNAL(deviceRemoved(QString)),
this, SLOT(onDeviceRemoved(QString)));
connect(DeviceNotifier::instance(), &Solid::DeviceNotifier::deviceAdded,
this, &Core::onDeviceAdded);
connect(DeviceNotifier::instance(), &Solid::DeviceNotifier::deviceRemoved,
this, &Core::onDeviceRemoved);
// Force the addition of already existent batteries
const auto devices = Device::listFromType(DeviceInterface::Battery, QString());
......@@ -140,18 +140,18 @@ void Core::onBackendReady()
}
}
connect(m_backend, SIGNAL(acAdapterStateChanged(PowerDevil::BackendInterface::AcAdapterState)),
this, SLOT(onAcAdapterStateChanged(PowerDevil::BackendInterface::AcAdapterState)));
connect(m_backend, SIGNAL(batteryRemainingTimeChanged(qulonglong)),
this, SLOT(onBatteryRemainingTimeChanged(qulonglong)));
connect(m_backend, SIGNAL(lidClosedChanged(bool)),
this, SLOT(onLidClosedChanged(bool)));
connect(m_backend, &BackendInterface::acAdapterStateChanged,
this, &Core::onAcAdapterStateChanged);
connect(m_backend, &BackendInterface::batteryRemainingTimeChanged,
this, &Core::onBatteryRemainingTimeChanged);
connect(m_backend, &BackendInterface::lidClosedChanged,
this, &Core::onLidClosedChanged);
connect(m_backend, &BackendInterface::aboutToSuspend,
this, &Core::onAboutToSuspend);
connect(KIdleTime::instance(), SIGNAL(timeoutReached(int,int)),
this, SLOT(onKIdleTimeoutReached(int,int)));
connect(KIdleTime::instance(), SIGNAL(resumingFromIdle()),
this, SLOT(onResumingFromIdle()));
connect(KIdleTime::instance(), &KIdleTime::resumingFromIdle,
this, &Core::onResumingFromIdle);
connect(m_activityConsumer, &KActivities::Consumer::currentActivityChanged, this, [this]() {
loadProfile();
});
......@@ -186,7 +186,7 @@ void Core::onBackendReady()
// Set up the critical battery timer
m_criticalBatteryTimer->setSingleShot(true);
m_criticalBatteryTimer->setInterval(60000);
connect(m_criticalBatteryTimer, SIGNAL(timeout()), this, SLOT(onCriticalBatteryTimerExpired()));
connect(m_criticalBatteryTimer, &QTimer::timeout, this, &Core::onCriticalBatteryTimerExpired);
// wait until the notification system is set up before firing notifications
// to avoid them showing ontop of ksplash...
......@@ -197,10 +197,10 @@ void Core::onBackendReady()
QDBusConnection::sessionBus(),
QDBusServiceWatcher::WatchForRegistration,
this);
connect(m_notificationsWatcher, SIGNAL(serviceRegistered(QString)), this, SLOT(onServiceRegistered(QString)));
connect(m_notificationsWatcher, &QDBusServiceWatcher::serviceRegistered, this, &Core::onServiceRegistered);
// ...but fire them after 30s nonetheless to ensure they've been shown
QTimer::singleShot(30000, this, SLOT(onNotificationTimeout()));
QTimer::singleShot(30000, this, &Core::onNotificationTimeout);
}
#ifdef Q_OS_LINUX
......@@ -825,7 +825,7 @@ void Core::onAboutToSuspend()
QDBusPendingCall listNamesCall = QDBusConnection::sessionBus().interface()->asyncCall(QStringLiteral("ListNames"));
QDBusPendingCallWatcher *callWatcher = new QDBusPendingCallWatcher(listNamesCall, this);
connect(callWatcher, &QDBusPendingCallWatcher::finished, this, [this](QDBusPendingCallWatcher *watcher) {
connect(callWatcher, &QDBusPendingCallWatcher::finished, this, [](QDBusPendingCallWatcher *watcher) {
QDBusPendingReply<QStringList> reply = *watcher;
watcher->deleteLater();
......
......@@ -47,8 +47,8 @@ FdoConnector::FdoConnector(PowerDevil::Core *parent)
c.registerService("org.freedesktop.PowerManagement.Inhibit");
c.registerObject("/org/freedesktop/PowerManagement/Inhibit", this);
connect(m_core->backend(), SIGNAL(acAdapterStateChanged(PowerDevil::BackendInterface::AcAdapterState)),
this, SLOT(onAcAdapterStateChanged(PowerDevil::BackendInterface::AcAdapterState)));
connect(m_core->backend(), &BackendInterface::acAdapterStateChanged,
this, &FdoConnector::onAcAdapterStateChanged);
connect(PolicyAgent::instance(), SIGNAL(unavailablePoliciesChanged(PowerDevil::PolicyAgent::RequiredPolicies)),
this, SLOT(onUnavailablePoliciesChanged(PowerDevil::PolicyAgent::RequiredPolicies)));
}
......
......@@ -145,10 +145,10 @@ void PolicyAgent::init()
QDBusServiceWatcher::WatchForRegistration);
m_sdWatcher.data()->addWatchedService(SYSTEMD_LOGIN1_SERVICE);
connect(m_sdWatcher.data(), SIGNAL(serviceRegistered(QString)),
this, SLOT(onSessionHandlerRegistered(QString)));
connect(m_sdWatcher.data(), SIGNAL(serviceUnregistered(QString)),
this, SLOT(onSessionHandlerUnregistered(QString)));
connect(m_sdWatcher.data(), &QDBusServiceWatcher::serviceRegistered,
this, &PolicyAgent::onSessionHandlerRegistered);
connect(m_sdWatcher.data(), &QDBusServiceWatcher::serviceUnregistered,
this, &PolicyAgent::onSessionHandlerUnregistered);
// If it's up and running already, let's cache it
if (QDBusConnection::systemBus().interface()->isServiceRegistered(SYSTEMD_LOGIN1_SERVICE)) {
onSessionHandlerRegistered(SYSTEMD_LOGIN1_SERVICE);
......@@ -160,10 +160,10 @@ void PolicyAgent::init()
QDBusServiceWatcher::WatchForRegistration);
m_ckWatcher.data()->addWatchedService(CONSOLEKIT_SERVICE);
connect(m_ckWatcher.data(), SIGNAL(serviceRegistered(QString)),
this, SLOT(onSessionHandlerRegistered(QString)));
connect(m_ckWatcher.data(), SIGNAL(serviceUnregistered(QString)),
this, SLOT(onSessionHandlerUnregistered(QString)));
connect(m_ckWatcher.data(), &QDBusServiceWatcher::serviceRegistered,
this, &PolicyAgent::onSessionHandlerRegistered);
connect(m_ckWatcher.data(), &QDBusServiceWatcher::serviceUnregistered,
this, &PolicyAgent::onSessionHandlerUnregistered);
// If it's up and running already, let's cache it
if (QDBusConnection::systemBus().interface()->isServiceRegistered(CONSOLEKIT_SERVICE)) {
onSessionHandlerRegistered(CONSOLEKIT_SERVICE);
......@@ -173,8 +173,8 @@ void PolicyAgent::init()
m_busWatcher.data()->setConnection(QDBusConnection::sessionBus());
m_busWatcher.data()->setWatchMode(QDBusServiceWatcher::WatchForUnregistration);
connect(m_busWatcher.data(), SIGNAL(serviceUnregistered(QString)),
this, SLOT(onServiceUnregistered(QString)));
connect(m_busWatcher.data(), &QDBusServiceWatcher::serviceUnregistered,
this, &PolicyAgent::onServiceUnregistered);
// Setup the screen locker watcher and check whether the screen is currently locked
connect(m_screenLockerWatcher, &QDBusServiceWatcher::serviceOwnerChanged, this, &PolicyAgent::onScreenLockerOwnerChanged);
......
......@@ -93,8 +93,8 @@ ActivityPage::ActivityPage(QWidget *parent, const QVariantList &args)
QDBusServiceWatcher::WatchForUnregistration,
this);
connect(watcher, SIGNAL(serviceRegistered(QString)), this, SLOT(onServiceRegistered(QString)));
connect(watcher, SIGNAL(serviceUnregistered(QString)), this, SLOT(onServiceUnregistered(QString)));
connect(watcher, &QDBusServiceWatcher::serviceRegistered, this, &ActivityPage::onServiceRegistered);
connect(watcher, &QDBusServiceWatcher::serviceUnregistered, this, &ActivityPage::onServiceUnregistered);
if (QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.Solid.PowerManagement")) {
onServiceRegistered("org.kde.Solid.PowerManagement");
......
......@@ -49,7 +49,7 @@ ActivityWidget::ActivityWidget(const QString& activity, QWidget* parent)
QWidget *widget = m_ui->specialBehaviorLayout->itemAt(i)->widget();
if (widget) {
widget->setVisible(false);
connect(m_ui->specialBehaviorRadio, SIGNAL(toggled(bool)), widget, SLOT(setVisible(bool)));
connect(m_ui->specialBehaviorRadio, &QAbstractButton::toggled, widget, &QWidget::setVisible);
} else {
QLayout *layout = m_ui->specialBehaviorLayout->itemAt(i)->layout();
if (layout) {
......@@ -57,7 +57,7 @@ ActivityWidget::ActivityWidget(const QString& activity, QWidget* parent)
QWidget *widget = layout->itemAt(j)->widget();
if (widget) {
widget->setVisible(false);
connect(m_ui->specialBehaviorRadio, SIGNAL(toggled(bool)), widget, SLOT(setVisible(bool)));
connect(m_ui->specialBehaviorRadio, &QAbstractButton::toggled, widget, &QWidget::setVisible);
}
}
}
......@@ -67,17 +67,17 @@ ActivityWidget::ActivityWidget(const QString& activity, QWidget* parent)
m_actionEditWidget->setVisible(false);
m_actionEditWidget->load();
connect(m_ui->separateSettingsRadio, SIGNAL(toggled(bool)), m_actionEditWidget, SLOT(setVisible(bool)));
connect(m_ui->separateSettingsRadio, &QAbstractButton::toggled, m_actionEditWidget, &QWidget::setVisible);
connect(m_ui->actLikeRadio, SIGNAL(toggled(bool)), this, SLOT(setChanged()));
connect(m_ui->noSettingsRadio, SIGNAL(toggled(bool)), this, SLOT(setChanged()));
connect(m_ui->separateSettingsRadio, SIGNAL(toggled(bool)), this, SLOT(setChanged()));
connect(m_ui->specialBehaviorRadio, SIGNAL(toggled(bool)), this, SLOT(setChanged()));
connect(m_ui->actLikeRadio, &QAbstractButton::toggled, this, &ActivityWidget::setChanged);
connect(m_ui->noSettingsRadio, &QAbstractButton::toggled, this, &ActivityWidget::setChanged);
connect(m_ui->separateSettingsRadio, &QAbstractButton::toggled, this, &ActivityWidget::setChanged);
connect(m_ui->specialBehaviorRadio, &QAbstractButton::toggled, this, &ActivityWidget::setChanged);
connect(m_ui->actLikeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setChanged()));
connect(m_ui->alwaysActionBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setChanged()));
connect(m_ui->alwaysAfterSpin, SIGNAL(valueChanged(int)), this, SLOT(setChanged()));
connect(m_actionEditWidget, SIGNAL(changed(bool)), this, SIGNAL(changed(bool)));
connect(m_actionEditWidget, &ActionEditWidget::changed, this, &ActivityWidget::changed);
}
ActivityWidget::~ActivityWidget()
......
......@@ -88,10 +88,10 @@ ActionEditWidget::ActionEditWidget(const QString &configName, QWidget *parent)
continue;
}
connect(actionConfig, SIGNAL(changed()), this, SLOT(onChanged()));
connect(actionConfig, &PowerDevil::ActionConfig::changed, this, &ActionEditWidget::onChanged);
QCheckBox *checkbox = new QCheckBox(offer->name());
connect(checkbox, SIGNAL(stateChanged(int)), this, SLOT(onChanged()));
connect(checkbox, &QCheckBox::stateChanged, this, &ActionEditWidget::onChanged);
m_actionsHash.insert(offer->property("X-KDE-PowerDevil-Action-ID", QVariant::String).toString(), checkbox);
m_actionsConfigHash.insert(offer->property("X-KDE-PowerDevil-Action-ID", QVariant::String).toString(), actionConfig);
......
......@@ -77,8 +77,8 @@ GeneralPage::GeneralPage(QWidget *parent, const QVariantList &args)
QDBusServiceWatcher::WatchForUnregistration,
this);
connect(watcher, SIGNAL(serviceRegistered(QString)), this, SLOT(onServiceRegistered(QString)));
connect(watcher, SIGNAL(serviceUnregistered(QString)), this, SLOT(onServiceUnregistered(QString)));
connect(watcher, &QDBusServiceWatcher::serviceRegistered, this, &GeneralPage::onServiceRegistered);
connect(watcher, &QDBusServiceWatcher::serviceUnregistered, this, &GeneralPage::onServiceUnregistered);
if (QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.Solid.PowerManagement")) {
onServiceRegistered("org.kde.Solid.PowerManagement");
......@@ -119,7 +119,7 @@ void GeneralPage::fillUi()
// modified fields...
connect(notificationsButton, SIGNAL(clicked()), SLOT(configureNotifications()));
connect(notificationsButton, &QAbstractButton::clicked, this, &GeneralPage::configureNotifications);
connect(lowSpin, SIGNAL(valueChanged(int)), SLOT(changed()));
connect(criticalSpin, SIGNAL(valueChanged(int)), SLOT(changed()));
......
......@@ -91,17 +91,17 @@ EditPage::EditPage(QWidget *parent, const QVariantList &args)
ActionEditWidget *editWidget = new ActionEditWidget("AC", tabWidget);
m_editWidgets.insert("AC", editWidget);
acWidgetLayout->addWidget(editWidget);
connect(editWidget, SIGNAL(changed(bool)), this, SLOT(onChanged(bool)));
connect(editWidget, &ActionEditWidget::changed, this, &EditPage::onChanged);
editWidget = new ActionEditWidget("Battery", tabWidget);
m_editWidgets.insert("Battery", editWidget);
batteryWidgetLayout->addWidget(editWidget);
connect(editWidget, SIGNAL(changed(bool)), this, SLOT(onChanged(bool)));
connect(editWidget, &ActionEditWidget::changed, this, &EditPage::onChanged);
editWidget = new ActionEditWidget("LowBattery", tabWidget);
m_editWidgets.insert("LowBattery", editWidget);
lowBatteryWidgetLayout->addWidget(editWidget);
connect(editWidget, SIGNAL(changed(bool)), this, SLOT(onChanged(bool)));
connect(editWidget, &ActionEditWidget::changed, this, &EditPage::onChanged);
QDBusServiceWatcher *watcher = new QDBusServiceWatcher("org.kde.Solid.PowerManagement",
QDBusConnection::sessionBus(),
......@@ -109,8 +109,8 @@ EditPage::EditPage(QWidget *parent, const QVariantList &args)
QDBusServiceWatcher::WatchForUnregistration,
this);
connect(watcher, SIGNAL(serviceRegistered(QString)), this, SLOT(onServiceRegistered(QString)));
connect(watcher, SIGNAL(serviceUnregistered(QString)), this, SLOT(onServiceUnregistered(QString)));
connect(watcher, &QDBusServiceWatcher::serviceRegistered, this, &EditPage::onServiceRegistered);
connect(watcher, &QDBusServiceWatcher::serviceUnregistered, this, &EditPage::onServiceUnregistered);
bool hasBattery = false;
const auto batteries = Solid::Device::listFromType(Solid::DeviceInterface::Battery, QString());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment