Commit 034e5706 authored by Rémi Duraffort's avatar Rémi Duraffort

qt4: follow the recommendations about foreach loops.

parent 3396d9f3
......@@ -161,7 +161,7 @@ void FileOpenPanel::browseFileSub()
void FileOpenPanel::updateMRL()
{
QString mrl = "";
foreach( QString file, dialogBox->selectedFiles() ) {
foreach( const QString &file, dialogBox->selectedFiles() ) {
mrl += "\"" + file + "\" ";
}
......
......@@ -133,7 +133,7 @@ QMimeData *PLModel::mimeData( const QModelIndexList &indexes ) const
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 );
}
......
......@@ -65,7 +65,7 @@ PlaylistDialog::~PlaylistDialog()
void PlaylistDialog::dropEvent( QDropEvent *event )
{
const QMimeData *mimeData = event->mimeData();
foreach( QUrl url, mimeData->urls() ) {
foreach( const QUrl &url, mimeData->urls() ) {
QString s = toNativeSeparators( url.toString() );
if( s.length() > 0 ) {
playlist_Add( THEPL, qtu(s), NULL,
......
......@@ -291,7 +291,7 @@ void DialogsProvider::openFileGenericDialog( intf_dialog_args_t *p_arg )
p_arg->i_results = files.count();
p_arg->psz_results = (char **)malloc( p_arg->i_results * sizeof( char * ) );
i = 0;
foreach( QString file, files )
foreach( const QString &file, files )
p_arg->psz_results[i++] = strdup( qtu( toNativeSepNoSlash( file ) ) );
}
......@@ -395,7 +395,7 @@ void DialogsProvider::addFromSimple( bool pl, bool go)
{
QStringList files = DialogsProvider::showSimpleOpen();
int i = 0;
foreach( QString file, files )
foreach( const QString &file, files )
{
playlist_Add( THEPL, qtu( toNativeSeparators( file ) ), NULL,
go ? ( PLAYLIST_APPEND | ( i ? 0 : PLAYLIST_GO ) |
......@@ -498,7 +498,7 @@ void DialogsProvider::openAPlaylist()
{
QStringList files = showSimpleOpen( qtr( "Open playlist..." ),
EXT_FILTER_PLAYLIST );
foreach( QString file, files )
foreach( const QString &file, files )
{
playlist_Import( THEPL, qtu( toNativeSeparators( file ) ) );
}
......@@ -612,8 +612,7 @@ void DialogsProvider::loadSubtitlesFile()
EXT_FILTER_SUBTITLE,
path );
free( path );
QString qsFile;
foreach( qsFile, qsl )
foreach( const QString &qsFile, qsl )
{
if( input_AddSubtitle( p_input, qtu( toNativeSeparators( qsFile ) ),
true ) )
......
......@@ -995,7 +995,7 @@ void MainInterface::dropEventPlay( QDropEvent *event, bool b_play )
}
}
bool first = b_play;
foreach( QUrl url, mimeData->urls() )
foreach( const QUrl &url, mimeData->urls() )
{
QString s = toNativeSeparators( url.toLocalFile() );
......
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