summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Gilg <[email protected]>2016-11-10 14:20:41 +0100
committerRoman Gilg <[email protected]>2016-11-10 14:20:41 +0100
commit77463a0143d8607e5c923ce3f6a316493be2e012 (patch)
treef2899c7b8c8d40bf372016a98d7941a02b13adc3
parentdaef6a7178982be93025a25d7f97071c35242547 (diff)
[Touchpad KCM] Prevent save dialog if no touchpad was found
Summary: If there is no touchpad found, the KCM still allways asked if the settings are supposed to be saved because the widget gets changed although no options have and can be changed. This little patch prevents it. Test plan: With and without touchpad. Reviewers: #plasma Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D3324
-rw-r--r--kcms/touchpad/src/backends/x11/xlibbackend.h1
-rw-r--r--kcms/touchpad/src/kcm/touchpadconfig.cpp3
-rw-r--r--kcms/touchpad/src/touchpadbackend.h1
3 files changed, 5 insertions, 0 deletions
diff --git a/kcms/touchpad/src/backends/x11/xlibbackend.h b/kcms/touchpad/src/backends/x11/xlibbackend.h
index 4aa006e..60ba179 100644
--- a/kcms/touchpad/src/backends/x11/xlibbackend.h
+++ b/kcms/touchpad/src/backends/x11/xlibbackend.h
@@ -53,6 +53,7 @@ public:
return m_device ? m_device->supportedParameters() : QStringList();
}
const QString &errorString() const { return m_errorString; }
+ bool hasTouchpad() const { return m_device; }
void setTouchpadOff(TouchpadOffState) Q_DECL_OVERRIDE;
TouchpadOffState getTouchpadOff() Q_DECL_OVERRIDE;
diff --git a/kcms/touchpad/src/kcm/touchpadconfig.cpp b/kcms/touchpad/src/kcm/touchpadconfig.cpp
index 7460d45..e487877 100644
--- a/kcms/touchpad/src/kcm/touchpadconfig.cpp
+++ b/kcms/touchpad/src/kcm/touchpadconfig.cpp
@@ -326,6 +326,9 @@ void TouchpadConfig::defaults()
void TouchpadConfig::checkChanges()
{
+ if (!m_backend->hasTouchpad()) {
+ return;
+ }
unmanagedWidgetChangeState(m_manager->hasChangedFuzzy()
|| m_configOutOfSync);
if (m_configOutOfSync) {
diff --git a/kcms/touchpad/src/touchpadbackend.h b/kcms/touchpad/src/touchpadbackend.h
index 2f8093f..469f8ec 100644
--- a/kcms/touchpad/src/touchpadbackend.h
+++ b/kcms/touchpad/src/touchpadbackend.h
@@ -39,6 +39,7 @@ public:
virtual bool getConfig(QVariantHash &) = 0;
virtual QStringList supportedParameters() const = 0;
virtual const QString &errorString() const = 0;
+ virtual bool hasTouchpad() const = 0;
enum TouchpadOffState {
TouchpadEnabled, TouchpadTapAndScrollDisabled, TouchpadFullyDisabled