Skip to content

Commit 01d6a22

Browse files
committed
Merge pull request tomahawk-player#69 from Horrendus/master
fix grooveshark stuff by putting ifdefs around it
2 parents 3875f0b + b3c144b commit 01d6a22

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

src/libtomahawk/CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ set( libGuiSources
101101
utils/m3uloader.cpp
102102
utils/itunesparser.cpp
103103
utils/rdioparser.cpp
104-
utils/groovesharkparser.cpp
105104
utils/shortenedlinkparser.cpp
106105
utils/stylehelper.cpp
107106
utils/dropjobnotifier.cpp
@@ -136,6 +135,10 @@ set( libGuiSources
136135
widgets/BreadcrumbButton.cpp
137136
)
138137

138+
IF(QCA2_FOUND)
139+
set( libGuiSources ${libGuiSources} utils/groovesharkparser.cpp )
140+
ENDIF(QCA2_FOUND)
141+
139142
set( libGuiHeaders
140143
actioncollection.h
141144

@@ -220,7 +223,6 @@ set( libGuiHeaders
220223
utils/m3uloader.h
221224
utils/itunesparser.h
222225
utils/rdioparser.h
223-
utils/groovesharkparser.h
224226
utils/shortenedlinkparser.h
225227
utils/dropjobnotifier.h
226228
utils/tomahawkutilsgui.h
@@ -264,9 +266,12 @@ set( libGuiHeaders
264266
jobview/LatchedStatusItem.h
265267

266268
thirdparty/Qocoa/qsearchfield.h
267-
268269
)
269270

271+
IF(QCA2_FOUND)
272+
set( libGuiHeaders ${libGuiHeaders} utils/groovesharkparser.h )
273+
ENDIF(QCA2_FOUND)
274+
270275
set( libSources
271276
tomahawksettings.cpp
272277
sourcelist.cpp

src/libtomahawk/dropjob.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include "utils/spotifyparser.h"
2727
#include "utils/itunesparser.h"
2828
#include "utils/rdioparser.h"
29-
#include "utils/groovesharkparser.h"
3029
#include "utils/m3uloader.h"
3130
#include "utils/shortenedlinkparser.h"
3231
#include "utils/logger.h"
@@ -36,6 +35,10 @@
3635
#include "utils/xspfloader.h"
3736
#include "jobview/JobStatusView.h"
3837
#include "jobview/JobStatusModel.h"
38+
#ifdef QCA2_FOUND
39+
#include "utils/groovesharkparser.h"
40+
#endif //QCA2_FOUND
41+
3942

4043
using namespace Tomahawk;
4144

@@ -192,10 +195,10 @@ DropJob::isDropType( DropJob::DropType desired, const QMimeData* data )
192195

193196
if ( url.contains( "rdio.com" ) && url.contains( "people" ) && url.contains( "playlist" ) )
194197
return true;
195-
198+
#ifdef QCA2_FOUND
196199
if ( url.contains( "grooveshark.com" ) && url.contains( "playlist" ) )
197200
return true;
198-
201+
#endif //QCA2_FOUND
199202
if ( ShortenedLinkParser::handlesUrl( url ) )
200203
return true;
201204
}
@@ -565,6 +568,7 @@ DropJob::handleRdioUrls( const QString& urlsRaw )
565568
void
566569
DropJob::handleGroovesharkUrls ( const QString& urlsRaw )
567570
{
571+
#ifdef QCA2_FOUND
568572
QStringList urls = urlsRaw.split( QRegExp( "\\s+" ), QString::SkipEmptyParts );
569573
tDebug() << "Got Grooveshark urls!" << urls;
570574

@@ -580,6 +584,9 @@ DropJob::handleGroovesharkUrls ( const QString& urlsRaw )
580584
connect( groove, SIGNAL( tracks( QList<Tomahawk::query_ptr> ) ), this, SLOT( onTracksAdded( QList< Tomahawk::query_ptr > ) ) );
581585
m_queryCount++;
582586
}
587+
#else
588+
tLog() << "Tomahawk compiled without QCA support, cannot use groovesharkparser";
589+
#endif
583590
}
584591

585592

@@ -597,8 +604,10 @@ DropJob::handleAllUrls( const QString& urls )
597604
handleSpotifyUrls( urls );
598605
else if ( urls.contains( "rdio.com" ) )
599606
handleRdioUrls( urls );
607+
#ifdef QCA2_FOUND
600608
else if ( urls.contains( "grooveshark.com" ) )
601609
handleGroovesharkUrls( urls );
610+
#endif
602611
else
603612
handleTrackUrls ( urls );
604613
}

0 commit comments

Comments
 (0)