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

List:       kde-commits
Subject:    branches/KDE/3.4/kdemultimedia/juk
From:       Michael Pyne <michael.pyne () kdemail ! net>
Date:       2005-08-18 2:25:14
Message-ID: 1124331914.006630.5149.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 450395 by mpyne:

Backport fix for bug 102238 (Random play is not random between starts) to KDE
3.4.

BUG:102238


 M  +4 -5      tracksequenceiterator.cpp  


--- branches/KDE/3.4/kdemultimedia/juk/tracksequenceiterator.cpp #450394:450395
@@ -14,10 +14,9 @@
  ***************************************************************************/
 
 #include <kaction.h>
+#include <kapplication.h>
 #include <kdebug.h>
 
-#include <stdlib.h>
-
 #include "tracksequenceiterator.h"
 #include "playlist.h"
 #include "actioncollection.h"
@@ -81,7 +80,7 @@
 
         if(albumRandom) {
             if(m_albumSearch.isNull() || m_albumSearch.matchedItems().isEmpty()) {
-                item = m_randomItems[::random() % m_randomItems.count()];
+                item = m_randomItems[KApplication::random() % m_randomItems.count()];
                 initAlbumSearch(item);
             }
 
@@ -107,7 +106,7 @@
             }
         }
         else
-            item = m_randomItems[::random() % m_randomItems.count()];
+            item = m_randomItems[KApplication::random() % m_randomItems.count()];
 
         setCurrent(item);
         m_randomItems.remove(item);
@@ -148,7 +147,7 @@
 
         PlaylistItem *newItem = 0;
         if(!items.isEmpty())
-            newItem = items[::random() % items.count()];
+            newItem = items[KApplication::random() % items.count()];
 
         setCurrent(newItem);
         refillRandomList();
[prev in list] [next in list] [prev in thread] [next in thread] 

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