Commit e2031931 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Fix segfault from previous commit, and read from the config only once and simplify.

parent ef26e8ea
......@@ -56,11 +56,18 @@ void PLItem::init( int _i_id, int _i_input_id, PLItem *parent, PLModel *m )
assert( model ); /* We need a model */
/* No parent, should be the main one */
/* No parent, should be the 2 main ones */
if( parentItem == NULL )
{
i_showflags = model->shownFlags();
updateColumnHeaders();
if( model->i_depth == DEPTH_SEL ) /* Selector Panel */
{
item_col_strings.append( "" );
}
else
{
i_showflags = config_GetInt( model->p_intf, "qt-pl-showflags" );
updateColumnHeaders();
}
}
else
{
......@@ -68,7 +75,6 @@ void PLItem::init( int _i_id, int _i_input_id, PLItem *parent, PLModel *m )
//Add empty string and update() handles data appending
item_col_strings.append( "" );
}
msg_Dbg( model->p_intf, "PLItem created of type: %i", model->i_depth );
}
/*
......@@ -97,12 +103,6 @@ void PLItem::updateColumnHeaders()
{
item_col_strings.clear();
if( model->i_depth == DEPTH_SEL ) /* Selector Panel */
{
item_col_strings.append( "" );
return;
}
for( int i_index=1; i_index <= VLC_META_ENGINE_ART_URL; i_index *= 2 )
{
if( i_showflags & i_index )
......
......@@ -114,7 +114,7 @@ public:
int row, int column, const QModelIndex &target );
QStringList mimeTypes() const;
int shownFlags() { return rootItem->i_showflags; }
int shownFlags() { return rootItem->i_showflags; }
private:
void addCallbacks();
......
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