aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Gräßlin <[email protected]>2017-01-02 19:55:03 +0100
committerMartin Gräßlin <[email protected]>2017-01-02 19:55:08 +0100
commita8db967505958ff4ee1a528213a30ca8905cdb25 (patch)
tree368be9f445882dd2a62a4065886f7e4c6753b5c5
parent9cc7d12158fa77269c5cb73113da304010ce2b51 (diff)
Use removeOne when uninstalling an InputEventFilter
Summary: Adjusting to a difference from introducing the InputEventSpy. A filter may only be installed once. Thus removeOne is totally sufficient. Added a Q_ASSERT to ensure that it is not installed when installing. Reviewers: #kwin, #plasma, mart Reviewed By: mart Subscribers: mart, plasma-devel, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D3878
-rw-r--r--input.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/input.cpp b/input.cpp
index 708e210..8241d3c 100644
--- a/input.cpp
+++ b/input.cpp
@@ -1371,17 +1371,19 @@ InputRedirection::~InputRedirection()
void InputRedirection::installInputEventFilter(InputEventFilter *filter)
{
+ Q_ASSERT(!m_filters.contains(filter));
m_filters << filter;
}
void InputRedirection::prepandInputEventFilter(InputEventFilter *filter)
{
+ Q_ASSERT(!m_filters.contains(filter));
m_filters.prepend(filter);
}
void InputRedirection::uninstallInputEventFilter(InputEventFilter *filter)
{
- m_filters.removeAll(filter);
+ m_filters.removeOne(filter);
}
void InputRedirection::installInputEventSpy(InputEventSpy *spy)