[plasma/powerdevil] /: Drop wireless power management options

Nicolas Fella null at kde.org
Mon Apr 10 16:41:31 BST 2023


Git commit aa32843ade524e74f74544e6baa31de52c4abffd by Nicolas Fella.
Committed on 10/04/2023 at 15:39.
Pushed by nicolasfella into branch 'master'.

Drop wireless power management options

This allows to configure things like "Turn off Wifi/Bluetooth when going on battery", presumbly to save power by turning off the relevant hardware.

However this can hardly be useful in practice, because just because you are running on battery doesn't mean you don't need Wifi/Bluetooth any more.

Fixes https://invent.kde.org/plasma/powerdevil/-/issues/15

M  +0    -4    .kde-ci.yml
M  +0    -23   CMakeLists.txt
M  +0    -6    daemon/actions/bundled/CMakeLists.txt
D  +0    -14   daemon/actions/bundled/org.kde.Solid.PowerManagement.Actions.WirelessPowerSaving.xml
D  +0    -95   daemon/actions/bundled/powerdevilwirelesspowersavingaction.json
D  +0    -202  daemon/actions/bundled/wirelesspowersaving.cpp
D  +0    -91   daemon/actions/bundled/wirelesspowersaving.h
D  +0    -124  daemon/actions/bundled/wirelesspowersavingconfig.cpp
D  +0    -53   daemon/actions/bundled/wirelesspowersavingconfig.h
M  +0    -3    daemon/config-powerdevil.h.cmake
M  +0    -7    doc/kcm/index.docbook

https://invent.kde.org/plasma/powerdevil/commit/aa32843ade524e74f74544e6baa31de52c4abffd

diff --git a/.kde-ci.yml b/.kde-ci.yml
index 1516d55d..a76ea5fe 100644
--- a/.kde-ci.yml
+++ b/.kde-ci.yml
@@ -29,9 +29,5 @@ Dependencies:
     'frameworks/kcmutils': '@latest-kf6' # kcmutils_generate_desktop_file
     'plasma/plasma-workspace': '@same'
 
-- 'on': ['Linux']
-  'require':
-    'frameworks/bluez-qt': '@latest-kf6'
-    'frameworks/networkmanager-qt': '@latest-kf6'
 Options:
   require-passing-tests-on: [ 'Linux', 'FreeBSD']
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4dcbf653..d14f2d31 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,29 +29,6 @@ find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS Activities Auth IdleTime
 find_package(KF6Screen CONFIG REQUIRED)
 find_package(LibKWorkspace CONFIG REQUIRED)
 
-find_package(KF6BluezQt ${KF6_MIN_VERSION})
-set_package_properties(KF6BluezQt
-    PROPERTIES DESCRIPTION "Qt wrapper for BlueZ 5 DBus API"
-    TYPE OPTIONAL
-    PURPOSE "Support for wireless energy saving actions"
-)
-find_package(KF6NetworkManagerQt ${KF6_MIN_VERSION})
-set_package_properties(KF6NetworkManagerQt
-    PROPERTIES DESCRIPTION "Qt wrapper for NetworkManager API"
-    TYPE OPTIONAL
-    PURPOSE "Support for wireless energy saving actions"
-)
-
-set(HAVE_WIRELESS_SUPPORT FALSE)
-if(KF6NetworkManagerQt_FOUND AND KF6BluezQt_FOUND)
-    set(HAVE_WIRELESS_SUPPORT TRUE)
-endif()
-add_feature_info(
-    "Wireless power saving"
-    HAVE_WIRELESS_SUPPORT
-    "Support turning off signal-transmitting devices to save energy"
-)
-
 find_package(LibKWorkspace ${PROJECT_VERSION} REQUIRED)
 
 find_package(UDev REQUIRED)
