Commit 4f0f2c2c authored by Ilkka Ollakka's avatar Ilkka Ollakka Committed by Jean-Baptiste Kempf

Qt4: items showflags, parentItem can be NULL

Qt4: playlist Item MUST inherit from their parent the show flags on update.

(cherry picked from commit ad87b924)
(cherry picked from commit 3519bb1d)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 5b4e766a
...@@ -64,6 +64,7 @@ void PLItem::init( int _i_id, int _i_input_id, PLItem *parent, PLModel *m, QSett ...@@ -64,6 +64,7 @@ void PLItem::init( int _i_id, int _i_input_id, PLItem *parent, PLModel *m, QSett
{ {
if( model->i_depth == DEPTH_SEL ) /* Selector Panel */ if( model->i_depth == DEPTH_SEL ) /* Selector Panel */
{ {
i_showflags = 0;
item_col_strings.append( "" ); item_col_strings.append( "" );
} }
else else
...@@ -185,10 +186,10 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent ) ...@@ -185,10 +186,10 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent )
return; return;
} }
assert( parentItem->i_showflags < COLUMN_END ); i_showflags = parentItem ? parentItem->i_showflags : i_showflags;
/* Meta: ID */ /* Meta: ID */
if( parentItem->i_showflags & COLUMN_NUMBER ) if( i_showflags & COLUMN_NUMBER )
{ {
QModelIndex idx = model->index( this, 0 ); QModelIndex idx = model->index( this, 0 );
item_col_strings.append( QString::number( idx.row() + 1 ) ); item_col_strings.append( QString::number( idx.row() + 1 ) );
...@@ -196,7 +197,7 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent ) ...@@ -196,7 +197,7 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent )
/* Other meta informations */ /* Other meta informations */
for( uint32_t i_index=2; i_index < COLUMN_END; i_index <<= 1 ) for( uint32_t i_index=2; i_index < COLUMN_END; i_index <<= 1 )
{ {
if( parentItem->i_showflags & i_index ) if( i_showflags & i_index )
{ {
char *psz = psz_column_meta( p_item->p_input, i_index ); char *psz = psz_column_meta( p_item->p_input, i_index );
item_col_strings.append( qfu( psz ) ); item_col_strings.append( qfu( psz ) );
...@@ -204,3 +205,4 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent ) ...@@ -204,3 +205,4 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent )
} }
} }
} }
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