QByteArray encodedData;
QDataStream stream( &encodedData, QIODevice::WriteOnly );
- foreach( QModelIndex index, indexes ) {
+ foreach( const QModelIndex &index, indexes ) {
if( index.isValid() && index.column() == 0 )
stream << itemId( index );
}
if( !item )
continue;
- input_item_t *p_item = input_item_GetById( p_playlist,
- item->i_input_id );
+ input_item_t *p_item = NULL;
if( !p_item )
continue;
void PLModel::rebuild( playlist_item_t *p_root )
{
+ playlist_item_t* p_item;
/* Remove callbacks before locking to avoid deadlocks */
delCallbacks();
/* Invalidate cache */
assert( rootItem );
/* Recreate from root */
UpdateNodeChildren( rootItem );
- if( p_playlist->status.p_item )
+ if( (p_item = playlist_CurrentPlayingItem(p_playlist)) )
{
PLItem *currentItem = FindByInput( rootItem,
- p_playlist->status.p_item->p_input->i_id );
+ p_item->p_input->i_id );
if( currentItem )
{
- UpdateTreeItem( p_playlist->status.p_item, currentItem,
+ UpdateTreeItem( p_item, currentItem,
true, false );
}
}
if( !force && i_depth == DEPTH_SEL && p_item->p_parent &&
p_item->p_parent->i_id != rootItem->i_id )
return;
- item->update( p_item, p_item == p_playlist->status.p_item );
+ item->update( p_item, p_item == playlist_CurrentPlayingItem( p_playlist ) );
if( signal )
emit dataChanged( index( item, 0 ) , index( item, 1 ) );
}
int i_index = -1;
int i_flag = 0;
- // FIXME: Disable sorting on startup by ignoring
- // first call of sorting caused by showing dialog
- // see: standardpanel.cpp:65
- static bool b_first_time = true;
- if( b_first_time )
- {
- b_first_time = false;
- return;
- }
-
int i_column = 1;
for( i_column = 1; i_column != COLUMN_END; i_column<<=1 )
{
i_column_sorting( i_flag ),
order == Qt::AscendingOrder ?
ORDER_NORMAL : ORDER_REVERSE );
- p_playlist->b_reset_currently_playing = true;
}
}
PL_UNLOCK;
PL_UNLOCK;
current_selection = list;
QMenu *menu = new QMenu;
- menu->addAction( qfu(I_POP_PLAY), this, SLOT( popupPlay() ) );
- menu->addAction( qfu(I_POP_DEL), this, SLOT( popupDel() ) );
+ menu->addAction( qtr(I_POP_PLAY), this, SLOT( popupPlay() ) );
+ menu->addAction( qtr(I_POP_DEL), this, SLOT( popupDel() ) );
menu->addSeparator();
- menu->addAction( qfu(I_POP_STREAM), this, SLOT( popupStream() ) );
- menu->addAction( qfu(I_POP_SAVE), this, SLOT( popupSave() ) );
+ menu->addAction( qtr(I_POP_STREAM), this, SLOT( popupStream() ) );
+ menu->addAction( qtr(I_POP_SAVE), this, SLOT( popupSave() ) );
menu->addSeparator();
- menu->addAction( qfu(I_POP_INFO), this, SLOT( popupInfo() ) );
+ menu->addAction( qtr(I_POP_INFO), this, SLOT( popupInfo() ) );
if( p_item->i_children > -1 )
{
menu->addSeparator();
- menu->addAction( qfu(I_POP_SORT), this, SLOT( popupSort() ) );
- menu->addAction( qfu(I_POP_ADD), this, SLOT( popupAdd() ) );
+ menu->addAction( qtr(I_POP_SORT), this, SLOT( popupSort() ) );
+ menu->addAction( qtr(I_POP_ADD), this, SLOT( popupAdd() ) );
}
menu->addSeparator();
- menu->addAction( qfu( I_POP_EXPLORE ), this, SLOT( popupExplore() ) );
+ menu->addAction( qtr( I_POP_EXPLORE ), this, SLOT( popupExplore() ) );
menu->popup( point );
}
else
{
beginRemoveColumns( parent, index, index+1 );
rootItem->i_showflags &= ~( meta );
+ getSettings()->setValue( "qt-pl-showflags", rootItem->i_showflags );
rootItem->updateColumnHeaders();
endRemoveColumns();
}
/* Adding columns */
beginInsertColumns( parent, index, index+1 );
rootItem->i_showflags |= meta;
+ getSettings()->setValue( "qt-pl-showflags", rootItem->i_showflags );
rootItem->updateColumnHeaders();
endInsertColumns();
}
{
PLModel *p_model = (PLModel *) param;
PLEvent *event = new PLEvent( PLUpdate_Type, 0 );
- QApplication::postEvent( p_model, static_cast<QEvent*>(event) );
+ QApplication::postEvent( p_model, event );
return VLC_SUCCESS;
}
{
PLModel *p_model = (PLModel *) param;
PLEvent *event = new PLEvent( ItemUpdate_Type, oval.i_int );
- QApplication::postEvent( p_model, static_cast<QEvent*>(event) );
+ QApplication::postEvent( p_model, event );
event = new PLEvent( ItemUpdate_Type, nval.i_int );
- QApplication::postEvent( p_model, static_cast<QEvent*>(event) );
+ QApplication::postEvent( p_model, event );
return VLC_SUCCESS;
}
{
PLModel *p_model = (PLModel *) param;
PLEvent *event = new PLEvent( ItemUpdate_Type, nval.i_int );
- QApplication::postEvent( p_model, static_cast<QEvent*>(event) );
+ QApplication::postEvent( p_model, event );
return VLC_SUCCESS;
}
{
PLModel *p_model = (PLModel *) param;
PLEvent *event = new PLEvent( ItemDelete_Type, nval.i_int );
- QApplication::postEvent( p_model, static_cast<QEvent*>(event) );
+ QApplication::postEvent( p_model, event );
return VLC_SUCCESS;
}
playlist_add_t *p_add = (playlist_add_t *)malloc( sizeof( playlist_add_t));
memcpy( p_add, nval.p_address, sizeof( playlist_add_t ) );
- PLEvent *event = new PLEvent( p_add );
- QApplication::postEvent( p_model, static_cast<QEvent*>(event) );
+ PLEvent *event = new PLEvent( p_add );
+ QApplication::postEvent( p_model, event );
return VLC_SUCCESS;
}