Commit d5d50e2f authored by Ilkka Ollakka's avatar Ilkka Ollakka

qt4: no need to store input-type, as we can get it from p_input in playlist_model

parent a45d4754
...@@ -53,7 +53,6 @@ void PLItem::init( playlist_item_t *_playlist_item, PLItem *parent, PLModel *m, ...@@ -53,7 +53,6 @@ void PLItem::init( playlist_item_t *_playlist_item, PLItem *parent, PLModel *m,
parentItem = parent; /* Can be NULL, but only for the rootItem */ parentItem = parent; /* Can be NULL, but only for the rootItem */
i_id = _playlist_item->i_id; /* Playlist item specific id */ i_id = _playlist_item->i_id; /* Playlist item specific id */
model = m; /* PLModel (QAbsmodel) */ model = m; /* PLModel (QAbsmodel) */
i_type = -1; /* Item type - Avoid segfault */
p_input = _playlist_item->p_input; p_input = _playlist_item->p_input;
vlc_gc_incref( p_input ); vlc_gc_incref( p_input );
...@@ -119,8 +118,5 @@ void PLItem::update( playlist_item_t *p_item ) ...@@ -119,8 +118,5 @@ void PLItem::update( playlist_item_t *p_item )
{ {
assert( p_item->p_input == p_input); assert( p_item->p_input == p_input);
/* Useful for the model */
i_type = p_item->p_input->i_type;
} }
...@@ -63,7 +63,6 @@ public: ...@@ -63,7 +63,6 @@ public:
protected: protected:
QList<PLItem*> children; QList<PLItem*> children;
int i_type;
int i_id; int i_id;
input_item_t *p_input; input_item_t *p_input;
......
...@@ -390,8 +390,8 @@ QVariant PLModel::data( const QModelIndex &index, int role ) const ...@@ -390,8 +390,8 @@ QVariant PLModel::data( const QModelIndex &index, int role ) const
else if( role == Qt::DecorationRole && index.column() == 0 ) else if( role == Qt::DecorationRole && index.column() == 0 )
{ {
/* Use to segfault here because i_type wasn't always initialized */ /* Use to segfault here because i_type wasn't always initialized */
if( item->i_type >= 0 ) if( item->p_input->i_type >= 0 )
return QVariant( PLModel::icons[item->i_type] ); return QVariant( PLModel::icons[item->p_input->i_type] );
} }
else if( role == Qt::FontRole ) else if( role == Qt::FontRole )
{ {
......
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