Changeset View
Changeset View
Standalone View
Standalone View
src/plasma/svg.cpp
Show First 20 Lines • Show All 306 Lines • ▼ Show 20 Line(s) | 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(QLatin1String("^") + CACHE_ID_NATURAL_SIZE(QStringLiteral("(\\d+)-(\\d+)-(.+)"), status, ratio) + QLatin1String("$")); | 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 | const auto lst = cacheAndColorsTheme()->listCachedRectKeys(path); | ||
316 | for (const QString &key : lst) { | ||||
316 | const auto match = sizeHintedKeyExpr.match(key); | 317 | const auto match = sizeHintedKeyExpr.match(key); | ||
317 | if (match.hasMatch()) { | 318 | if (match.hasMatch()) { | ||
318 | QString baseElementId = match.captured(3); | 319 | QString baseElementId = match.captured(3); | ||
319 | QSize sizeHint(match.capturedRef(1).toInt(), | 320 | QSize sizeHint(match.capturedRef(1).toInt(), | ||
320 | match.capturedRef(2).toInt()); | 321 | match.capturedRef(2).toInt()); | ||
321 | | ||||
322 | if (sizeHint.isValid()) { | 322 | if (sizeHint.isValid()) { | ||
323 | elementsWithSizeHints.insert(baseElementId, sizeHint); | 323 | elementsWithSizeHints.insert(baseElementId, sizeHint); | ||
324 | } | 324 | } | ||
325 | } | 325 | } | ||
326 | } | 326 | } | ||
327 | 327 | | |||
328 | if (elementsWithSizeHints.isEmpty()) { | 328 | if (elementsWithSizeHints.isEmpty()) { | ||
329 | // Make sure we won't query the theme unnecessarily. | 329 | // Make sure we won't query the theme unnecessarily. | ||
▲ Show 20 Lines • Show All 675 Lines • Show Last 20 Lines |