Commit 95ee0524 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

[effects/blur] Lookup window once when disconnecting from blurChanged

Summary:
When disconnecting from `blurChanged` signal, `(w, connection)` pair is
being looked up three times. We can do better by using `QMap` in a more
STL-like way.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13118
parent 54b69bec
......@@ -303,10 +303,12 @@ void BlurEffect::slotWindowAdded(EffectWindow *w)
void BlurEffect::slotWindowDeleted(EffectWindow *w)
{
if (windowBlurChangedConnections.contains(w)) {
disconnect(windowBlurChangedConnections[w]);
windowBlurChangedConnections.remove(w);
auto it = windowBlurChangedConnections.find(w);
if (it == windowBlurChangedConnections.end()) {
return;
}
disconnect(*it);
windowBlurChangedConnections.erase(it);
}
void BlurEffect::slotPropertyNotify(EffectWindow *w, long atom)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment