mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-02-19 23:55:43 +01:00
Add friendlyNames to InfoPlugins and show them in the diagnostics dialog
This commit is contained in:
parent
fc4acddaae
commit
61c347d21b
@ -30,6 +30,8 @@
|
|||||||
#include "sip/SipHandler.h"
|
#include "sip/SipHandler.h"
|
||||||
#include "utils/TomahawkUtilsGui.h"
|
#include "utils/TomahawkUtilsGui.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
#include "infosystem/InfoSystem.h"
|
||||||
|
#include "infosystem/InfoSystemWorker.h"
|
||||||
|
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
@ -81,6 +83,19 @@ DiagnosticsDialog::updateLogView()
|
|||||||
log.append( " visible: false\n" );
|
log.append( " visible: false\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.append( "\n\nINFOPLUGINS:\n" );
|
||||||
|
QThread* infoSystemWorkerThreadSuperClass = Tomahawk::InfoSystem::InfoSystem::instance()->workerThread();
|
||||||
|
Tomahawk::InfoSystem::InfoSystemWorkerThread* infoSystemWorkerThread = qobject_cast< Tomahawk::InfoSystem::InfoSystemWorkerThread* >(infoSystemWorkerThreadSuperClass);
|
||||||
|
|
||||||
|
foreach(const Tomahawk::InfoSystem::InfoPluginPtr& plugin, infoSystemWorkerThread->worker()->plugins())
|
||||||
|
{
|
||||||
|
log.append(" ");
|
||||||
|
log.append( plugin->friendlyName() );
|
||||||
|
log.append("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
log.append( "\n\n" );
|
||||||
|
|
||||||
log.append( "ACCOUNTS:\n" );
|
log.append( "ACCOUNTS:\n" );
|
||||||
|
|
||||||
const QList< Tomahawk::source_ptr > sources = SourceList::instance()->sources( true );
|
const QList< Tomahawk::source_ptr > sources = SourceList::instance()->sources( true );
|
||||||
|
@ -51,6 +51,8 @@ public:
|
|||||||
LastFmInfoPlugin( Accounts::LastFmAccount* account );
|
LastFmInfoPlugin( Accounts::LastFmAccount* account );
|
||||||
virtual ~LastFmInfoPlugin();
|
virtual ~LastFmInfoPlugin();
|
||||||
|
|
||||||
|
const QString friendlyName() const { return "LastFM"; };
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void settingsChanged();
|
void settingsChanged();
|
||||||
|
|
||||||
|
@ -45,6 +45,8 @@ public:
|
|||||||
explicit SpotifyInfoPlugin( Accounts::SpotifyAccount* account );
|
explicit SpotifyInfoPlugin( Accounts::SpotifyAccount* account );
|
||||||
virtual ~SpotifyInfoPlugin();
|
virtual ~SpotifyInfoPlugin();
|
||||||
|
|
||||||
|
const QString friendlyName() const { return "Spotify"; };
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void albumListingResult( const QString& msgType, const QVariantMap& msg, const QVariant& extraData );
|
void albumListingResult( const QString& msgType, const QVariantMap& msg, const QVariant& extraData );
|
||||||
|
|
||||||
|
@ -68,10 +68,25 @@ InfoPlugin::InfoPlugin()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
InfoPlugin::~InfoPlugin()
|
InfoPlugin::~InfoPlugin()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
InfoPlugin::setFriendlyName( const QString& friendlyName )
|
||||||
|
{
|
||||||
|
m_friendlyName = friendlyName;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString
|
||||||
|
InfoPlugin::friendlyName() const
|
||||||
|
{
|
||||||
|
return m_friendlyName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
InfoSystem* InfoSystem::s_instance = 0;
|
InfoSystem* InfoSystem::s_instance = 0;
|
||||||
|
|
||||||
InfoSystem*
|
InfoSystem*
|
||||||
|
@ -109,6 +109,9 @@ public:
|
|||||||
|
|
||||||
virtual ~InfoPlugin();
|
virtual ~InfoPlugin();
|
||||||
|
|
||||||
|
void setFriendlyName( const QString& friendlyName );
|
||||||
|
virtual const QString friendlyName() const;
|
||||||
|
|
||||||
QSet< InfoType > supportedGetTypes() const { return m_supportedGetTypes; }
|
QSet< InfoType > supportedGetTypes() const { return m_supportedGetTypes; }
|
||||||
QSet< InfoType > supportedPushTypes() const { return m_supportedPushTypes; }
|
QSet< InfoType > supportedPushTypes() const { return m_supportedPushTypes; }
|
||||||
|
|
||||||
@ -133,6 +136,7 @@ protected slots:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
InfoType m_type;
|
InfoType m_type;
|
||||||
|
QString m_friendlyName;
|
||||||
QSet< InfoType > m_supportedGetTypes;
|
QSet< InfoType > m_supportedGetTypes;
|
||||||
QSet< InfoType > m_supportedPushTypes;
|
QSet< InfoType > m_supportedPushTypes;
|
||||||
|
|
||||||
@ -141,7 +145,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class InfoSystemCacheThread : public QThread
|
class DLLEXPORT InfoSystemCacheThread : public QThread
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -157,7 +161,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class InfoSystemWorkerThread : public QThread
|
class DLLEXPORT InfoSystemWorkerThread : public QThread
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
@ -65,6 +65,13 @@ InfoSystemWorker::~InfoSystemWorker()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const QList< InfoPluginPtr >
|
||||||
|
InfoSystemWorker::plugins() const
|
||||||
|
{
|
||||||
|
return m_plugins;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
InfoSystemWorker::init( Tomahawk::InfoSystem::InfoSystemCache* cache )
|
InfoSystemWorker::init( Tomahawk::InfoSystem::InfoSystemCache* cache )
|
||||||
{
|
{
|
||||||
@ -221,6 +228,7 @@ InfoSystemWorker::loadInfoPlugins( const QStringList& pluginPaths )
|
|||||||
if ( infoPlugin )
|
if ( infoPlugin )
|
||||||
{
|
{
|
||||||
tDebug() << Q_FUNC_INFO << "Loaded info plugin:" << loader.fileName();
|
tDebug() << Q_FUNC_INFO << "Loaded info plugin:" << loader.fileName();
|
||||||
|
infoPlugin->setFriendlyName( loader.fileName() );
|
||||||
addInfoPlugin( InfoPluginPtr( infoPlugin ) );
|
addInfoPlugin( InfoPluginPtr( infoPlugin ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -48,6 +48,8 @@ public:
|
|||||||
InfoSystemWorker();
|
InfoSystemWorker();
|
||||||
~InfoSystemWorker();
|
~InfoSystemWorker();
|
||||||
|
|
||||||
|
const QList< InfoPluginPtr > plugins() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void info( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output );
|
void info( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output );
|
||||||
void finished( QString target );
|
void finished( QString target );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user