Changeset View
Changeset View
Standalone View
Standalone View
src/plasma/svg.cpp
Show First 20 Lines • Show All 304 Lines • ▼ Show 20 Line(s) | |||||
305 | QPixmap SvgPrivate::findInCache(const QString &elementId, qreal ratio, const QSizeF &s) | 305 | QPixmap SvgPrivate::findInCache(const QString &elementId, qreal ratio, const QSizeF &s) | ||
306 | { | 306 | { | ||
307 | QSize size; | 307 | QSize size; | ||
308 | QString actualElementId; | 308 | QString actualElementId; | ||
309 | 309 | | |||
310 | if (elementsWithSizeHints.isEmpty()) { | 310 | if (elementsWithSizeHints.isEmpty()) { | ||
311 | // Fetch all size hinted element ids from the theme's rect cache | 311 | // Fetch all size hinted element ids from the theme's rect cache | ||
312 | // and store them locally. | 312 | // and store them locally. | ||
313 | const QRegularExpression sizeHintedKeyExpr(CACHE_ID_NATURAL_SIZE(QStringLiteral("$(\\d+)-(\\d+)-(.+)^"), status, ratio)); | 313 | const QRegularExpression sizeHintedKeyExpr(QLatin1String("^") + CACHE_ID_NATURAL_SIZE(QStringLiteral("(\\d+)-(\\d+)-(.+)"), status, ratio) + QLatin1String("$")); | ||
314 | 314 | | |||
315 | foreach (const QString &key, cacheAndColorsTheme()->listCachedRectKeys(path)) { | 315 | foreach (const QString &key, cacheAndColorsTheme()->listCachedRectKeys(path)) { | ||
316 | const auto match = sizeHintedKeyExpr.match(key); | 316 | const auto match = sizeHintedKeyExpr.match(key); | ||
317 | if (match.hasMatch()) { | 317 | if (match.hasMatch()) { | ||
318 | QString baseElementId = match.captured(3); | 318 | QString baseElementId = match.captured(3); | ||
319 | QSize sizeHint(match.capturedRef(1).toInt(), | 319 | QSize sizeHint(match.capturedRef(1).toInt(), | ||
320 | match.capturedRef(2).toInt()); | 320 | match.capturedRef(2).toInt()); | ||
321 | 321 | | |||
▲ Show 20 Lines • Show All 683 Lines • Show Last 20 Lines |