support compressed svg files

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=835219
This commit is contained in:
Aaron J. Seigo 2008-07-20 09:23:59 +00:00
parent 85275b25ea
commit 9732101c83

View File

@ -282,10 +282,23 @@ QString Theme::themeName() const
QString Theme::imagePath(const QString& name) const
{
QString path = d->findInTheme(name + ".svg", d->themeName);
// look for a compressed svg file in the theme
QString path = d->findInTheme(name + ".svgz", d->themeName);
if (path.isEmpty()) {
// try for an uncompressed svg file
path = d->findInTheme(name + ".svg", d->themeName);
if (path.isEmpty() && d->themeName != ThemePrivate::defaultTheme) {
// try a compressed svg file in the default theme
path = d->findInTheme(name + ".svgz", ThemePrivate::defaultTheme);
if (path.isEmpty()) {
// try an uncompressed svg file in the default theme
path = d->findInTheme(name + ".svg", d->themeName);
}
}
if (path.isEmpty() && d->themeName != ThemePrivate::defaultTheme) {
path = d->findInTheme(name + ".svg", ThemePrivate::defaultTheme);
}
if (path.isEmpty()) {