[vlc-devel] [PATCH] [qt4/recents] Remove dependency on qt4.4 for	QList::removeOne()
    David Flynn 
    davidf+nntp at woaf.net
       
    Sat Oct 25 15:38:56 CEST 2008
    
    
  
From: David Flynn <davidf at rd.bbc.co.uk>
Signed-off-by: David Flynn <davidf at woaf.net>
---
 modules/gui/qt4/recents.cpp |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/modules/gui/qt4/recents.cpp b/modules/gui/qt4/recents.cpp
index b1bbf85..46a1fa0 100644
--- a/modules/gui/qt4/recents.cpp
+++ b/modules/gui/qt4/recents.cpp
@@ -63,10 +63,11 @@ void RecentsMRL::addRecent( const QString &mrl )
         return;
 
     msg_Dbg( p_intf, "Adding a new MRL to recent ones: %s", qtu( mrl ) );
-    if( stack->contains( mrl ) )
+    int i_index = stack->indexOf( mrl );
+    if( 0 <= i_index )
     {
-        stack->removeOne( mrl );
-        stack->prepend( mrl );
+        /* move to the front */
+        stack->move( i_index, 0 );
     }
     else
     {
-- 
1.5.4.3
    
    
More information about the vlc-devel
mailing list