]> git.sesse.net Git - vlc/commitdiff
[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 dde688ebaa60cfff129af1b09142df692d84b86e..7caa13b519fefd2a06b62503b571165ed716265b 100644 (file)
@@ -735,16 +735,6 @@ void PLModel::sort( int column, Qt::SortOrder order )
     int i_index = -1;
     int i_flag = 0;
 
     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 )
     {
     int i_column = 1;
     for( i_column = 1; i_column != COLUMN_END; i_column<<=1 )
     {
index 8bb61563be007dcc0ddefabcee2f3b531e02909a..767169bbf4716dc1968f1651b1c7d83c61eaecd9 100644 (file)
@@ -63,8 +63,8 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
 
     /* Create and configure the QTreeView */
     view = new QVLCTreeView( 0 );
 
     /* Create and configure the QTreeView */
     view = new QVLCTreeView( 0 );
+    view->header()->setSortIndicator( 0 , Qt::AscendingOrder );
     view->setSortingEnabled( true );
     view->setSortingEnabled( true );
-    view->sortByColumn( 0 , Qt::AscendingOrder );
     view->setModel( model );
     view->setIconSize( QSize( 20, 20 ) );
     view->setAlternatingRowColors( true );
     view->setModel( model );
     view->setIconSize( QSize( 20, 20 ) );
     view->setAlternatingRowColors( true );