Detect that we are looking for an empty element and quit early
Otherwise we just go through all the fallbacks unnecessarily
This commit is contained in:
parent
fe7598c6ef
commit
93de15f545
@ -108,7 +108,7 @@ void FrameSvg::setElementPrefix(Plasma::Types::Location location)
|
|||||||
|
|
||||||
void FrameSvg::setElementPrefix(const QString &prefix)
|
void FrameSvg::setElementPrefix(const QString &prefix)
|
||||||
{
|
{
|
||||||
if (!hasElement(prefix % QLatin1String("-center"))) {
|
if (prefix.isEmpty() || !hasElement(prefix % QLatin1String("-center"))) {
|
||||||
d->prefix.clear();
|
d->prefix.clear();
|
||||||
} else {
|
} else {
|
||||||
d->prefix = prefix;
|
d->prefix = prefix;
|
||||||
|
@ -868,7 +868,7 @@ QRectF Svg::elementRect(const QString &elementId) const
|
|||||||
|
|
||||||
bool Svg::hasElement(const QString &elementId) const
|
bool Svg::hasElement(const QString &elementId) const
|
||||||
{
|
{
|
||||||
if (d->path.isNull() && d->themePath.isNull()) {
|
if (elementId.isEmpty() || (d->path.isNull() && d->themePath.isNull())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user