Changeset View
Changeset View
Standalone View
Standalone View
src/plasma/svg.cpp
Show First 20 Lines • Show All 522 Lines • ▼ Show 20 Line(s) | 522 | if (themeFailed) { | |||
---|---|---|---|---|---|
523 | return QRectF(); | 523 | return QRectF(); | ||
524 | } | 524 | } | ||
525 | } | 525 | } | ||
526 | 526 | | |||
527 | if (path.isEmpty()) { | 527 | if (path.isEmpty()) { | ||
528 | return QRectF(); | 528 | return QRectF(); | ||
529 | } | 529 | } | ||
530 | 530 | | |||
531 | QString id = cacheId(elementId); | 531 | const QString id = cacheId(elementId); | ||
532 | 532 | const auto it = localRectCache.constFind(id); | |||
533 | if (localRectCache.contains(id)) { | 533 | if (it != localRectCache.constEnd()) { | ||
534 | return localRectCache.value(id); | 534 | return *it; | ||
535 | } | 535 | } | ||
536 | 536 | | |||
537 | QRectF rect; | 537 | QRectF rect; | ||
538 | bool found = cacheAndColorsTheme()->findInRectsCache(path, id, rect); | 538 | bool found = cacheAndColorsTheme()->findInRectsCache(path, id, rect); | ||
539 | //This is a corner case where we are *sure* the element is not valid | 539 | //This is a corner case where we are *sure* the element is not valid | ||
540 | if (found && rect == QRectF()) { | 540 | if (found && rect == QRectF()) { | ||
541 | return rect; | 541 | return rect; | ||
542 | } else if (found) { | 542 | } else if (found) { | ||
▲ Show 20 Lines • Show All 460 Lines • Show Last 20 Lines |