mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-18 11:51:44 +02:00
DropJob: don't touch iterator after erasing element
Also drops a redundant condition
This commit is contained in:
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -977,7 +982,7 @@ DropJob::removeRemoteSources()
|
|||||||
foreach ( const Tomahawk::result_ptr& result, item->results() )
|
foreach ( const Tomahawk::result_ptr& result, item->results() )
|
||||||
{
|
{
|
||||||
if ( !result->collection().isNull() && !result->collection()->source().isNull() &&
|
if ( !result->collection().isNull() && !result->collection()->source().isNull() &&
|
||||||
!result->collection()->source().isNull() && result->collection()->source()->isLocal() )
|
result->collection()->source()->isLocal() )
|
||||||
hasLocalSource = true;
|
hasLocalSource = true;
|
||||||
}
|
}
|
||||||
if ( hasLocalSource )
|
if ( hasLocalSource )
|
||||||
|
Reference in New Issue
Block a user