1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-20 04:41:36 +02:00

Split infosystemworker into its own header

This commit is contained in:
Jeff Mitchell
2011-04-30 13:25:17 -04:00
parent 1b656fe874
commit 37b9dea002
7 changed files with 72 additions and 26 deletions

View File

@@ -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

View File

@@ -20,6 +20,7 @@
#define ECHONESTPLUGIN_H
#include "infosystem/infosystem.h"
#include "infosystem/infosystemworker.h"
#include <QObject>

View File

@@ -19,6 +19,7 @@
#ifndef LASTFMPLUGIN_H
#define LASTFMPLUGIN_H
#include "infosystem/infosystem.h"
#include "infosystem/infosystemworker.h"
#include "result.h"
#include <lastfm/Track>

View File

@@ -20,6 +20,7 @@
#define MUSIXMATCHPLUGIN_H
#include "infosystem/infosystem.h"
#include "infosystem/infosystemworker.h"
class QNetworkReply;

View File

@@ -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

View File

@@ -18,7 +18,7 @@
#include <QCoreApplication>
#include "infosystem.h"
#include "infosystemworker.h"
#include "utils/tomahawkutils.h"
#include "infosystemcache.h"
#include "infoplugins/echonestplugin.h"

View File

@@ -0,0 +1,67 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef TOMAHAWK_INFOSYSTEMWORKER_H
#define TOMAHAWK_INFOSYSTEMWORKER_H
#include "infosystem/infosystem.h"
#include <QtCore/QObject>
#include <QtCore/QtDebug>
#include <QtCore/QMap>
#include <QtCore/QWeakPointer>
#include <QtCore/QSet>
#include <QtCore/QLinkedList>
#include <QtCore/QVariant>
#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