diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,6 +75,8 @@ add_subdirectory(daemon) add_subdirectory(kcmodule) add_subdirectory(doc) +add_subdirectory(kconf_update) + install( FILES powerdevil.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR} ) diff --git a/daemon/actions/bundled/brightnesscontrol.cpp b/daemon/actions/bundled/brightnesscontrol.cpp --- a/daemon/actions/bundled/brightnesscontrol.cpp +++ b/daemon/actions/bundled/brightnesscontrol.cpp @@ -38,8 +38,6 @@ namespace PowerDevil { namespace BundledActions { -static const QString s_globalAccelComponent = QStringLiteral("kded5"); - BrightnessControl::BrightnessControl(QObject* parent) : Action(parent) { @@ -55,13 +53,11 @@ QAction* globalAction = actionCollection->addAction(QLatin1String("Increase Screen Brightness")); globalAction->setText(i18nc("@action:inmenu Global shortcut", "Increase Screen Brightness")); - globalAction->setProperty("componentName", s_globalAccelComponent); KGlobalAccel::setGlobalShortcut(globalAction, Qt::Key_MonBrightnessUp); connect(globalAction, SIGNAL(triggered(bool)), SLOT(increaseBrightness())); globalAction = actionCollection->addAction(QLatin1String("Decrease Screen Brightness")); globalAction->setText(i18nc("@action:inmenu Global shortcut", "Decrease Screen Brightness")); - globalAction->setProperty("componentName", s_globalAccelComponent); KGlobalAccel::setGlobalShortcut(globalAction, Qt::Key_MonBrightnessDown); connect(globalAction, SIGNAL(triggered(bool)), SLOT(decreaseBrightness())); } diff --git a/daemon/actions/bundled/handlebuttonevents.cpp b/daemon/actions/bundled/handlebuttonevents.cpp --- a/daemon/actions/bundled/handlebuttonevents.cpp +++ b/daemon/actions/bundled/handlebuttonevents.cpp @@ -43,8 +43,6 @@ namespace PowerDevil { namespace BundledActions { -static const QString s_globalAccelComponent = QStringLiteral("kded5"); - HandleButtonEvents::HandleButtonEvents(QObject *parent) : Action(parent) , m_screenConfiguration(nullptr) @@ -62,19 +60,16 @@ QAction *globalAction = actionCollection->addAction("Sleep"); globalAction->setText(i18nc("@action:inmenu Global shortcut", "Suspend")); - globalAction->setProperty("componentName", s_globalAccelComponent); accel->setGlobalShortcut(globalAction, Qt::Key_Sleep); connect(globalAction, SIGNAL(triggered(bool)), SLOT(suspendToRam())); globalAction = actionCollection->addAction("Hibernate"); globalAction->setText(i18nc("@action:inmenu Global shortcut", "Hibernate")); - globalAction->setProperty("componentName", s_globalAccelComponent); accel->setGlobalShortcut(globalAction, Qt::Key_Hibernate); connect(globalAction, SIGNAL(triggered(bool)), SLOT(suspendToDisk())); globalAction = actionCollection->addAction("PowerOff"); globalAction->setText(i18nc("@action:inmenu Global shortcut", "Power Off")); - globalAction->setProperty("componentName", s_globalAccelComponent); accel->setGlobalShortcut(globalAction, Qt::Key_PowerOff); connect(globalAction, SIGNAL(triggered(bool)), SLOT(powerOffButtonTriggered())); diff --git a/daemon/actions/bundled/keyboardbrightnesscontrol.cpp b/daemon/actions/bundled/keyboardbrightnesscontrol.cpp --- a/daemon/actions/bundled/keyboardbrightnesscontrol.cpp +++ b/daemon/actions/bundled/keyboardbrightnesscontrol.cpp @@ -43,8 +43,6 @@ namespace PowerDevil { namespace BundledActions { -static const QString s_globalAccelComponent = QStringLiteral("kded5"); - KeyboardBrightnessControl::KeyboardBrightnessControl(QObject* parent) : Action(parent) { @@ -61,19 +59,16 @@ QAction *globalAction = actionCollection->addAction(QLatin1String("Increase Keyboard Brightness")); globalAction->setText(i18nc("@action:inmenu Global shortcut", "Increase Keyboard Brightness")); - globalAction->setProperty("componentName", s_globalAccelComponent); accel->setGlobalShortcut(globalAction, Qt::Key_KeyboardBrightnessUp); connect(globalAction, SIGNAL(triggered(bool)), SLOT(increaseKeyboardBrightness())); globalAction = actionCollection->addAction(QLatin1String("Decrease Keyboard Brightness")); globalAction->setText(i18nc("@action:inmenu Global shortcut", "Decrease Keyboard Brightness")); - globalAction->setProperty("componentName", s_globalAccelComponent); accel->setGlobalShortcut(globalAction, Qt::Key_KeyboardBrightnessDown); connect(globalAction, SIGNAL(triggered(bool)), SLOT(decreaseKeyboardBrightness())); globalAction = actionCollection->addAction("Toggle Keyboard Backlight"); globalAction->setText(i18nc("@action:inmenu Global shortcut", "Toggle Keyboard Backlight")); - globalAction->setProperty("componentName", s_globalAccelComponent); accel->setGlobalShortcut(globalAction, Qt::Key_KeyboardLightOnOff); connect(globalAction, SIGNAL(triggered(bool)), SLOT(toggleKeyboardBacklight())); diff --git a/kconf_update/CMakeLists.txt b/kconf_update/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/kconf_update/CMakeLists.txt @@ -0,0 +1 @@ +install(FILES powerdevil_move_shortcuts.upd DESTINATION ${KCONF_UPDATE_INSTALL_DIR}) diff --git a/kconf_update/powerdevil_move_shortcuts.upd b/kconf_update/powerdevil_move_shortcuts.upd new file mode 100644 --- /dev/null +++ b/kconf_update/powerdevil_move_shortcuts.upd @@ -0,0 +1,12 @@ +Version=5 +Id=powerdevil_move_shortcuts +File=kglobalshortcutsrc +Group=kded5, org_kde_powerdevil +Key=Hibernate +Key=PowerOff +Key=Sleep +Key=Decrease Keyboard Brightness +Key=Decrease Screen Brightness +Key=Increase Keyboard Brightness +Key=Increase Screen Brightness +Key=Toggle Keyboard Backlight