FrameSvgItem: emit maskChanged always from doUpdate()

Summary:
In that method we can assue a high chance that the mask is also affected.
Instead of adding complicated additional code to track if the mask
really changed, we rely on the cached value from FrameSvg.
This method is not too often called in a Plasma session, so that
further optimization work to avoid unneccesary emits seems not yet
worth it.

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D21179
This commit is contained in:
Friedrich W. H. Kossebau 2019-05-13 08:20:33 +02:00
parent 9142155b5a
commit 084ba0f886

View File

@ -272,7 +272,6 @@ FrameSvgItem::FrameSvgItem(QQuickItem *parent)
connect(&Units::instance(), &Units::devicePixelRatioChanged, this, &FrameSvgItem::updateDevicePixelRatio);
connect(m_frameSvg, &Svg::fromCurrentThemeChanged, this, &FrameSvgItem::fromCurrentThemeChanged);
connect(m_frameSvg, &Svg::statusChanged, this, &FrameSvgItem::statusChanged);
connect(m_frameSvg, &Svg::sizeChanged, this, &FrameSvgItem::maskChanged);
}
FrameSvgItem::~FrameSvgItem()
@ -507,6 +506,7 @@ void FrameSvgItem::doUpdate()
update();
emit maskChanged();
emit repaintNeeded();
}