mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-18 03:41:27 +02:00
Migrate charts plugin
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
ADD_SUBDIRECTORY( echonest )
|
||||
ADD_SUBDIRECTORY( hypem )
|
||||
ADD_SUBDIRECTORY( charts )
|
||||
|
43
src/infoplugins/generic/charts/CMakeLists.txt
Normal file
43
src/infoplugins/generic/charts/CMakeLists.txt
Normal file
@@ -0,0 +1,43 @@
|
||||
project( tomahawk )
|
||||
|
||||
include( ${QT_USE_FILE} )
|
||||
add_definitions( ${QT_DEFINITIONS} )
|
||||
add_definitions( -DQT_PLUGIN )
|
||||
add_definitions( -DQT_SHARED )
|
||||
add_definitions( -DINFOPLUGINDLLEXPORT_PRO )
|
||||
|
||||
set( chartsInfoPluginSources
|
||||
ChartsPlugin.cpp
|
||||
)
|
||||
|
||||
set( chartsInfoPluginHeaders
|
||||
ChartsPlugin.h
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${QT_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
qt4_wrap_cpp( chartsInfoPluginMoc ${chartsInfoPluginHeaders} )
|
||||
add_library( tomahawk_infoplugin_charts SHARED ${chartsInfoPluginSources} ${chartsInfoPluginMoc} ${RC_SRCS} )
|
||||
|
||||
IF( WIN32 )
|
||||
SET( OS_SPECIFIC_LINK_LIBRARIES
|
||||
${OS_SPECIFIC_LINK_LIBRARIES}
|
||||
"winmm.dll"
|
||||
"iphlpapi.a"
|
||||
)
|
||||
ENDIF( WIN32 )
|
||||
|
||||
target_link_libraries( tomahawk_infoplugin_charts
|
||||
${TOMAHAWK_LIBRARIES}
|
||||
${QT_LIBRARIES}
|
||||
${OS_SPECIFIC_LINK_LIBRARIES}
|
||||
)
|
||||
|
||||
IF( APPLE )
|
||||
# SET( CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "-undefined dynamic_lookup" )
|
||||
ENDIF( APPLE )
|
||||
|
||||
install( TARGETS tomahawk_infoplugin_charts DESTINATION ${CMAKE_INSTALL_LIBDIR} )
|
||||
|
@@ -21,13 +21,14 @@
|
||||
|
||||
#include "ChartsPlugin.h"
|
||||
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtNetwork/QNetworkConfiguration>
|
||||
#include <QtNetwork/QNetworkReply>
|
||||
#include <QDir>
|
||||
#include <QSettings>
|
||||
#include <QNetworkConfiguration>
|
||||
#include <QNetworkReply>
|
||||
#include <QtPlugin>
|
||||
|
||||
#include "Album.h"
|
||||
#include "ChartsPlugin_Data_p.h"
|
||||
#include "CountryUtils.h"
|
||||
#include "Typedefs.h"
|
||||
#include "audio/AudioEngine.h"
|
||||
#include "TomahawkSettings.h"
|
||||
@@ -40,8 +41,11 @@
|
||||
#include <qjson/parser.h>
|
||||
#include <qjson/serializer.h>
|
||||
|
||||
using namespace Tomahawk::InfoSystem;
|
||||
namespace Tomahawk
|
||||
{
|
||||
|
||||
namespace InfoSystem
|
||||
{
|
||||
|
||||
ChartsPlugin::ChartsPlugin()
|
||||
: InfoPlugin()
|
||||
@@ -631,3 +635,9 @@ ChartsPlugin::chartReturned()
|
||||
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "Network error in fetching chart:" << reply->url().toString();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Q_EXPORT_PLUGIN2( Tomahawk::InfoSystem::InfoPlugin, Tomahawk::InfoSystem::ChartsPlugin )
|
@@ -20,10 +20,11 @@
|
||||
#ifndef ChartsPlugin_H
|
||||
#define ChartsPlugin_H
|
||||
|
||||
#include "infoplugins/InfoPluginDllMacro.h"
|
||||
#include "infosystem/InfoSystem.h"
|
||||
#include "infosystem/InfoSystemWorker.h"
|
||||
#include <QtNetwork/QNetworkReply>
|
||||
#include <QtCore/QObject>
|
||||
#include <QNetworkReply>
|
||||
#include <QObject>
|
||||
|
||||
class QNetworkReply;
|
||||
|
||||
@@ -33,9 +34,10 @@ namespace Tomahawk
|
||||
namespace InfoSystem
|
||||
{
|
||||
|
||||
class ChartsPlugin : public InfoPlugin
|
||||
class INFOPLUGINDLLEXPORT ChartsPlugin : public InfoPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES( Tomahawk::InfoSystem::InfoPlugin )
|
||||
|
||||
public:
|
||||
ChartsPlugin();
|
@@ -254,7 +254,6 @@ set( libSources
|
||||
infosystem/InfoSystemCache.cpp
|
||||
infosystem/InfoSystemWorker.cpp
|
||||
|
||||
infosystem/infoplugins/generic/ChartsPlugin.cpp
|
||||
infosystem/infoplugins/generic/NewReleasesPlugin.cpp
|
||||
infosystem/infoplugins/generic/spotifyPlugin.cpp
|
||||
infosystem/infoplugins/generic/MusixMatchPlugin.cpp
|
||||
|
@@ -31,7 +31,6 @@
|
||||
#include "InfoSystemCache.h"
|
||||
#include "infoplugins/generic/echonest/EchonestPlugin.h"
|
||||
#include "infoplugins/generic/MusixMatchPlugin.h"
|
||||
#include "infoplugins/generic/ChartsPlugin.h"
|
||||
#include "infoplugins/generic/NewReleasesPlugin.h"
|
||||
#include "infoplugins/generic/spotifyPlugin.h"
|
||||
#include "infoplugins/generic/musicbrainzPlugin.h"
|
||||
@@ -91,7 +90,6 @@ InfoSystemWorker::init( Tomahawk::InfoSystem::InfoSystemCache* cache )
|
||||
#ifndef ENABLE_HEADLESS
|
||||
addInfoPlugin( InfoPluginPtr( new MusixMatchPlugin() ) );
|
||||
addInfoPlugin( InfoPluginPtr( new MusicBrainzPlugin() ) );
|
||||
addInfoPlugin( InfoPluginPtr( new ChartsPlugin() ) );
|
||||
addInfoPlugin( InfoPluginPtr( new NewReleasesPlugin() ) );
|
||||
addInfoPlugin( InfoPluginPtr( new RoviPlugin() ) );
|
||||
addInfoPlugin( InfoPluginPtr( new SpotifyPlugin() ) );
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include <QtNetwork/QNetworkReply>
|
||||
|
||||
#include "Album.h"
|
||||
#include "ChartsPlugin_Data_p.h"
|
||||
#include "CountryUtils.h"
|
||||
#include "Typedefs.h"
|
||||
#include "audio/AudioEngine.h"
|
||||
#include "TomahawkSettings.h"
|
||||
|
@@ -31,7 +31,7 @@
|
||||
#include "TomahawkSettings.h"
|
||||
#include "utils/TomahawkUtils.h"
|
||||
#include "utils/Logger.h"
|
||||
#include "ChartsPlugin_Data_p.h"
|
||||
#include "CountryUtils.h"
|
||||
|
||||
#define SPOTIFY_API_URL "http://spotikea.tomahawk-player.org/"
|
||||
#include <qjson/parser.h>
|
||||
|
Reference in New Issue
Block a user