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:
parent
1b945b8aff
commit
16b5fcc766
@ -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 {
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user