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)
|
||||
{
|
||||
if (!hasElement(prefix % QLatin1String("-center"))) {
|
||||
if (prefix.isEmpty() || !hasElement(prefix % QLatin1String("-center"))) {
|
||||
d->prefix.clear();
|
||||
} else {
|
||||
d->prefix = prefix;
|
||||
|
@ -868,7 +868,7 @@ QRectF Svg::elementRect(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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user