[vlc-devel] commit: [Qt] Cleanup: Don't skip first sorting, seems that you don' t need that kinda (Ilkka Ollakka )

git version control git at videolan.org
Mon Dec 15 13:42:32 CET 2008


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Mon Dec 15 14:39:28 2008 +0200| [81ae8cecfb3c99dd66b8a87599a3ff1f8ee44dfc] | committer: Ilkka Ollakka 

[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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=81ae8cecfb3c99dd66b8a87599a3ff1f8ee44dfc
---

 .../gui/qt4/components/playlist/playlist_model.cpp |   10 ----------
 .../gui/qt4/components/playlist/standardpanel.cpp  |    2 +-
 2 files changed, 1 insertions(+), 11 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index dde688e..7caa13b 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 8bb6156..767169b 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 );




More information about the vlc-devel mailing list