From 1a78a1572777a17318146421d2a60b7db2474088 Mon Sep 17 00:00:00 2001 From: David Flynn Date: Sun, 26 Oct 2008 17:33:14 +0100 Subject: [PATCH] [qt4/recents] Remove dependency on qt4.4 for QList::removeOne() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémi Duraffort --- modules/gui/qt4/recents.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/gui/qt4/recents.cpp b/modules/gui/qt4/recents.cpp index b1bbf8535f..46a1fa0051 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 { -- 2.20.1