1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-19 07:19:42 +01:00

* Coding-style fixes for DropJob.

This commit is contained in:
Christian Muehlhaeuser 2011-11-24 13:57:25 +01:00
parent 5929adfa57
commit f38f6b2eed

View File

@ -239,6 +239,7 @@ void
DropJob::parseMimeData( const QMimeData *data )
{
QList< query_ptr > results;
if ( data->hasFormat( "application/tomahawk.query.list" ) )
results = tracksFromQueryList( data );
else if ( data->hasFormat( "application/tomahawk.result.list" ) )
@ -254,7 +255,8 @@ DropJob::parseMimeData( const QMimeData *data )
const QString plainData = QString::fromUtf8( data->data( "text/plain" ) );
handleAllUrls( plainData );
}else if ( data->hasFormat( "text/uri-list" ) )
}
else if ( data->hasFormat( "text/uri-list" ) )
{
const QString plainData = QString::fromUtf8( data->data( "text/uri-list" ).trimmed() );
handleAllUrls( plainData );
@ -367,6 +369,7 @@ DropJob::tracksFromAlbumMetaData( const QMimeData *data )
else
queries << getAlbum( artist, album );
}
return queries;
}
@ -441,19 +444,20 @@ DropJob::tracksFromMixedData( const QMimeData *data )
singleMimeData.setData( mimeType, singleData );
parseMimeData( &singleMimeData );
}
return queries;
}
void
DropJob::handleM3u( const QString& fileUrls )
{
tDebug() << Q_FUNC_INFO << "Got M3u playlist!!" << fileUrls;
tDebug() << Q_FUNC_INFO << "Got M3U playlist!" << fileUrls;
QStringList urls = fileUrls.split( QRegExp( "\n" ), QString::SkipEmptyParts );
if ( dropAction() == Default )
setDropAction( Create );
tDebug() << "Got a M3U playlist url to parse!" << urls;
M3uLoader* m = new M3uLoader( urls, dropAction() == Create, this );
@ -463,11 +467,11 @@ DropJob::handleM3u( const QString& fileUrls )
connect( m, SIGNAL( tracks( QList<Tomahawk::query_ptr> ) ), this, SLOT( onTracksAdded( QList< Tomahawk::query_ptr > ) ) );
}
m_queryCount++;
}
void
DropJob::handleXspfs( const QString& fileUrls )
{
@ -507,6 +511,7 @@ DropJob::handleXspfs( const QString& fileUrls )
connect( l, SIGNAL( tracks( QList<Tomahawk::query_ptr> ) ), this, SLOT( onTracksAdded( QList< Tomahawk::query_ptr > ) ) );
}
m_queryCount++;
}
}
@ -516,7 +521,7 @@ void
DropJob::handleSpotifyUrls( const QString& urlsRaw )
{
QStringList urls = urlsRaw.split( QRegExp( "\\s+" ), QString::SkipEmptyParts );
qDebug() << "Got spotify browse uris!!" << urls;
qDebug() << "Got spotify browse uris!" << urls;
/// Lets allow parsing all spotify uris here, if parse server is not available
/// fallback to spotify metadata for tracks /hugo
@ -542,7 +547,7 @@ void
DropJob::handleRdioUrls( const QString& urlsRaw )
{
QStringList urls = urlsRaw.split( QRegExp( "\\s+" ), QString::SkipEmptyParts );
qDebug() << "Got Rdio urls!!" << urls;
qDebug() << "Got Rdio urls!" << urls;
if ( dropAction() == Default )
setDropAction( Create );
@ -668,6 +673,7 @@ DropJob::removeDuplicates()
if ( !contains )
list.append( item );
}
m_resultList = list;
}