From d52a4a7c6b0dc78c292153703fbaf5982f9a5b7f Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 30 Mar 2024 05:20:24 +0200 Subject: [PATCH] solid: drop button interface now unused, the signals were never implemented either Signed-off-by: Ivailo Monev --- includes/CMakeLists.txt | 1 - includes/Solid/Button | 1 - solid/solid/CMakeLists.txt | 5 - solid/solid/backends/fakehw/fakebutton.cpp | 74 ----------- solid/solid/backends/fakehw/fakebutton.h | 56 -------- solid/solid/backends/fakehw/fakecomputer.xml | 44 ------- solid/solid/backends/fakehw/fakedevice.cpp | 4 - solid/solid/backends/fakehw/fakemanager.cpp | 4 - solid/solid/backends/udev/udevbutton.cpp | 53 -------- solid/solid/backends/udev/udevbutton.h | 55 -------- solid/solid/backends/udev/udevdevice.cpp | 24 ---- solid/solid/backends/udev/udevmanager.cpp | 6 - solid/solid/button.cpp | 58 --------- solid/solid/button.h | 129 ------------------- solid/solid/button_p.h | 37 ------ solid/solid/device.cpp | 5 - solid/solid/deviceinterface.cpp | 2 - solid/solid/deviceinterface.h | 9 +- solid/solid/ifaces/button.cpp | 26 ---- solid/solid/ifaces/button.h | 89 ------------- solid/tests/solidhwtest.cpp | 50 +------ solid/tests/solidhwtest.h | 1 - 22 files changed, 6 insertions(+), 727 deletions(-) delete mode 100644 includes/Solid/Button delete mode 100644 solid/solid/backends/fakehw/fakebutton.cpp delete mode 100644 solid/solid/backends/fakehw/fakebutton.h delete mode 100644 solid/solid/backends/udev/udevbutton.cpp delete mode 100644 solid/solid/backends/udev/udevbutton.h delete mode 100644 solid/solid/button.cpp delete mode 100644 solid/solid/button.h delete mode 100644 solid/solid/button_p.h delete mode 100644 solid/solid/ifaces/button.cpp delete mode 100644 solid/solid/ifaces/button.h diff --git a/includes/CMakeLists.txt b/includes/CMakeLists.txt index 0ad18f25..53f3bd09 100644 --- a/includes/CMakeLists.txt +++ b/includes/CMakeLists.txt @@ -443,7 +443,6 @@ install( Solid/AudioInterface Solid/Battery Solid/Block - Solid/Button Solid/Camera Solid/Device Solid/DeviceInterface diff --git a/includes/Solid/Button b/includes/Solid/Button deleted file mode 100644 index ab3e314e..00000000 --- a/includes/Solid/Button +++ /dev/null @@ -1 +0,0 @@ -#include "../../solid/button.h" diff --git a/solid/solid/CMakeLists.txt b/solid/solid/CMakeLists.txt index 1aff378f..4da5d03b 100644 --- a/solid/solid/CMakeLists.txt +++ b/solid/solid/CMakeLists.txt @@ -35,7 +35,6 @@ set(solid_LIB_SRCS networkinterface.cpp acadapter.cpp battery.cpp - button.cpp audiointerface.cpp predicate.cpp predicateparse.cpp @@ -50,7 +49,6 @@ set(solid_LIB_SRCS ifaces/audiointerface.cpp ifaces/battery.cpp ifaces/block.cpp - ifaces/button.cpp ifaces/camera.cpp ifaces/opticaldrive.cpp ifaces/device.cpp @@ -82,7 +80,6 @@ if(ENABLE_TESTING) backends/fakehw/fakeaudiointerface.cpp backends/fakehw/fakebattery.cpp backends/fakehw/fakeblock.cpp - backends/fakehw/fakebutton.cpp backends/fakehw/fakecamera.cpp backends/fakehw/fakecdrom.cpp backends/fakehw/fakedevice.cpp @@ -117,7 +114,6 @@ if(UDEV_FOUND) backends/udev/udevaudiointerface_p.cpp backends/udev/udevportablemediaplayer.cpp backends/udev/udevblock.cpp - backends/udev/udevbutton.cpp backends/udev/udevstorageaccess.cpp backends/udev/udevstoragevolume.cpp backends/udev/udevstoragedrive.cpp @@ -233,7 +229,6 @@ install( networkinterface.h acadapter.h battery.h - button.h audiointerface.h predicate.h powermanagement.h diff --git a/solid/solid/backends/fakehw/fakebutton.cpp b/solid/solid/backends/fakehw/fakebutton.cpp deleted file mode 100644 index f1136a22..00000000 --- a/solid/solid/backends/fakehw/fakebutton.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - Copyright 2006 Davide Bettio - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) version 3, or any - later version accepted by the membership of KDE e.V. (or its - successor approved by the membership of KDE e.V.), which shall - act as a proxy defined in Section 6 of version 3 of the license. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . -*/ - -#include "fakebutton.h" - -using namespace Solid::Backends::Fake; - -FakeButton::FakeButton(FakeDevice *device) - : FakeDeviceInterface(device) -{ - -} - -FakeButton::~FakeButton() -{ - -} - -Solid::Button::ButtonType FakeButton::type() const -{ - QString buttontype = fakeDevice()->property("type").toString(); - - if (buttontype=="LidButton") - { - return Solid::Button::LidButton; - } - else if (buttontype=="PowerButton") - { - return Solid::Button::PowerButton; - } - else if (buttontype=="SleepButton") - { - return Solid::Button::SleepButton; - } - else - { - return Solid::Button::UnknownButtonType; - } -} - -bool FakeButton::hasState() const -{ - return fakeDevice()->property("hasState").toBool(); -} - -bool FakeButton::stateValue() const -{ - return fakeDevice()->property("stateValue").toBool(); -} - -void FakeButton::press() -{ - if (hasState()) fakeDevice()->setProperty("stateValue", !stateValue()); - emit pressed(type(), fakeDevice()->udi()); -} - -#include "backends/fakehw/moc_fakebutton.cpp" diff --git a/solid/solid/backends/fakehw/fakebutton.h b/solid/solid/backends/fakehw/fakebutton.h deleted file mode 100644 index 2fbc8120..00000000 --- a/solid/solid/backends/fakehw/fakebutton.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2006 Davide Bettio - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) version 3, or any - later version accepted by the membership of KDE e.V. (or its - successor approved by the membership of KDE e.V.), which shall - act as a proxy defined in Section 6 of version 3 of the license. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see . -*/ - -#ifndef SOLID_BACKENDS_FAKEHW_FAKEBUTTON_H -#define SOLID_BACKENDS_FAKEHW_FAKEBUTTON_H - -#include "fakedeviceinterface.h" -#include - -namespace Solid -{ -namespace Backends -{ -namespace Fake -{ -class FakeButton : public FakeDeviceInterface, virtual public Solid::Ifaces::Button -{ - Q_OBJECT - Q_INTERFACES(Solid::Ifaces::Button) - -public: - explicit FakeButton(FakeDevice *device); - ~FakeButton(); - -public Q_SLOTS: - virtual Solid::Button::ButtonType type() const; - virtual bool hasState() const; - virtual bool stateValue() const; - - void press(); - -Q_SIGNALS: - void pressed(Solid::Button::ButtonType type, const QString &udi); -}; -} -} -} - -#endif // SOLID_BACKENDS_FAKEHW_FAKEBUTTON_H diff --git a/solid/solid/backends/fakehw/fakecomputer.xml b/solid/solid/backends/fakehw/fakecomputer.xml index 9a47a507..04eb0dca 100644 --- a/solid/solid/backends/fakehw/fakecomputer.xml +++ b/solid/solid/backends/fakehw/fakecomputer.xml @@ -49,40 +49,6 @@ discharging - - - - Power Button - Button - /org/kde/solid/fakehw/computer - - PowerButton - false - - - Sleep Button - Button - /org/kde/solid/fakehw/computer - - SleepButton - false - - - Lid Switch - Button - /org/kde/solid/fakehw/computer - - LidButton - true - false - - - - Solid Processor #0 @@ -126,9 +92,7 @@ platform floppy true - false false - false @@ -174,9 +138,7 @@ scsi disk false - false false - false HD250GBSATA