Qt4: only apply search to inserted items when search isn't empty
authorIlkka Ollakka <ileoo@videolan.org>
Sat, 21 Jan 2012 23:36:32 +0000 (01:36 +0200)
committerIlkka Ollakka <ileoo@videolan.org>
Sat, 21 Jan 2012 23:37:40 +0000 (01:37 +0200)
This means we don't rebuild() everything with every item when we populate
playlist without search

modules/gui/qt4/components/playlist/playlist_model.cpp

index fa9bd97..a248ed3 100644 (file)
@@ -654,6 +654,7 @@ void PLModel::processItemAppend( int i_item, int i_parent )
     if( newItem->inputItem() == THEMIM->currentInputItem() )
         emit currentIndexChanged( index( newItem, 0 ) );
 
+    if( latestSearch.isEmpty() ) return;
     search( latestSearch, index( rootItem, 0), false /*FIXME*/ );
 }