1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-13 17:43:59 +02:00

Merge pull request #429 from midzer/patch1

erasing in an iteration and pass by reference
This commit is contained in:
Dominik Schmidt
2016-02-10 12:11:23 +01:00
3 changed files with 9 additions and 4 deletions

View File

@@ -263,9 +263,14 @@ bool
DropJob::validateLocalFiles(const QString &paths, const QString &suffix) DropJob::validateLocalFiles(const QString &paths, const QString &suffix)
{ {
QStringList filePaths = paths.split( QRegExp( "\\s+" ), QString::SkipEmptyParts ); QStringList filePaths = paths.split( QRegExp( "\\s+" ), QString::SkipEmptyParts );
for ( QStringList::iterator it = filePaths.begin(); it != filePaths.end(); ++it ) QStringList::iterator it = filePaths.begin();
while ( it != filePaths.end() )
{
if ( !validateLocalFile( *it, suffix ) ) if ( !validateLocalFile( *it, suffix ) )
filePaths.erase( it ); it = filePaths.erase( it );
else
++it;
}
return !filePaths.isEmpty(); return !filePaths.isEmpty();
} }

View File

@@ -669,7 +669,7 @@ AudioEngine::performLoadIODevice( const result_ptr& result, const QString& url )
void void
AudioEngine::performLoadTrack( const Tomahawk::result_ptr result, const QString url, QSharedPointer< QIODevice > io ) AudioEngine::performLoadTrack( const Tomahawk::result_ptr result, const QString& url, QSharedPointer< QIODevice > io )
{ {
if ( QThread::currentThread() != thread() ) if ( QThread::currentThread() != thread() )
{ {

View File

@@ -186,7 +186,7 @@ private slots:
void performLoadIODevice( const Tomahawk::result_ptr& result, const QString& url ); //only call from loadTrack kthxbi void performLoadIODevice( const Tomahawk::result_ptr& result, const QString& url ); //only call from loadTrack kthxbi
void performLoadTrack( const Tomahawk::result_ptr result, const QString url, QSharedPointer< QIODevice > io ); //only call from loadTrack or performLoadIODevice kthxbi void performLoadTrack( const Tomahawk::result_ptr result, const QString& url, QSharedPointer< QIODevice > io ); //only call from loadTrack or performLoadIODevice kthxbi
void loadPreviousTrack(); void loadPreviousTrack();
void loadNextTrack(); void loadNextTrack();