*/
-void PLItem::init( int _i_id, int _i_input_id, PLItem *parent, PLModel *m )
+void PLItem::init( int _i_id, int _i_input_id, PLItem *parent, PLModel *m, QSettings *settings )
{
parentItem = parent; /* Can be NULL, but only for the rootItem */
i_id = _i_id; /* Playlist item specific id */
{
if( model->i_depth == DEPTH_SEL ) /* Selector Panel */
{
+ i_showflags = 0;
item_col_strings.append( "" );
}
else
{
- QSettings settings( "vlc", "vlc-qt-interface" );
- i_showflags = settings.value( "qt-pl-showflags", 39 ).toInt();
+ i_showflags = settings->value( "qt-pl-showflags", COLUMN_DEFAULT ).toInt();
if( i_showflags < 1)
- i_showflags = 39; /* reasonable default to show something; */
+ i_showflags = COLUMN_DEFAULT; /* reasonable default to show something; */
else if ( i_showflags >= COLUMN_END )
i_showflags = COLUMN_END - 1; /* show everything */
*/
PLItem::PLItem( int _i_id, int _i_input_id, PLItem *parent, PLModel *m )
{
- init( _i_id, _i_input_id, parent, m );
+ init( _i_id, _i_input_id, parent, m, NULL );
}
PLItem::PLItem( playlist_item_t * p_item, PLItem *parent, PLModel *m )
{
- init( p_item->i_id, p_item->p_input->i_id, parent, m );
+ init( p_item->i_id, p_item->p_input->i_id, parent, m, NULL );
+}
+
+PLItem::PLItem( playlist_item_t * p_item, QSettings *settings, PLModel *m )
+{
+ init( p_item->i_id, p_item->p_input->i_id, NULL, m, settings );
}
PLItem::~PLItem()
*/
void PLItem::update( playlist_item_t *p_item, bool iscurrent )
{
- char psz_duration[MSTRTIME_MAX_SIZE];
- char *psz_meta;
-
assert( p_item->p_input->i_id == i_input_id );
/* Useful for the model */
return;
}
- assert( parentItem->i_showflags < COLUMN_END );
+ i_showflags = parentItem ? parentItem->i_showflags : i_showflags;
- for( uint32_t i_index=1; i_index < COLUMN_END; i_index <<= 1 )
+ /* Meta: ID */
+ if( i_showflags & COLUMN_NUMBER )
{
- if( parentItem->i_showflags & i_index )
+ QModelIndex idx = model->index( this, 0 );
+ item_col_strings.append( QString::number( idx.row() + 1 ) );
+ }
+ /* Other meta informations */
+ for( uint32_t i_index=2; i_index < COLUMN_END; i_index <<= 1 )
+ {
+ if( i_showflags & i_index )
{
char *psz = psz_column_meta( p_item->p_input, i_index );
item_col_strings.append( qfu( psz ) );
}
}
}
+