mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
plasma: wallpaper cache lookup optimization
QFile::exists() uses temporary QFileInfo object that does the same Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
d4ac838463
commit
b403cadd86
1 changed files with 6 additions and 6 deletions
|
@ -552,10 +552,10 @@ bool WallpaperPrivate::findInCache(const QString &key, unsigned int lastModified
|
|||
{
|
||||
if (cacheRendering) {
|
||||
QString cache = cachePath(key);
|
||||
if (QFile::exists(cache)) {
|
||||
QFileInfo cacheinfo(cache);
|
||||
if (cacheinfo.exists() && cacheinfo.isFile()) {
|
||||
if (lastModified > 0) {
|
||||
QFileInfo info(cache);
|
||||
if (info.lastModified().toTime_t() < lastModified) {
|
||||
if (cacheinfo.lastModified().toTime_t() < lastModified) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -574,10 +574,10 @@ bool Wallpaper::findInCache(const QString &key, QImage &image, unsigned int last
|
|||
{
|
||||
if (d->cacheRendering) {
|
||||
QString cache = d->cachePath(key);
|
||||
if (QFile::exists(cache)) {
|
||||
QFileInfo cacheinfo(cache);
|
||||
if (cacheinfo.exists() && cacheinfo.isFile()) {
|
||||
if (lastModified > 0) {
|
||||
QFileInfo info(cache);
|
||||
if (info.lastModified().toTime_t() < lastModified) {
|
||||
if (cacheinfo.lastModified().toTime_t() < lastModified) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue