cache whether or not the wallaper is actually a full package (dir + metadata) and on render hints changing just look for the best paper if we are a full package; preserves rendering for single image papers in the wallpaper config

BUG:212930

svn path=/trunk/KDE/kdelibs/; revision=1044424
This commit is contained in:
Aaron J. Seigo 2009-11-03 18:35:40 +00:00
parent 1b945b8aff
commit 16b5fcc766
2 changed files with 8 additions and 3 deletions

View File

@ -174,7 +174,8 @@ ThemePackage::ThemePackage(QObject *parent)
WallpaperPackage::WallpaperPackage(Wallpaper *paper, QObject *parent) WallpaperPackage::WallpaperPackage(Wallpaper *paper, QObject *parent)
: PackageStructure(parent, "Background"), : PackageStructure(parent, "Background"),
m_paper(paper) m_paper(paper),
m_fullPackage(true)
{ {
QStringList mimetypes; QStringList mimetypes;
mimetypes << "image/svg" << "image/png" << "image/jpeg" << "image/jpg"; mimetypes << "image/svg" << "image/png" << "image/jpeg" << "image/jpg";
@ -193,7 +194,9 @@ WallpaperPackage::WallpaperPackage(Wallpaper *paper, QObject *parent)
void WallpaperPackage::renderHintsChanged() void WallpaperPackage::renderHintsChanged()
{ {
pathChanged(); if (m_fullPackage) {
findBestPaper();
}
} }
void WallpaperPackage::pathChanged() void WallpaperPackage::pathChanged()
@ -208,7 +211,8 @@ void WallpaperPackage::pathChanged()
QFileInfo info(path()); QFileInfo info(path());
if (info.isDir()) { m_fullPackage = info.isDir();
if (m_fullPackage) {
setContentsPrefix("contents/"); setContentsPrefix("contents/");
findBestPaper(); findBestPaper();
} else { } else {

View File

@ -80,6 +80,7 @@ private Q_SLOTS:
private: private:
Wallpaper *m_paper; Wallpaper *m_paper;
bool m_fullPackage;
}; };
class ContainmentActionsPackage : public PackageStructure class ContainmentActionsPackage : public PackageStructure