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

List:       kde-commits
Subject:    kdemultimedia/noatun/modules/splitplaylist
From:       Stefan Gehn <sgehn () gmx ! net>
Date:       2003-11-16 15:22:14
[Download RAW message or body]

CVS commit by metz: 

fix bug #67959
deprecated--


  M +24 -16    playlist.cpp   1.47


--- kdemultimedia/noatun/modules/splitplaylist/playlist.cpp  #1.46:1.47
@@ -69,9 +69,13 @@ PlaylistItem SplitPlaylist::next(bool pl
         else
         {
+                if(!current())
+                {
+                        nextItem = \
static_cast<SafeListViewItem*>(static_cast<SafeListViewItem*>(getFirst().data())); +  \
} +                else
+                {
                 nextItem = static_cast<SafeListViewItem*>(
-                                static_cast<SafeListViewItem*>(
-                                                current().data()
-                                        )->itemBelow()
-                        );
+                                \
static_cast<SafeListViewItem*>(current().data())->itemBelow()); +                }
         }
 
@@ -125,9 +129,14 @@ PlaylistItem SplitPlaylist::previous()
         // from the above branch
 
-        PlaylistItem nextItem = static_cast<SafeListViewItem*>(
-                        static_cast<SafeListViewItem*>(
-                                        current().data()
-                                )->itemAbove()
-                );
+        PlaylistItem nextItem;
+        if(!current())
+        {
+                nextItem = \
static_cast<SafeListViewItem*>(static_cast<SafeListViewItem*>(getFirst().data())); +  \
} +        else
+        {
+                nextItem = static_cast<SafeListViewItem*>(
+                        \
static_cast<SafeListViewItem*>(current().data())->itemAbove()); +        }
         setCurrent(nextItem);
 
@@ -202,5 +211,5 @@ void SplitPlaylist::setCurrent(const Pla
 
                 now=static_cast<SafeListViewItem*>(current().data());
-                if (now)
+                if(now)
                         now->setPixmap(0, ::SmallIcon("noatunplay"));
         }
@@ -230,5 +239,5 @@ void SplitPlaylist::randomize()
         QPtrList<void> list;
         QPtrList<QListViewItem> items;
-        for ( int i = 0; i < lview->childCount(); i++ )
+        for(int i = 0; i < lview->childCount(); i++)
         {
                 list.append( (void*) i );
@@ -239,8 +248,7 @@ void SplitPlaylist::randomize()
         seq.randomize( &list );
 
-        for ( int i = 0; i < lview->childCount(); i++ )
+        for(int i = 0; i < lview->childCount(); i++)
         {
-                lview->moveItem( items.take(), 0,
-                                 lview->itemAtIndex( (int) list.take() ) );
+                items.take()->moveItem(lview->itemAtIndex((int) list.take()));
         }
 


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

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