FrameSvg: make hasElementPrefix() also handle prefix with trailing -
Summary: there are a few places which potentially pass a prefix with a trailing -, e.g. if using directly the value of FrameSvg::prefix() or FrameSvg::actualPrefix(). Support the assumption in such code, unbreaking its currently not working behaviour. Reviewers: #plasma, mart Reviewed By: #plasma, mart Subscribers: apol, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D21174
This commit is contained in:
parent
6af447a848
commit
8899389c9f
@ -144,9 +144,12 @@ bool FrameSvg::hasElementPrefix(const QString &prefix) const
|
||||
//because it could make sense for certain themes to not have all the elements
|
||||
if (prefix.isEmpty()) {
|
||||
return hasElement(QStringLiteral("center"));
|
||||
} else {
|
||||
return hasElement(prefix % QLatin1String("-center"));
|
||||
}
|
||||
if (prefix.endsWith(QLatin1Char('-'))) {
|
||||
return hasElement(prefix % QLatin1String("center"));
|
||||
}
|
||||
|
||||
return hasElement(prefix % QLatin1String("-center"));
|
||||
}
|
||||
|
||||
bool FrameSvg::hasElementPrefix(Plasma::Types::Location location) const
|
||||
|
@ -212,7 +212,7 @@ public:
|
||||
/**
|
||||
* @return true if the svg has the necessary elements with the given prefix
|
||||
* to draw a frame
|
||||
* @param prefix the given prefix we want to check if drawable
|
||||
* @param prefix the given prefix we want to check if drawable (can have trailing '-' since 5.59)
|
||||
*/
|
||||
Q_INVOKABLE bool hasElementPrefix(const QString &prefix) const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user