Commit cdd26d2f authored by Jakob Leben's avatar Jakob Leben

Qt: playlist (Fix #3248) Set model after sorting enabled to prevent sorting immediately

And add a debug msg when sorting happens.
parent 1adc6693
......@@ -815,6 +815,8 @@ void PLModel::sort( int column, Qt::SortOrder order )
void PLModel::sort( int i_root_id, int column, Qt::SortOrder order )
{
msg_Dbg( p_intf, "Sorting by column %i, order %i", column, order );
int meta = columnToMeta( column );
if( meta == COLUMN_END ) return;
......
......@@ -295,7 +295,6 @@ void StandardPLPanel::createTreeView()
{
/* Create and configure the QTreeView */
treeView = new QTreeView;
treeView->setModel( model );
treeView->setIconSize( QSize( 20, 20 ) );
treeView->setAlternatingRowColors( true );
......@@ -314,6 +313,9 @@ void StandardPLPanel::createTreeView()
treeView->setDropIndicatorShown( true );
treeView->setContextMenuPolicy( Qt::CustomContextMenu );
/* setModel after setSortingEnabled(true), or the model will sort immediately! */
treeView->setModel( model );
if( getSettings()->contains( "headerStateV2" ) )
{
treeView->header()->restoreState(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment