diff --git a/src/libtomahawk/CMakeLists.txt b/src/libtomahawk/CMakeLists.txt index 96e3cb633..7d811569e 100644 --- a/src/libtomahawk/CMakeLists.txt +++ b/src/libtomahawk/CMakeLists.txt @@ -232,6 +232,7 @@ set( libHeaders database/databasecommand_clientauthvalid.h infosystem/infosystem.h + infosystem/infosystemworker.h infosystem/infosystemcache.h infosystem/infoplugins/echonestplugin.h infosystem/infoplugins/lastfmplugin.h diff --git a/src/libtomahawk/infosystem/infoplugins/echonestplugin.h b/src/libtomahawk/infosystem/infoplugins/echonestplugin.h index 0e7b9d618..6be973aa4 100644 --- a/src/libtomahawk/infosystem/infoplugins/echonestplugin.h +++ b/src/libtomahawk/infosystem/infoplugins/echonestplugin.h @@ -20,6 +20,7 @@ #define ECHONESTPLUGIN_H #include "infosystem/infosystem.h" +#include "infosystem/infosystemworker.h" #include diff --git a/src/libtomahawk/infosystem/infoplugins/lastfmplugin.h b/src/libtomahawk/infosystem/infoplugins/lastfmplugin.h index f4112d080..1e02077e6 100644 --- a/src/libtomahawk/infosystem/infoplugins/lastfmplugin.h +++ b/src/libtomahawk/infosystem/infoplugins/lastfmplugin.h @@ -19,6 +19,7 @@ #ifndef LASTFMPLUGIN_H #define LASTFMPLUGIN_H #include "infosystem/infosystem.h" +#include "infosystem/infosystemworker.h" #include "result.h" #include diff --git a/src/libtomahawk/infosystem/infoplugins/musixmatchplugin.h b/src/libtomahawk/infosystem/infoplugins/musixmatchplugin.h index 8b93d6a4e..76da557b4 100644 --- a/src/libtomahawk/infosystem/infoplugins/musixmatchplugin.h +++ b/src/libtomahawk/infosystem/infoplugins/musixmatchplugin.h @@ -20,6 +20,7 @@ #define MUSIXMATCHPLUGIN_H #include "infosystem/infosystem.h" +#include "infosystem/infosystemworker.h" class QNetworkReply; diff --git a/src/libtomahawk/infosystem/infosystem.h b/src/libtomahawk/infosystem/infosystem.h index 97c055073..63c7a2fa9 100644 --- a/src/libtomahawk/infosystem/infosystem.h +++ b/src/libtomahawk/infosystem/infosystem.h @@ -140,31 +140,6 @@ private: typedef QWeakPointer< InfoPlugin > InfoPluginPtr; -class DLLEXPORT InfoSystemWorker : public QObject -{ - Q_OBJECT - -public: - InfoSystemWorker(); - ~InfoSystemWorker(); - - void registerInfoTypes( const InfoPluginPtr &plugin, const QSet< InfoType > &types ); - -signals: - void info( QString target, Tomahawk::InfoSystem::InfoType, QVariant input, QVariant output, Tomahawk::InfoSystem::InfoCustomData customData ); - -public slots: - void getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData ); - -private: - QLinkedList< InfoPluginPtr > determineOrderedMatches( const InfoType type ) const; - - // For now, statically instantiate plugins; this is just somewhere to keep them - QLinkedList< InfoPluginPtr > m_plugins; - - QMap< InfoType, QLinkedList< InfoPluginPtr > > m_infoMap; -}; - class DLLEXPORT InfoSystem : public QObject { Q_OBJECT diff --git a/src/libtomahawk/infosystem/infosystemworker.cpp b/src/libtomahawk/infosystem/infosystemworker.cpp index 1849c044d..40b2752f2 100644 --- a/src/libtomahawk/infosystem/infosystemworker.cpp +++ b/src/libtomahawk/infosystem/infosystemworker.cpp @@ -18,7 +18,7 @@ #include -#include "infosystem.h" +#include "infosystemworker.h" #include "utils/tomahawkutils.h" #include "infosystemcache.h" #include "infoplugins/echonestplugin.h" diff --git a/src/libtomahawk/infosystem/infosystemworker.h b/src/libtomahawk/infosystem/infosystemworker.h new file mode 100644 index 000000000..a51e198a9 --- /dev/null +++ b/src/libtomahawk/infosystem/infosystemworker.h @@ -0,0 +1,67 @@ +/* === This file is part of Tomahawk Player - === + * + * Copyright 2010-2011, Christian Muehlhaeuser + * + * Tomahawk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Tomahawk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Tomahawk. If not, see . + */ + +#ifndef TOMAHAWK_INFOSYSTEMWORKER_H +#define TOMAHAWK_INFOSYSTEMWORKER_H + +#include "infosystem/infosystem.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "dllmacro.h" + +namespace Tomahawk { + +namespace InfoSystem { + +class DLLEXPORT InfoSystemWorker : public QObject +{ + Q_OBJECT + +public: + InfoSystemWorker(); + ~InfoSystemWorker(); + + void registerInfoTypes( const InfoPluginPtr &plugin, const QSet< InfoType > &types ); + +signals: + void info( QString target, Tomahawk::InfoSystem::InfoType, QVariant input, QVariant output, Tomahawk::InfoSystem::InfoCustomData customData ); + +public slots: + void getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData ); + +private: + QLinkedList< InfoPluginPtr > determineOrderedMatches( const InfoType type ) const; + + // For now, statically instantiate plugins; this is just somewhere to keep them + QLinkedList< InfoPluginPtr > m_plugins; + + QMap< InfoType, QLinkedList< InfoPluginPtr > > m_infoMap; +}; + +} + +} + +#endif // TOMAHAWK_INFOSYSTEMWORKER_H