diff --git a/daemon/actions/bundled/CMakeLists.txt b/daemon/actions/bundled/CMakeLists.txt
index 7a1f335c..b25d0c97 100644
--- a/daemon/actions/bundled/CMakeLists.txt
+++ b/daemon/actions/bundled/CMakeLists.txt
@@ -61,12 +61,6 @@ qt_add_dbus_interface(powerprofile_dbus_SRCS org.freedesktop.DBus.Properties.xml
 qt_add_dbus_interface(powerprofile_dbus_SRCS net.hadess.PowerProfiles.xml power_profiles_interface)
 target_sources(powerdevil_powerprofileaction PRIVATE ${powerprofile_dbus_SRCS} ${handlebuttons_SRCS})
 
-if(HAVE_WIRELESS_SUPPORT)
-    add_powerdevil_bundled_action(wirelesspowersaving KF6::NetworkManagerQt KF6::BluezQt)
-    target_dbus_files(powerdevil_wirelesspowersavingaction org.kde.Solid.PowerManagement.Actions.WirelessPowerSaving.xml
-                         actions/bundled/wirelesspowersaving.h PowerDevil::BundledActions::WirelessPowerSaving)
-endif()
-
 kcoreaddons_add_plugin(powerdevil_handlebuttoneventsaction SOURCES powerdevilhandlebuttonevents_plugin.cpp ${handlebuttons_SRCS} INSTALL_NAMESPACE "powerdevil/action")
 target_link_libraries(powerdevil_handlebuttoneventsaction PRIVATE powerdevilcore)
 
diff --git a/daemon/actions/bundled/org.kde.Solid.PowerManagement.Actions.WirelessPowerSaving.xml b/daemon/actions/bundled/org.kde.Solid.PowerManagement.Actions.WirelessPowerSaving.xml
deleted file mode 100644
index 80f90102..00000000
--- a/daemon/actions/bundled/org.kde.Solid.PowerManagement.Actions.WirelessPowerSaving.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<node>
-  <interface name="org.kde.Solid.PowerManagement.Actions.WirelessPowerSaving">
-    <method name="setBluetoothEnabled">
-      <arg type="b" direction="in" />
-    </method>
-    <method name="setMobileBroadbandEnabled">
-      <arg type="b" direction="in" />
-    </method>
-    <method name="setWirelessEnabled">
-      <arg type="b" direction="in" />
-    </method>
-  </interface>
-</node>
diff --git a/daemon/actions/bundled/powerdevilwirelesspowersavingaction.json b/daemon/actions/bundled/powerdevilwirelesspowersavingaction.json
deleted file mode 100644
index 5f501354..00000000
--- a/daemon/actions/bundled/powerdevilwirelesspowersavingaction.json
+++ /dev/null
@@ -1,95 +0,0 @@
-{
-    "KPlugin": {
-        "Description": "Turns off signal-transmitting devices",
-        "Description[ar]": "يقوم بإيقاف تشغيل أجهزة إرسال الإشارات",
-        "Description[be]": "Адключэнне прылад, якія перадаюць сігнал",
-        "Description[bg]": "Изключва безжичните устройства",
-        "Description[ca at valencia]": "Apaga els dispositius de transmissió de senyals",
-        "Description[ca]": "Apaga els dispositius de transmissió de senyals",
-        "Description[cs]": "Vypne zařízení vysílající signál",
-        "Description[de]": "Schaltet alle drahtlos sendenden Geräte ab",
-        "Description[en_GB]": "Turns off signal-transmitting devices",
-        "Description[eo]": "Malŝaltas signal-elsendajn aparatojn",
-        "Description[es]": "Apaga los dispositivos que emiten señales",
-        "Description[eu]": "Seinaleak transmititzeko gailuak itzaltzen ditu",
-        "Description[fi]": "Sammuttaa signaaleja lähettävät laitteet",
-        "Description[fr]": "Éteint les appareils transmettant des signaux",
-        "Description[ia]": "Extingue dispositivos de transmission de signal",
-        "Description[it]": "Spegne i dispositivi che trasmettono segnale",
-        "Description[ka]": "სიგნალის გადამცემი მოწყობილობების გამორთვა",
-        "Description[ko]": "무선 장치 끄기",
-        "Description[lt]": "Išjungia signalą perduodančius įrenginius",
-        "Description[nl]": "Zet apparaten die een radiosignaal uitzenden uit",
-        "Description[nn]": "Slå av einingar som sender signal",
-        "Description[pa]": "ਸਿਗਨਲ-ਟਰਾਂਸਮਿਟ ਕਰਨ ਵਾਲੇ ਡਿਵਾਈਸਾਂ ਨੂੰ ਬੰਦ ਕਰੋ",
-        "Description[pl]": "Wyłącza urządzenia nadające sygnał",
-        "Description[pt]": "Desliga os dispositivos de transmissão de sinais",
-        "Description[pt_BR]": "Desliga os dispositivos de transmissão de sinais",
-        "Description[ru]": "Выключает все радиопередающие устройства в компьютере",
-        "Description[sl]": "Izklopi naprave, ki oddajajo signal",
-        "Description[sv]": "Stänger av sändenheter",
-        "Description[ta]": "அருகலை சாதனங்களை முடக்கும்",
-        "Description[tr]": "Sinyal ileten aygıtları kapatır",
-        "Description[uk]": "Вимкнути пристрої, що передають радіосигнал",
-        "Description[x-test]": "xxTurns off signal-transmitting devicesxx",
-        "Description[zh_CN]": "关闭信号收发设备",
-        "Description[zh_TW]": "關閉訊號傳送裝置",
-        "Icon": "preferences-system-network",
-        "Name": "Wireless",
-        "Name[ar]": "لاسلكي",
-        "Name[az]": "Simsiz bağlantı",
-        "Name[be]": "Бесправадное",
-        "Name[bg]": "Безжични устройства",
-        "Name[ca at valencia]": "Sense fil",
-        "Name[ca]": "Sense fil",
-        "Name[cs]": "Bezdrátové",
-        "Name[da]": "Trådløst",
-        "Name[de]": "Drahtlos",
-        "Name[el]": "Ασύρματο",
-        "Name[en_GB]": "Wireless",
-        "Name[eo]": "Sendrata",
-        "Name[es]": "Red inalámbrica",
-        "Name[et]": "Juhtmeta ühendus",
-        "Name[eu]": "Haririk gabekoa",
-        "Name[fi]": "Langaton verkko",
-        "Name[fr]": "Sans fil",
-        "Name[gl]": "Sen fíos",
-        "Name[he]": "אלחוטי",
-        "Name[hu]": "Vezeték nélküli",
-        "Name[ia]": "Wireless (Sin Cablos)",
-        "Name[id]": "Nirkabel",
-        "Name[it]": "Senza fili",
-        "Name[ja]": "ワイヤレス",
-        "Name[ka]": "Wi-Fi",
-        "Name[ko]": "무선",
-        "Name[lt]": "Belaidis",
-        "Name[nb]": "Trådløs",
-        "Name[nl]": "Draadloos",
-        "Name[nn]": "Trådlaust",
-        "Name[pa]": "ਬੇਤਾਰ",
-        "Name[pl]": "Sieci bezprzewodowe",
-        "Name[pt]": "Sem-Fios",
-        "Name[pt_BR]": "Sem fio",
-        "Name[ro]": "Fără fir",
-        "Name[ru]": "Беспроводные сети",
-        "Name[sk]": "Bezdrôtové zariadenia",
-        "Name[sl]": "Brezžično",
-        "Name[sr at ijekavian]": "Бежична",
-        "Name[sr at ijekavianlatin]": "Bežična",
-        "Name[sr at latin]": "Bežična",
-        "Name[sr]": "Бежична",
-        "Name[sv]": "Trådlös",
-        "Name[ta]": "அருகலை",
-        "Name[tg]": "Бесим",
-        "Name[tr]": "Kablosuz",
-        "Name[uk]": "Бездротова",
-        "Name[x-test]": "xxWirelessxx",
-        "Name[zh_CN]": "无线",
-        "Name[zh_TW]": "無線"
-    },
-    "X-KDE-PowerDevil-Action-ConfigPriority": 60,
-    "X-KDE-PowerDevil-Action-HasRuntimeRequirement": true,
-    "X-KDE-PowerDevil-Action-ID": "WirelessPowerSaving",
-    "X-KDE-PowerDevil-Action-RegistersDBusInterface": true,
-    "X-KDE-PowerDevil-Action-UIComponentLibrary": "powerdevilwirelesspowersavingaction_config"
-}
diff --git a/daemon/actions/bundled/wirelesspowersaving.cpp b/daemon/actions/bundled/wirelesspowersaving.cpp
deleted file mode 100644
index 1ae226a1..00000000
--- a/daemon/actions/bundled/wirelesspowersaving.cpp
+++ /dev/null
@@ -1,202 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2016 by Jan Grulich <jgrulich at redhat.com>               *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
- ***************************************************************************/
-
-#include "wirelesspowersaving.h"
-
-#include "wirelesspowersavingadaptor.h"
-
-#include <powerdevilcore.h>
-#include <powerdevil_debug.h>
-
-#include <KConfigGroup>
-#include <KPluginFactory>
-
-#include <NetworkManagerQt/Manager>
-
-K_PLUGIN_CLASS_WITH_JSON(PowerDevil::BundledActions::WirelessPowerSaving, "powerdevilwirelesspowersavingaction.json")
-
-namespace PowerDevil {
-namespace BundledActions {
-WirelessPowerSaving::WirelessPowerSaving(QObject *parent, const QVariantList &)
-    : Action(parent)
-    , m_btManager(new BluezQt::Manager())
-    , m_currentProfileWifiOption(BundledActions::WirelessPowerSaving::TurnOff)
-    , m_currentProfileWwanOption(BundledActions::WirelessPowerSaving::TurnOff)
-    , m_currentProfileBtOption(BundledActions::WirelessPowerSaving::TurnOff)
-    , m_lastProfileWifiOption(BundledActions::WirelessPowerSaving::TurnOff)
-    , m_lastProfileWwanOption(BundledActions::WirelessPowerSaving::TurnOff)
-    , m_lastProfileBtOption(BundledActions::WirelessPowerSaving::TurnOff)
-{
-    // DBus
-    new WirelessPowerSavingAdaptor(this);
-
-    setRequiredPolicies(PowerDevil::PolicyAgent::None);
-}
-
-void WirelessPowerSaving::onProfileUnload()
-{
-    if (m_lastWifiState && m_currentProfileWifiOption == BundledActions::WirelessPowerSaving::TurnOff) {
-        setWirelessEnabled(true);
-    } else if (!m_lastWifiState && m_currentProfileWifiOption == BundledActions::WirelessPowerSaving::TurnOn) {
-        setWirelessEnabled(false);
-    }
-
-    if (m_lastWwanState && m_currentProfileWwanOption == BundledActions::WirelessPowerSaving::TurnOff) {
-        setMobileBroadbandEnabled(true);
-    } else if (!m_lastWwanState && m_currentProfileWwanOption == BundledActions::WirelessPowerSaving::TurnOn) {
-        setMobileBroadbandEnabled(false);
-    }
-
-    if (m_lastBtState && m_currentProfileBtOption == BundledActions::WirelessPowerSaving::TurnOff) {
-        setBluetoothEnabled(true);
-    } else if (!m_lastBtState && m_currentProfileBtOption == BundledActions::WirelessPowerSaving::TurnOn) {
-        setBluetoothEnabled(false);
-    }
-}
-
-void WirelessPowerSaving::onWakeupFromIdle()
-{
-    // Nothing to do
-}
-
-void WirelessPowerSaving::onIdleTimeout(int msec)
-{
-    Q_UNUSED(msec);
-    // Nothing to do
-}
-
-void WirelessPowerSaving::onProfileLoad()
-{
-    qCDebug(POWERDEVIL) << m_currentProfile << m_lastProfile;
-
-    if (((m_currentProfile == QLatin1String("Battery") && m_lastProfile == QLatin1String("AC")) ||
-         (m_currentProfile == QLatin1String("LowBattery") && (m_lastProfile == QLatin1String("AC") || m_lastProfile == QLatin1String("Battery")))) &&
-         (((m_lastProfileWifiOption == BundledActions::WirelessPowerSaving::TurnOff && m_currentProfileWifiOption == BundledActions::WirelessPowerSaving::TurnOn) || m_currentProfileWifiOption == NoAction) &&
-          ((m_lastProfileWwanOption == BundledActions::WirelessPowerSaving::TurnOff && m_currentProfileWwanOption == BundledActions::WirelessPowerSaving::TurnOn) || m_currentProfileWwanOption == NoAction) &&
-          ((m_lastProfileBtOption == BundledActions::WirelessPowerSaving::TurnOff && m_currentProfileBtOption == BundledActions::WirelessPowerSaving::TurnOn) || m_currentProfileBtOption == NoAction))) {
-        // We don't want to change anything here
-        qCDebug(POWERDEVIL) << "Not changing anything, the current profile is more conservative";
-    } else {
-        QVariantMap args{
-            {{QLatin1String("wifiOption"), QVariant::fromValue((uint)m_currentProfileWifiOption)},
-             {QLatin1String("wwanOption"), QVariant::fromValue((uint)m_currentProfileWwanOption)},
-             {QLatin1String("btOption"), QVariant::fromValue((uint)m_currentProfileBtOption)}}
-        };
-
-        trigger(args);
-    }
-}
-
-void WirelessPowerSaving::triggerImpl(const QVariantMap& args)
-{
-    const PowerSavingOption wifiOption = (PowerSavingOption)args.value(QLatin1String("wifiOption")).toUInt();
-    const PowerSavingOption wwanOption = (PowerSavingOption)args.value(QLatin1String("wwanOption")).toUInt();
-    const PowerSavingOption btOption = (PowerSavingOption)args.value(QLatin1String("btOption")).toUInt();
-
-    if (wifiOption == BundledActions::WirelessPowerSaving::TurnOff) {
-        setWirelessEnabled(false);
-    } else if (wifiOption == BundledActions::WirelessPowerSaving::TurnOn) {
-        setWirelessEnabled(true);
-    }
-
-    if (wwanOption == BundledActions::WirelessPowerSaving::TurnOff) {
-        setMobileBroadbandEnabled(false);
-    } else if (wwanOption == BundledActions::WirelessPowerSaving::TurnOn) {
-        setMobileBroadbandEnabled(true);
-    }
-
-    if (btOption == BundledActions::WirelessPowerSaving::TurnOff) {
-        setBluetoothEnabled(false);
-    } else if (btOption == BundledActions::WirelessPowerSaving::TurnOn) {
-        setBluetoothEnabled(true);
-    }
-}
-
-bool WirelessPowerSaving::isSupported()
-{
-    /* Check if we can enable/disable bluetooth ???
-     * This would require to check if we can read/write from/to /dev/rfkill. Maybe Rfkill class from bluez-qt
-     * can be used for this, but it seems to be private class
-     */
-
-    static NMStringMap permissions = NetworkManager::permissions();
-    bool changeWifiAllowed = false;
-    bool changeWwanAllowed = false;
-    for (auto it = permissions.constBegin(); it != permissions.constEnd(); ++it) {
-        if (it.key() == QLatin1String("org.freedesktop.NetworkManager.enable-disable-wifi")) {
-            changeWifiAllowed = it.value() == QLatin1String("yes");
-        } else if (it.key() == QLatin1String("org.freedesktop.NetworkManager.enable-disable-wwan")) {
-            changeWwanAllowed = it.value() == QLatin1String("yes");
-        }
-    }
-
-    return changeWifiAllowed || changeWwanAllowed;
-}
-
-bool WirelessPowerSaving::loadAction(const KConfigGroup& config)
-{
-    // Handle profile changes
-    m_lastProfile = m_currentProfile;
-    m_currentProfile = config.parent().name();
-
-    qCDebug(POWERDEVIL) << "Profiles: " << m_currentProfile << m_lastProfile;
-
-    m_lastProfileWifiOption = m_currentProfileWifiOption;
-    m_lastProfileWwanOption = m_currentProfileWwanOption;
-    m_lastProfileBtOption = m_currentProfileBtOption;
-
-    if (config.hasKey("wifiOption")) {
-        m_currentProfileWifiOption = (PowerSavingOption)config.readEntry<uint>("wifiOption", 0);
-    }
-
-    if (config.hasKey("wwanOption")) {
-        m_currentProfileWwanOption = (PowerSavingOption)config.readEntry<uint>("wwanOption", 0);
-    }
-
-    if (config.hasKey("btOption")) {
-        m_currentProfileBtOption = (PowerSavingOption)config.readEntry<uint>("btOption", 0);
-    }
-
-
-    m_lastWifiState = NetworkManager::isWirelessEnabled();
-    m_lastWwanState = NetworkManager::isWwanEnabled();
-    m_lastBtState = !m_btManager->isBluetoothBlocked();
-
-    return true;
-}
-
-void WirelessPowerSaving::setBluetoothEnabled(bool enabled)
-{
-    m_btManager->setBluetoothBlocked(!enabled);
-}
-
-void WirelessPowerSaving::setMobileBroadbandEnabled(bool enabled)
-{
-    NetworkManager::setWwanEnabled(enabled);
-}
-
-void WirelessPowerSaving::setWirelessEnabled(bool enabled)
-{
-    NetworkManager::setWirelessEnabled(enabled);
-}
-
-}
-
-}
-#include "wirelesspowersaving.moc"
diff --git a/daemon/actions/bundled/wirelesspowersaving.h b/daemon/actions/bundled/wirelesspowersaving.h
deleted file mode 100644
index 4970ea34..00000000
--- a/daemon/actions/bundled/wirelesspowersaving.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2016 by Jan Grulich <jgrulich at redhat.com>               *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
- ***************************************************************************/
-
-
-#ifndef POWERDEVIL_BUNDLEDACTIONS_WIRELESSPOWERSAVING_H
-#define POWERDEVIL_BUNDLEDACTIONS_WIRELESSPOWERSAVING_H
-
-#include <powerdevilaction.h>
-#include <powerdevilbackendinterface.h>
-
-#include <BluezQt/Manager>
-
-namespace PowerDevil {
-namespace BundledActions {
-
-class WirelessPowerSaving : public PowerDevil::Action
-{
-    Q_OBJECT
-    Q_DISABLE_COPY(WirelessPowerSaving)
-    Q_CLASSINFO("D-Bus Interface", "org.kde.Solid.PowerManagement.Actions.WirelessPowerSaving")
-
-public:
-    enum PowerSavingOption {
-        NoAction = 0,
-        TurnOff = 1,
-        TurnOn = 2
-    };
-
-    explicit WirelessPowerSaving(QObject *parent, const QVariantList &);
-    ~WirelessPowerSaving() override = default;
-
-protected:
-    void onProfileUnload() override;
-    void onWakeupFromIdle() override;
-    void onIdleTimeout(int msec) override;
-    void onProfileLoad() override;
-    void triggerImpl(const QVariantMap& args) override;
-    bool isSupported() override;
-
-public:
-    bool loadAction(const KConfigGroup& config) override;
-
-public Q_SLOTS:
-    // DBus export
-    void setBluetoothEnabled(bool enabled);
-    void setMobileBroadbandEnabled(bool enabled);
-    void setWirelessEnabled(bool enabled);
-
-private:
-    BluezQt::Manager *const m_btManager;
-
-    QString m_currentProfile;
-    QString m_lastProfile;
-
-    // Options for current profile
-    PowerSavingOption m_currentProfileWifiOption;
-    PowerSavingOption m_currentProfileWwanOption;
-    PowerSavingOption m_currentProfileBtOption;
-
-    // Options for previous profile
-    PowerSavingOption m_lastProfileWifiOption;
-    PowerSavingOption m_lastProfileWwanOption;
-    PowerSavingOption m_lastProfileBtOption;
-
-    // State of devices before we change that due to changed profile
-    bool m_lastWifiState = false;
-    bool m_lastWwanState = false;
-    bool m_lastBtState = false;
-};
-
-}
-
-}
-
-#endif // POWERDEVIL_BUNDLEDACTIONS_WIRELESSPOWERSAVING_H
diff --git a/daemon/actions/bundled/wirelesspowersavingconfig.cpp b/daemon/actions/bundled/wirelesspowersavingconfig.cpp
deleted file mode 100644
index e8640767..00000000
--- a/daemon/actions/bundled/wirelesspowersavingconfig.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2016 by Jan Grulich <jgrulich at redhat.com>               *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
- ***************************************************************************/
-
-#include "wirelesspowersavingconfig.h"
-#include "wirelesspowersaving.h"
-
-#include <QComboBox>
-#include <QVBoxLayout>
-
-#include <KConfig>
-#include <KPluginFactory>
-#include <KSharedConfig>
-#include <KLocalizedString>
-
-#include <NetworkManagerQt/Manager>
-
-K_PLUGIN_FACTORY(PowerDevilWirelessPowerSavingConfigFactory, registerPlugin<PowerDevil::BundledActions::WirelessPowerSavingConfig>(); )
-
-namespace PowerDevil {
-namespace BundledActions {
-
-WirelessPowerSavingConfig::WirelessPowerSavingConfig(QObject *parent, const QVariantList& )
-    : ActionConfig(parent)
-    , m_btCombobox(nullptr)
-    , m_wifiCombobox(nullptr)
-    , m_wwanCombobox(nullptr)
-{
-
-}
-
-WirelessPowerSavingConfig::~WirelessPowerSavingConfig()
-{
-
-}
-
-void WirelessPowerSavingConfig::save()
-{
-    configGroup().writeEntry<uint>("wifiOption", m_wifiCombobox->itemData(m_wifiCombobox->currentIndex()).toUInt());
-    configGroup().writeEntry<uint>("wwanOption", m_wwanCombobox->itemData(m_wwanCombobox->currentIndex()).toUInt());
-    configGroup().writeEntry<uint>("btOption", m_btCombobox->itemData(m_btCombobox->currentIndex()).toUInt());
-}
-
-void WirelessPowerSavingConfig::load()
-{
-    configGroup().config()->reparseConfiguration();
-
-    const uint wifiOptionType = configGroup().readEntry<uint>("wifiOption", 0);
-    const uint wwanOptionType = configGroup().readEntry<uint>("wwanOption", 0);
-    const uint btOptionType = configGroup().readEntry<uint>("btOption", 0);
-
-    m_wifiCombobox->setCurrentIndex(m_wifiCombobox->findData(wifiOptionType));
-    m_wwanCombobox->setCurrentIndex(m_wwanCombobox->findData(wwanOptionType));
-    m_btCombobox->setCurrentIndex(m_btCombobox->findData(btOptionType));
-}
-
-QList< QPair< QString, QWidget* > > WirelessPowerSavingConfig::buildUi()
-{
-    m_wifiCombobox = new QComboBox();
-    m_wifiCombobox->addItem(i18n("Leave unchanged"), (uint)WirelessPowerSaving::NoAction);
-    m_wifiCombobox->addItem(i18n("Turn off"), (uint)WirelessPowerSaving::TurnOff);
-    m_wifiCombobox->addItem(i18n("Turn on"), (uint)WirelessPowerSaving::TurnOn);
-
-    m_wwanCombobox = new QComboBox();
-    m_wwanCombobox->addItem(i18n("Leave unchanged"), (uint)WirelessPowerSaving::NoAction);
-    m_wwanCombobox->addItem(i18n("Turn off"), (uint)WirelessPowerSaving::TurnOff);
-    m_wwanCombobox->addItem(i18n("Turn on"), (uint)WirelessPowerSaving::TurnOn);
-
-    m_btCombobox = new QComboBox();
-    m_btCombobox->addItem(i18n("Leave unchanged"), (uint)WirelessPowerSaving::NoAction);
-    m_btCombobox->addItem(i18n("Turn off"), (uint)WirelessPowerSaving::TurnOff);
-    m_btCombobox->addItem(i18n("Turn on"), (uint)WirelessPowerSaving::TurnOn);
-
-    // unified width for the comboboxes
-    int comboBoxMaxWidth = 300;
-    comboBoxMaxWidth = qMax(comboBoxMaxWidth, m_wifiCombobox->sizeHint().width());
-    m_wifiCombobox->setMinimumWidth(300);
-    m_wifiCombobox->setMaximumWidth(comboBoxMaxWidth);
-    m_wwanCombobox->setMinimumWidth(300);
-    m_wwanCombobox->setMaximumWidth(comboBoxMaxWidth);
-    m_btCombobox->setMinimumWidth(300);
-    m_btCombobox->setMaximumWidth(comboBoxMaxWidth);
-
-    // Disable comboboxes for actions which are not allowed
-    static NMStringMap permissions = NetworkManager::permissions();
-    for (auto it = permissions.constBegin(); it != permissions.constEnd(); ++it) {
-        if (it.key() == QLatin1String("org.freedesktop.NetworkManager.enable-disable-wifi")) {
-            m_wifiCombobox->setEnabled(it.value() == QLatin1String("yes"));
-        } else if (it.key() == QLatin1String("org.freedesktop.NetworkManager.enable-disable-wwan")) {
-            m_wwanCombobox->setEnabled(it.value() == QLatin1String("yes"));
-        }
-    }
-
-    QList< QPair< QString, QWidget* > > retlist;
-    retlist.append(qMakePair< QString, QWidget* >(i18n("Wi-Fi"), m_wifiCombobox));
-    retlist.append(qMakePair< QString, QWidget* >(i18n("Mobile broadband"), m_wwanCombobox));
-    retlist.append(qMakePair< QString, QWidget* >(i18n("Bluetooth"), m_btCombobox));
-
-    connect(m_wifiCombobox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &WirelessPowerSavingConfig::setChanged);
-    connect(m_wwanCombobox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &WirelessPowerSavingConfig::setChanged);
-    connect(m_btCombobox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &WirelessPowerSavingConfig::setChanged);
-
-    return retlist;
-}
-
-}
-}
-
-#include "wirelesspowersavingconfig.moc"
diff --git a/daemon/actions/bundled/wirelesspowersavingconfig.h b/daemon/actions/bundled/wirelesspowersavingconfig.h
deleted file mode 100644
index 0f059286..00000000
--- a/daemon/actions/bundled/wirelesspowersavingconfig.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2016 by Jan Grulich <jgrulich at redhat.com>               *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
- ***************************************************************************/
-
-
-#ifndef POWERDEVIL_BUNDLEDACTIONS_WIRELESSPOWERSAVINGCONFIG_H
-#define POWERDEVIL_BUNDLEDACTIONS_WIRELESSPOWERSAVINGCONFIG_H
-
-#include <powerdevilactionconfig.h>
-
-class QComboBox;
-
-namespace PowerDevil {
-namespace BundledActions {
-
-class WirelessPowerSavingConfig : public PowerDevil::ActionConfig
-{
-    Q_OBJECT
-    Q_DISABLE_COPY(WirelessPowerSavingConfig)
-
-public:
-    WirelessPowerSavingConfig(QObject* parent, const QVariantList&);
-    ~WirelessPowerSavingConfig() override;
-
-    void save() override;
-    void load() override;
-    QList< QPair< QString, QWidget* > > buildUi() override;
-
-private:
-    QComboBox *m_btCombobox;
-    QComboBox *m_wifiCombobox;
-    QComboBox *m_wwanCombobox;
-};
-
-}
-}
-
-#endif // POWERDEVIL_BUNDLEDACTIONS_WIRELESSPOWERSAVINGCONFIG_H
diff --git a/daemon/config-powerdevil.h.cmake b/daemon/config-powerdevil.h.cmake
index 6b7da059..444a49cc 100644
--- a/daemon/config-powerdevil.h.cmake
+++ b/daemon/config-powerdevil.h.cmake
@@ -1,4 +1 @@
 #cmakedefine01 HAVE_XCB
-
-/* Define to 1 if you have NetworkManagerQt and BluezQt libs. */
-#cmakedefine01 HAVE_WIRELESS_SUPPORT
diff --git a/doc/kcm/index.docbook b/doc/kcm/index.docbook
index c7d8ead6..8b529935 100644
--- a/doc/kcm/index.docbook
+++ b/doc/kcm/index.docbook
@@ -105,13 +105,6 @@ or after a given amount of time.
 </listitem>
 </varlistentry>
 
-<varlistentry><term><guilabel>Wireless power saving</guilabel></term>
-<listitem>
-<para>Activate this option to set individual actions for Wi-Fi, Mobile broadband or Bluetooth connections.
-</para>
-</listitem>
-</varlistentry>
-
 </variablelist>
 </sect2>
 


More information about the kde-doc-english mailing list