[Qt] Cleanup: Don't skip first sorting, seems that you don't need that kinda
authorIlkka Ollakka <ileoo@videolan.org>
Mon, 15 Dec 2008 12:39:28 +0000 (14:39 +0200)
committerIlkka Ollakka <ileoo@videolan.org>
Mon, 15 Dec 2008 12:39:28 +0000 (14:39 +0200)
 workaround to get items correctly ordered in playlist, just set sortingIndicator
 to right column and let playlist sort empty list when enabling sorting.

 Works for me, but please double check.

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

index dde688e..7caa13b 100644 (file)
@@ -735,16 +735,6 @@ void PLModel::sort( int column, Qt::SortOrder order )
     int i_index = -1;
     int i_flag = 0;
 
-    // FIXME: Disable sorting on startup by ignoring
-    // first call of sorting caused by showing dialog
-    // see: standardpanel.cpp:65
-    static bool b_first_time = true;
-    if( b_first_time )
-    {
-        b_first_time = false;
-        return;
-    }
-
     int i_column = 1;
     for( i_column = 1; i_column != COLUMN_END; i_column<<=1 )
     {
index 8bb6156..767169b 100644 (file)
@@ -63,8 +63,8 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
 
     /* Create and configure the QTreeView */
     view = new QVLCTreeView( 0 );
+    view->header()->setSortIndicator( 0 , Qt::AscendingOrder );
     view->setSortingEnabled( true );
-    view->sortByColumn( 0 , Qt::AscendingOrder );
     view->setModel( model );
     view->setIconSize( QSize( 20, 20 ) );
     view->setAlternatingRowColors( true );