[Svg] Fix porting error from QRegExp::exactMatch

The CACHE_ID_NATURAL_SIZE adds stuff around the argument string, so explicitly move the ^ and $ outside.

Differential Revision: https://phabricator.kde.org/D22275
This commit is contained in:
Kai Uwe Broulik 2019-07-05 08:56:09 +02:00
parent 46f0da45c6
commit 214838313d

View File

@ -310,7 +310,7 @@ QPixmap SvgPrivate::findInCache(const QString &elementId, qreal ratio, const QSi
if (elementsWithSizeHints.isEmpty()) {
// Fetch all size hinted element ids from the theme's rect cache
// and store them locally.
const QRegularExpression sizeHintedKeyExpr(CACHE_ID_NATURAL_SIZE(QStringLiteral("$(\\d+)-(\\d+)-(.+)^"), status, ratio));
const QRegularExpression sizeHintedKeyExpr(QLatin1String("^") + CACHE_ID_NATURAL_SIZE(QStringLiteral("(\\d+)-(\\d+)-(.+)"), status, ratio) + QLatin1String("$"));
foreach (const QString &key, cacheAndColorsTheme()->listCachedRectKeys(path)) {
const auto match = sizeHintedKeyExpr.match(key);