[vlc-devel] commit: playlist startup sorting fix (Lukas Durfina )
git version control
git at videolan.org
Mon May 12 16:39:38 CEST 2008
vlc | branch: master | Lukas Durfina <lukas.durfina at gmail.com> | Mon May 12 07:24:29 2008 +0200| [45213c5d5c123a6ae14167ee58e86297cdec9de4]
playlist startup sorting fix
playlist startup sorting fix
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=45213c5d5c123a6ae14167ee58e86297cdec9de4
---
.../gui/qt4/components/playlist/playlist_model.cpp | 10 ++++++++++
.../gui/qt4/components/playlist/standardpanel.cpp | 4 ++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index d32c4d0..0ac5b5a 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -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 ) ) \
diff --git a/modules/gui/qt4/components/playlist/standardpanel.cpp b/modules/gui/qt4/components/playlist/standardpanel.cpp
index a8b0cf0..b8aa300 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->setSortingEnabled( true );
- view->sortByColumn( -1, Qt::AscendingOrder );
- view->setModel(model);
+ view->sortByColumn( 0 , Qt::AscendingOrder );
+ view->setModel( model );
view->setIconSize( QSize( 20, 20 ) );
view->setAlternatingRowColors( true );
view->setAnimated( true );
More information about the vlc-devel
mailing list