1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 14:16:32 +02:00

* Plugin-ify RoviPlugin.

This commit is contained in:
Christian Muehlhaeuser
2012-05-19 09:44:51 +02:00
parent 93cc1fcca8
commit 73e824c859
2 changed files with 14 additions and 5 deletions

View File

@@ -19,11 +19,12 @@
#include "RoviPlugin.h" #include "RoviPlugin.h"
#include "utils/Logger.h"
#include <QDateTime> #include <QDateTime>
#include <QNetworkReply> #include <QNetworkReply>
#include <QtPlugin>
#include <parser.h> #include <parser.h>
#include "utils/Logger.h"
using namespace Tomahawk::InfoSystem; using namespace Tomahawk::InfoSystem;
@@ -41,9 +42,9 @@ RoviPlugin::RoviPlugin()
m_secret = "XUnYutaAW6"; m_secret = "XUnYutaAW6";
} }
RoviPlugin::~RoviPlugin() RoviPlugin::~RoviPlugin()
{ {
} }
@@ -69,6 +70,7 @@ RoviPlugin::getInfo( Tomahawk::InfoSystem::InfoRequestData requestData )
emit getCachedInfo( criteria, 0, requestData ); emit getCachedInfo( criteria, 0, requestData );
} }
void void
RoviPlugin::notInCacheSlot( Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) RoviPlugin::notInCacheSlot( Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData )
{ {
@@ -96,6 +98,7 @@ RoviPlugin::notInCacheSlot( Tomahawk::InfoSystem::InfoStringHash criteria, Tomah
} }
} }
void void
RoviPlugin::albumLookupError( QNetworkReply::NetworkError error ) RoviPlugin::albumLookupError( QNetworkReply::NetworkError error )
{ {
@@ -111,6 +114,7 @@ RoviPlugin::albumLookupError( QNetworkReply::NetworkError error )
} }
void void
RoviPlugin::albumLookupFinished() RoviPlugin::albumLookupFinished()
{ {
@@ -187,5 +191,7 @@ RoviPlugin::generateSig() const
{ {
QByteArray raw = m_apiKey + m_secret + QString::number( QDateTime::currentMSecsSinceEpoch() / 1000 ).toLatin1(); QByteArray raw = m_apiKey + m_secret + QString::number( QDateTime::currentMSecsSinceEpoch() / 1000 ).toLatin1();
return TomahawkUtils::md5( raw ).toLatin1(); return TomahawkUtils::md5( raw ).toLatin1();
} }
Q_EXPORT_PLUGIN2( Tomahawk::InfoSystem::InfoPlugin, Tomahawk::InfoSystem::RoviPlugin )

View File

@@ -21,6 +21,7 @@
#define ROVIPLUGIN_H #define ROVIPLUGIN_H
#include "infosystem/InfoSystem.h" #include "infosystem/InfoSystem.h"
#include "infoplugins/InfoPluginDllMacro.h"
#include <QNetworkReply> #include <QNetworkReply>
@@ -32,9 +33,11 @@ namespace Tomahawk
namespace InfoSystem namespace InfoSystem
{ {
class RoviPlugin : public InfoPlugin class INFOPLUGINDLLEXPORT RoviPlugin : public InfoPlugin
{ {
Q_OBJECT Q_OBJECT
Q_INTERFACES( Tomahawk::InfoSystem::InfoPlugin )
public: public:
RoviPlugin(); RoviPlugin();
virtual ~RoviPlugin(); virtual ~RoviPlugin();