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:
parent
9cc7d12158
commit
a8db967505
1 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue