26
26
#include " utils/spotifyparser.h"
27
27
#include " utils/itunesparser.h"
28
28
#include " utils/rdioparser.h"
29
- #include " utils/groovesharkparser.h"
30
29
#include " utils/m3uloader.h"
31
30
#include " utils/shortenedlinkparser.h"
32
31
#include " utils/logger.h"
36
35
#include " utils/xspfloader.h"
37
36
#include " jobview/JobStatusView.h"
38
37
#include " jobview/JobStatusModel.h"
38
+ #ifdef QCA2_FOUND
39
+ #include " utils/groovesharkparser.h"
40
+ #endif // QCA2_FOUND
41
+
39
42
40
43
using namespace Tomahawk ;
41
44
@@ -192,10 +195,10 @@ DropJob::isDropType( DropJob::DropType desired, const QMimeData* data )
192
195
193
196
if ( url.contains ( " rdio.com" ) && url.contains ( " people" ) && url.contains ( " playlist" ) )
194
197
return true ;
195
-
198
+ # ifdef QCA2_FOUND
196
199
if ( url.contains ( " grooveshark.com" ) && url.contains ( " playlist" ) )
197
200
return true ;
198
-
201
+ # endif // QCA2_FOUND
199
202
if ( ShortenedLinkParser::handlesUrl ( url ) )
200
203
return true ;
201
204
}
@@ -565,6 +568,7 @@ DropJob::handleRdioUrls( const QString& urlsRaw )
565
568
void
566
569
DropJob::handleGroovesharkUrls ( const QString& urlsRaw )
567
570
{
571
+ #ifdef QCA2_FOUND
568
572
QStringList urls = urlsRaw.split ( QRegExp ( " \\ s+" ), QString::SkipEmptyParts );
569
573
tDebug () << " Got Grooveshark urls!" << urls;
570
574
@@ -580,6 +584,9 @@ DropJob::handleGroovesharkUrls ( const QString& urlsRaw )
580
584
connect ( groove, SIGNAL ( tracks ( QList<Tomahawk::query_ptr> ) ), this , SLOT ( onTracksAdded ( QList< Tomahawk::query_ptr > ) ) );
581
585
m_queryCount++;
582
586
}
587
+ #else
588
+ tLog () << " Tomahawk compiled without QCA support, cannot use groovesharkparser" ;
589
+ #endif
583
590
}
584
591
585
592
@@ -597,8 +604,10 @@ DropJob::handleAllUrls( const QString& urls )
597
604
handleSpotifyUrls ( urls );
598
605
else if ( urls.contains ( " rdio.com" ) )
599
606
handleRdioUrls ( urls );
607
+ #ifdef QCA2_FOUND
600
608
else if ( urls.contains ( " grooveshark.com" ) )
601
609
handleGroovesharkUrls ( urls );
610
+ #endif
602
611
else
603
612
handleTrackUrls ( urls );
604
613
}
0 commit comments