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
This commit is contained in:
Martin Gräßlin 2017-01-02 19:55:03 +01:00
parent 9cc7d12158
commit a8db967505

View file

@ -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)