mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 22:56:42 +02:00
Make liblastfm an optional dependency again
This commit is contained in:
@@ -20,7 +20,7 @@ INCLUDE( MacroLogFeature )
|
||||
|
||||
# required
|
||||
macro_optional_find_package(LibLastFm 0.3.3)
|
||||
macro_log_feature(LIBLASTFM_FOUND "LastFm" "Qt library for the Last.fm webservices" "https://github.com/mxcl/liblastfm" TRUE "" "liblastfm is needed for scrobbling tracks to Last.fm and fetching cover artwork")
|
||||
macro_log_feature(LIBLASTFM_FOUND "LastFm" "Qt library for the Last.fm webservices" "https://github.com/mxcl/liblastfm" FALSE "" "liblastfm is needed for scrobbling tracks to Last.fm and fetching cover artwork")
|
||||
|
||||
macro_optional_find_package(LibEchonest 1.1.1)
|
||||
macro_log_feature(LIBECHONEST_FOUND "Echonest" "Qt library for communicating with The Echo Nest" "http://projects.kde.org/libechonest" TRUE "" "libechonest is needed for dynamic playlists and the infosystem")
|
||||
|
@@ -36,7 +36,7 @@ namespace Tomahawk
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef NO_LIBLASTFM
|
||||
#ifdef LIBLASTFM_FOUND
|
||||
#include <lastfm/NetworkAccessManager>
|
||||
#include "scrobbler.h"
|
||||
#endif
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
|
||||
void addScriptResolver( const QString& scriptPath );
|
||||
void removeScriptResolver( const QString& scriptPath );
|
||||
|
||||
|
||||
// PlatformInterface
|
||||
virtual void activate();
|
||||
virtual bool loadUrl( const QString& url );
|
||||
@@ -91,7 +91,7 @@ private:
|
||||
QList<Tomahawk::collection_ptr> m_collections;
|
||||
QList<TomahawkPlugin*> m_plugins;
|
||||
QList<ScriptResolver*> m_scriptResolvers;
|
||||
|
||||
|
||||
Database* m_database;
|
||||
AudioEngine* m_audioEngine;
|
||||
SipHandler* m_sipHandler;
|
||||
@@ -99,7 +99,7 @@ private:
|
||||
XMPPBot* m_xmppBot;
|
||||
Tomahawk::ShortcutHandler* m_shortcutHandler;
|
||||
|
||||
#ifndef NO_LIBLASTFM
|
||||
#ifdef LIBLASTFM_FOUND
|
||||
Scrobbler* m_scrobbler;
|
||||
#endif
|
||||
|
||||
|
@@ -37,7 +37,6 @@ SET( tomahawkSources ${tomahawkSources}
|
||||
|
||||
musicscanner.cpp
|
||||
scriptresolver.cpp
|
||||
scrobbler.cpp
|
||||
shortcuthandler.cpp
|
||||
|
||||
scanmanager.cpp
|
||||
@@ -45,6 +44,12 @@ SET( tomahawkSources ${tomahawkSources}
|
||||
main.cpp
|
||||
)
|
||||
|
||||
IF(LIBLASTFM_FOUND)
|
||||
SET(tomahawkSources ${tomahawkSources}
|
||||
scrobbler.cpp
|
||||
)
|
||||
ENDIF(LIBLASTFM_FOUND)
|
||||
|
||||
SET( tomahawkSourcesGui ${tomahawkSourcesGui}
|
||||
sourcetree/sourcesmodel.cpp
|
||||
sourcetree/sourcetreeitem.cpp
|
||||
@@ -78,11 +83,16 @@ SET( tomahawkHeaders ${tomahawkHeaders}
|
||||
|
||||
musicscanner.h
|
||||
scriptresolver.h
|
||||
scrobbler.h
|
||||
scanmanager.h
|
||||
shortcuthandler.h
|
||||
)
|
||||
|
||||
IF(LIBLASTFM_FOUND)
|
||||
SET(tomahawkHeaders ${tomahawkHeaders}
|
||||
scrobbler.h
|
||||
)
|
||||
ENDIF(LIBLASTFM_FOUND)
|
||||
|
||||
|
||||
SET( tomahawkHeadersGui ${tomahawkHeadersGui}
|
||||
sourcetree/sourcesmodel.h
|
||||
@@ -178,13 +188,22 @@ ENDIF( WIN32 )
|
||||
|
||||
MESSAGE( STATUS "OS_SPECIFIC_LINK_LIBRARIES: ${OS_SPECIFIC_LINK_LIBRARIES}" )
|
||||
|
||||
SET(LINK_LIBRARIES "")
|
||||
IF(LIBLASTFM_FOUND)
|
||||
SET(LINK_LIBRARIES
|
||||
${LINK_LIBRARIES}
|
||||
${LIBLASTFM_LIBRARY}
|
||||
)
|
||||
ENDIF(LIBLASTFM_FOUND)
|
||||
|
||||
|
||||
TARGET_LINK_LIBRARIES( tomahawk
|
||||
${LINK_LIBRARIES}
|
||||
${TOMAHAWK_LIBRARIES}
|
||||
${QT_LIBRARIES}
|
||||
${MAC_EXTRA_LIBS}
|
||||
${OS_SPECIFIC_LINK_LIBRARIES}
|
||||
${LIBECHONEST_LIBRARY}
|
||||
${LIBLASTFM_LIBRARY}
|
||||
${QXTWEB_LIBRARIES}
|
||||
${QTWEETLIB_LIBRARIES}
|
||||
${QJSON_LIBRARIES}
|
||||
|
@@ -5,7 +5,7 @@
|
||||
#include <QMessageBox>
|
||||
#include <QNetworkProxy>
|
||||
|
||||
#ifndef NO_LIBLASTFM
|
||||
#ifdef LIBLASTFM_FOUND
|
||||
#include <lastfm/ws.h>
|
||||
#include <lastfm/XmlQuery>
|
||||
#endif
|
||||
@@ -196,7 +196,7 @@ SettingsDialog::toggleUpnp( bool preferStaticEnabled )
|
||||
void
|
||||
SettingsDialog::testLastFmLogin()
|
||||
{
|
||||
#ifndef NO_LIBLASTFM
|
||||
#ifdef LIBLASTFM_FOUND
|
||||
ui->pushButtonTestLastfmLogin->setEnabled( false );
|
||||
ui->pushButtonTestLastfmLogin->setText( "Testing..." );
|
||||
|
||||
@@ -217,7 +217,7 @@ SettingsDialog::testLastFmLogin()
|
||||
void
|
||||
SettingsDialog::onLastFmFinished()
|
||||
{
|
||||
#ifndef NO_LIBLASTFM
|
||||
#ifdef LIBLASTFM_FOUND
|
||||
lastfm::XmlQuery lfm = lastfm::XmlQuery( m_testLastFmQuery->readAll() );
|
||||
|
||||
switch( m_testLastFmQuery->error() )
|
||||
|
@@ -7,6 +7,7 @@
|
||||
#include <QNetworkReply>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QNetworkProxy>
|
||||
|
||||
#include "artist.h"
|
||||
#include "album.h"
|
||||
@@ -189,7 +190,7 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
|
||||
connect( m_shortcutHandler, SIGNAL( mute() ), m_audioEngine, SLOT( mute() ) );
|
||||
}
|
||||
|
||||
#ifndef NO_LIBLASTFM
|
||||
#ifdef LIBLASTFM_FOUND
|
||||
qDebug() << "Init Scrobbler.";
|
||||
m_scrobbler = new Scrobbler( this );
|
||||
qDebug() << "Setting NAM.";
|
||||
|
Reference in New Issue
Block a user