mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-19 15:29:42 +01:00
Merge pull request #69 from Horrendus/master
fix grooveshark stuff by putting ifdefs around it
This commit is contained in:
commit
01d6a22f92
@ -101,7 +101,6 @@ set( libGuiSources
|
||||
utils/m3uloader.cpp
|
||||
utils/itunesparser.cpp
|
||||
utils/rdioparser.cpp
|
||||
utils/groovesharkparser.cpp
|
||||
utils/shortenedlinkparser.cpp
|
||||
utils/stylehelper.cpp
|
||||
utils/dropjobnotifier.cpp
|
||||
@ -136,6 +135,10 @@ set( libGuiSources
|
||||
widgets/BreadcrumbButton.cpp
|
||||
)
|
||||
|
||||
IF(QCA2_FOUND)
|
||||
set( libGuiSources ${libGuiSources} utils/groovesharkparser.cpp )
|
||||
ENDIF(QCA2_FOUND)
|
||||
|
||||
set( libGuiHeaders
|
||||
actioncollection.h
|
||||
|
||||
@ -220,7 +223,6 @@ set( libGuiHeaders
|
||||
utils/m3uloader.h
|
||||
utils/itunesparser.h
|
||||
utils/rdioparser.h
|
||||
utils/groovesharkparser.h
|
||||
utils/shortenedlinkparser.h
|
||||
utils/dropjobnotifier.h
|
||||
utils/tomahawkutilsgui.h
|
||||
@ -264,9 +266,12 @@ set( libGuiHeaders
|
||||
jobview/LatchedStatusItem.h
|
||||
|
||||
thirdparty/Qocoa/qsearchfield.h
|
||||
|
||||
)
|
||||
|
||||
IF(QCA2_FOUND)
|
||||
set( libGuiHeaders ${libGuiHeaders} utils/groovesharkparser.h )
|
||||
ENDIF(QCA2_FOUND)
|
||||
|
||||
set( libSources
|
||||
tomahawksettings.cpp
|
||||
sourcelist.cpp
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "utils/spotifyparser.h"
|
||||
#include "utils/itunesparser.h"
|
||||
#include "utils/rdioparser.h"
|
||||
#include "utils/groovesharkparser.h"
|
||||
#include "utils/m3uloader.h"
|
||||
#include "utils/shortenedlinkparser.h"
|
||||
#include "utils/logger.h"
|
||||
@ -36,6 +35,10 @@
|
||||
#include "utils/xspfloader.h"
|
||||
#include "jobview/JobStatusView.h"
|
||||
#include "jobview/JobStatusModel.h"
|
||||
#ifdef QCA2_FOUND
|
||||
#include "utils/groovesharkparser.h"
|
||||
#endif //QCA2_FOUND
|
||||
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
@ -192,10 +195,10 @@ DropJob::isDropType( DropJob::DropType desired, const QMimeData* data )
|
||||
|
||||
if ( url.contains( "rdio.com" ) && url.contains( "people" ) && url.contains( "playlist" ) )
|
||||
return true;
|
||||
|
||||
#ifdef QCA2_FOUND
|
||||
if ( url.contains( "grooveshark.com" ) && url.contains( "playlist" ) )
|
||||
return true;
|
||||
|
||||
#endif //QCA2_FOUND
|
||||
if ( ShortenedLinkParser::handlesUrl( url ) )
|
||||
return true;
|
||||
}
|
||||
@ -565,6 +568,7 @@ DropJob::handleRdioUrls( const QString& urlsRaw )
|
||||
void
|
||||
DropJob::handleGroovesharkUrls ( const QString& urlsRaw )
|
||||
{
|
||||
#ifdef QCA2_FOUND
|
||||
QStringList urls = urlsRaw.split( QRegExp( "\\s+" ), QString::SkipEmptyParts );
|
||||
tDebug() << "Got Grooveshark urls!" << urls;
|
||||
|
||||
@ -580,6 +584,9 @@ DropJob::handleGroovesharkUrls ( const QString& urlsRaw )
|
||||
connect( groove, SIGNAL( tracks( QList<Tomahawk::query_ptr> ) ), this, SLOT( onTracksAdded( QList< Tomahawk::query_ptr > ) ) );
|
||||
m_queryCount++;
|
||||
}
|
||||
#else
|
||||
tLog() << "Tomahawk compiled without QCA support, cannot use groovesharkparser";
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -597,8 +604,10 @@ DropJob::handleAllUrls( const QString& urls )
|
||||
handleSpotifyUrls( urls );
|
||||
else if ( urls.contains( "rdio.com" ) )
|
||||
handleRdioUrls( urls );
|
||||
#ifdef QCA2_FOUND
|
||||
else if ( urls.contains( "grooveshark.com" ) )
|
||||
handleGroovesharkUrls( urls );
|
||||
#endif
|
||||
else
|
||||
handleTrackUrls ( urls );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user