save a couple when searching deeper

svn path=/trunk/KDE/kdelibs/; revision=1182546
This commit is contained in:
Aaron J. Seigo 2010-10-04 21:50:42 +00:00
parent 4eafdd6b27
commit 103415153b

View File

@ -651,11 +651,13 @@ QString Theme::imagePath(const QString &name) const
return QString(); return QString();
} }
QString path = d->findInTheme(name % QLatin1Literal(".svgz"), d->themeName); const QString svgzName = name % QLatin1Literal(".svgz");
QString path = d->findInTheme(svgzName, d->themeName);
if (path.isEmpty()) { if (path.isEmpty()) {
// try for an uncompressed svg file // try for an uncompressed svg file
path = d->findInTheme(name % QLatin1Literal(".svg"), d->themeName); const QString svgName = name % QLatin1Literal(".svg");
path = d->findInTheme(svgName, d->themeName);
// search in fallback themes if necessary // search in fallback themes if necessary
for (int i = 0; path.isEmpty() && i < d->fallbackThemes.count(); ++i) { for (int i = 0; path.isEmpty() && i < d->fallbackThemes.count(); ++i) {
@ -664,11 +666,11 @@ QString Theme::imagePath(const QString &name) const
} }
// try a compressed svg file in the fallback theme // try a compressed svg file in the fallback theme
path = d->findInTheme(name % QLatin1Literal(".svgz"), d->fallbackThemes[i]); path = d->findInTheme(svgzName % QLatin1Char('z'), d->fallbackThemes[i]);
if (path.isEmpty()) { if (path.isEmpty()) {
// try an uncompressed svg file in the fallback theme // try an uncompressed svg file in the fallback theme
path = d->findInTheme(name % QLatin1Literal(".svg"), d->fallbackThemes[i]); path = d->findInTheme(svgName, d->fallbackThemes[i]);
} }
} }
} }