1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-12 09:04:33 +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)
{
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 ) )
filePaths.erase( it );
it = filePaths.erase( it );
else
++it;
}
return !filePaths.isEmpty();
}

View File

@@ -669,7 +669,7 @@ AudioEngine::performLoadIODevice( const result_ptr& result, const QString& url )
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() )
{

View File

@@ -186,7 +186,7 @@ private slots:
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 loadNextTrack();