]> git.sesse.net Git - vlc/commitdiff
playlist startup sorting fix
authorLukas Durfina <lukas.durfina@gmail.com>
Mon, 12 May 2008 05:24:29 +0000 (07:24 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 12 May 2008 14:40:47 +0000 (07:40 -0700)
playlist startup sorting fix

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp

index d32c4d08375bd81c6b657d94c4348a500bfa19a6..0ac5b5a37c81d7db49219662ab312ece8714f2af 100644 (file)
@@ -715,6 +715,16 @@ 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;
+    }
+
 #define CHECK_COLUMN( meta )                        \
 {                                                   \
     if( ( shownFlags() & meta ) )                   \
index a8b0cf09e0d354c0eef165b9d2e0663466b4ede6..b8aa3000178a08afe03d582951ff308c0adc9342 100644 (file)
@@ -63,8 +63,8 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
     /* Create and configure the QTreeView */
     view = new QVLCTreeView( 0 );
     view->setSortingEnabled( true );
-    view->sortByColumn( -1, Qt::AscendingOrder );
-    view->setModel(model);
+    view->sortByColumn( , Qt::AscendingOrder );
+    view->setModel( model );
     view->setIconSize( QSize( 20, 20 ) );
     view->setAlternatingRowColors( true );
     view->setAnimated( true );