Commit 3213591d authored by Jakob Leben's avatar Jakob Leben

qt4: playlist: allow to hide all but the index 0 column

In some circumstances QTreeView does not behave properly if the column index 0 can hide/reappear.

Precisely, when column 0 is hidden and an item get's subitems, those subitems can not be D&D-ed.
If column 0 is then unhidden, trying to D&D the subitems will fail or result in unexpected behaviour.
parent 18005d71
......@@ -269,8 +269,10 @@ void StandardPLPanel::popupSelectColumn( QPoint pos )
{
QMenu menu;
/* We do not offer the option to hide index 0 column, or
* QTreeView will behave weird */
int i, j;
for( i = 1, j = 0; i < COLUMN_END; i <<= 1, j++ )
for( i = 1 << 1, j = 1; i < COLUMN_END; i <<= 1, j++ )
{
QAction* option = menu.addAction(
qfu( psz_column_title( i ) ) );
......@@ -284,19 +286,7 @@ void StandardPLPanel::popupSelectColumn( QPoint pos )
void StandardPLPanel::toggleColumnShown( int i )
{
if( view->isColumnHidden( i ) )
{
view->setColumnHidden( i, false );
}
else
{
int visible = 0;
int m, c;
for( m = 1, c = 0; m != COLUMN_END && visible < 2; m <<= 1, c++ )
if( !view->isColumnHidden( c ) ) visible++;
if( visible < 2 ) return;
view->setColumnHidden( i, true );
}
view->setColumnHidden( i, !view->isColumnHidden( i ) );
}
/* Search in the playlist */
......
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