mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-13 09:34:53 +02:00
Merge pull request #429 from midzer/patch1
erasing in an iteration and pass by reference
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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() )
|
||||||
{
|
{
|
||||||
|
@@ -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();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user