Summary: | multiple wallpapers attempts to load non-graphic files | ||
---|---|---|---|
Product: | kdesktop | Reporter: | slambo |
Component: | general | Assignee: | David Faure <faure> |
Status: | CLOSED FIXED | ||
Severity: | normal | CC: | finex |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
slambo
2001-05-10 15:38:49 UTC
Subject: kdebase/kcontrol/background CVS commit by waba: CCMAIL: 25541-done@bugs.kde.org Skip files that aren't images in slide show mode. M +4 -1 bgrender.cpp 1.3 M +20 -2 bgsettings.cpp 1.5 M +5 -1 bgsettings.h 1.22 --- kdebase/kcontrol/background/bgsettings.cpp #1.4:1.5 @@ -859,5 +859,10 @@ void KBackgroundSettings::updateWallpape QStringList::Iterator it; for (it=lst.begin(); it!=lst.end(); it++) - m_WallpaperFiles.append(dir.absFilePath(*it)); + { + file = dir.absFilePath(*it); + QFileInfo fi(file); + if (fi.isFile() && fi.isReadable()) + m_WallpaperFiles.append(file); + } } } @@ -901,4 +906,17 @@ QString KBackgroundSettings::currentWall return m_WallpaperFiles[m_CurrentWallpaper]; return QString(); +} + +bool KBackgroundSettings::discardCurrentWallpaper() +{ + if (m_MultiMode == NoMulti || m_MultiMode == NoMultiRandom) + { + return false; + } + m_WallpaperFiles.remove(m_WallpaperFiles.at(m_CurrentWallpaper)); + if (m_CurrentWallpaper >= (int) m_WallpaperFiles.count()) + m_CurrentWallpaper = 0; + + return true; } --- kdebase/kcontrol/background/bgsettings.h #1.21:1.22 @@ -228,4 +228,8 @@ public: QString currentWallpaper(); + /* + * @return true if the currentWallpaper has changed + */ + bool discardCurrentWallpaper(); int lastWallpaperChange() const { return m_LastChange; } bool needWallpaperChange(); --- kdebase/kcontrol/background/bgrender.cpp #1.2:1.3 @@ -277,4 +277,5 @@ int KBackgroundRenderer::doWallpaper(boo QImage wp; if (wpmode != NoWallpaper) { +wp_load: if (currentWallpaper().isEmpty()) { wpmode = NoWallpaper; @@ -289,4 +290,6 @@ int KBackgroundRenderer::doWallpaper(boo wp.load(file); if (wp.isNull()) { + if (discardCurrentWallpaper()) + goto wp_load; wpmode = NoWallpaper; goto wp_out; Bug closed. Kdesktop is no more mantained. |