[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdeartwork/kscreensaver/kdesavers
From: Ben Burton <bab () debian ! org>
Date: 2004-06-15 15:48:34
Message-ID: 20040615154834.6F11D9071 () office ! kde ! org
[Download RAW message or body]
CVS commit by benb:
Fixed a bug in kSlideShowSaver::loadNextImage() that causes an infinite
recursion (and thus a crash) if the file list is non-empty but contains
no loadable images. Reported as Debian bug #246767.
M +7 -6 slideshow.cpp 1.22
--- kdeartwork/kscreensaver/kdesavers/slideshow.cpp #1.21:1.22
@@ -811,6 +811,4 @@ void kSlideShowSaver::loadNextImage()
int num;
- if (mShowRandom)
- {
num = mFileList.count();
if (num <= 0) //no files in the directory
@@ -818,4 +816,7 @@ void kSlideShowSaver::loadNextImage()
return;
}
+
+ if (mShowRandom)
+ {
mFileIdx = rand() % num;
fname = mFileList[mFileIdx];
@@ -828,5 +829,4 @@ void kSlideShowSaver::loadNextImage()
else
{
- num = mFileList.count();
if (mFileIdx >= num) mFileIdx = 0;
fname = mFileList[mFileIdx];
@@ -837,4 +837,5 @@ void kSlideShowSaver::loadNextImage()
kdDebug() << "Failed to load image " << fname << endl;
mFileList.remove(fname);
+ mRandomList.remove(fname);
if (!mFileList.isEmpty())
loadNextImage();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic