From 81ae8cecfb3c99dd66b8a87599a3ff1f8ee44dfc Mon Sep 17 00:00:00 2001 From: Ilkka Ollakka Date: Mon, 15 Dec 2008 14:39:28 +0200 Subject: [PATCH] [Qt] Cleanup: Don't skip first sorting, seems that you don't need that kinda 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 | 10 ---------- modules/gui/qt4/components/playlist/standardpanel.cpp | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp index dde688ebaa..7caa13b519 100644 --- a/modules/gui/qt4/components/playlist/playlist_model.cpp +++ b/modules/gui/qt4/components/playlist/playlist_model.cpp @@ -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 ) { diff --git a/modules/gui/qt4/components/playlist/standardpanel.cpp b/modules/gui/qt4/components/playlist/standardpanel.cpp index 8bb61563be..767169bbf4 100644 --- a/modules/gui/qt4/components/playlist/standardpanel.cpp +++ b/modules/gui/qt4/components/playlist/standardpanel.cpp @@ -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 ); -- 2.39.2