[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdeartwork/kscreensaver/kdesavers
From:       Chris Howells <howells () kde ! org>
Date:       2003-04-24 15:16:38
[Download RAW message or body]

CVS commit by howells: 

Get rid of one of the QStringLists, I see absolutely no need why one is needed for \
random mode and one for "normal" mode.


  M +4 -7      slideshow.cpp   1.13
  M +0 -1      slideshow.h   1.6


--- kdeartwork/kscreensaver/kdesavers/slideshow.cpp  #1.12:1.13
@@ -776,14 +776,13 @@ void kSlideShowSaver::loadNextImage()
   if (mShowRandom)
   {
-    num = mRandomList.count();
+    num = mFileList.count();
     if (num <= 0)
     {
-      mRandomList = mFileList;
-      num = mRandomList.count();
+      num = mFileList.count();
     }
     if (num <= 0) return;
     mFileIdx = rand() % num;
-    fname = mRandomList[mFileIdx];
-    mRandomList.remove(fname);
+    fname = mFileList[mFileIdx];
+    mFileList.remove(fname);
   }
   else
@@ -798,5 +797,4 @@ void kSlideShowSaver::loadNextImage()
     kdDebug() << "Failed to load image " << fname << endl;
     mFileList.remove(fname);
-    mRandomList.remove(fname);
     if (!mFileList.isEmpty()) loadNextImage();
     return;
@@ -818,5 +816,4 @@ void kSlideShowSaver::loadDirectory()
   mFileList.clear();
   traverseDirectory(mDirectory);
-  mRandomList = mFileList;
 }
 

--- kdeartwork/kscreensaver/kdesavers/slideshow.h  #1.5:1.6
@@ -90,5 +90,4 @@ protected:
   int mColorContext;
   QStringList mFileList;
-  QStringList mRandomList;
   int mFileIdx;
   QImage mImage;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic