mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
bugfixing adding spotify account
This commit is contained in:
@@ -495,11 +495,6 @@ for plugin in VLC_PLUGINS:
|
|||||||
for plugin in TOMAHAWK_PLUGINS:
|
for plugin in TOMAHAWK_PLUGINS:
|
||||||
FixPlugin(plugin, '../MacOS')
|
FixPlugin(plugin, '../MacOS')
|
||||||
|
|
||||||
try:
|
|
||||||
FixPlugin('spotify_tomahawkresolver', '../MacOS')
|
|
||||||
except:
|
|
||||||
print 'Failed to find spotify resolver'
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
FixPlugin('tomahawk_crash_reporter', '../MacOS')
|
FixPlugin('tomahawk_crash_reporter', '../MacOS')
|
||||||
except:
|
except:
|
||||||
|
@@ -27,6 +27,7 @@
|
|||||||
#include "utils/TomahawkUtils.h"
|
#include "utils/TomahawkUtils.h"
|
||||||
#include "ActionCollection.h"
|
#include "ActionCollection.h"
|
||||||
#include "Pipeline.h"
|
#include "Pipeline.h"
|
||||||
|
#include "accounts/AccountManager.h"
|
||||||
|
|
||||||
#ifndef ENABLE_HEADLESS
|
#ifndef ENABLE_HEADLESS
|
||||||
#include "jobview/JobStatusView.h"
|
#include "jobview/JobStatusView.h"
|
||||||
@@ -86,6 +87,13 @@ SpotifyAccount::~SpotifyAccount()
|
|||||||
void
|
void
|
||||||
SpotifyAccount::init()
|
SpotifyAccount::init()
|
||||||
{
|
{
|
||||||
|
if ( !AtticaManager::instance()->resolversLoaded() )
|
||||||
|
{
|
||||||
|
// If we're still waiting to load, wait for the attica resolvers to come down the pipe
|
||||||
|
connect( AtticaManager::instance(), SIGNAL( resolversLoaded( Attica::Content::List ) ), this, SLOT( init() ), Qt::UniqueConnection );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
qRegisterMetaType< Tomahawk::Accounts::SpotifyPlaylistInfo* >( "Tomahawk::Accounts::SpotifyPlaylist*" );
|
qRegisterMetaType< Tomahawk::Accounts::SpotifyPlaylistInfo* >( "Tomahawk::Accounts::SpotifyPlaylist*" );
|
||||||
|
|
||||||
setAccountFriendlyName( "Spotify" );
|
setAccountFriendlyName( "Spotify" );
|
||||||
@@ -122,6 +130,7 @@ SpotifyAccount::hookupResolver()
|
|||||||
|
|
||||||
const AtticaManager::Resolver data = AtticaManager::instance()->resolverData( res.id() );
|
const AtticaManager::Resolver data = AtticaManager::instance()->resolverData( res.id() );
|
||||||
|
|
||||||
|
qDebug() << "Starting spotify resolver with path:" << data.scriptPath;
|
||||||
m_spotifyResolver = QWeakPointer< ScriptResolver >( qobject_cast< ScriptResolver* >( Pipeline::instance()->addScriptResolver( data.scriptPath, enabled() ) ) );
|
m_spotifyResolver = QWeakPointer< ScriptResolver >( qobject_cast< ScriptResolver* >( Pipeline::instance()->addScriptResolver( data.scriptPath, enabled() ) ) );
|
||||||
|
|
||||||
connect( m_spotifyResolver.data(), SIGNAL( changed() ), this, SLOT( resolverChanged() ) );
|
connect( m_spotifyResolver.data(), SIGNAL( changed() ), this, SLOT( resolverChanged() ) );
|
||||||
@@ -226,14 +235,20 @@ SpotifyAccount::connectionState() const
|
|||||||
void
|
void
|
||||||
SpotifyAccount::resolverInstalled(const QString& resolverId)
|
SpotifyAccount::resolverInstalled(const QString& resolverId)
|
||||||
{
|
{
|
||||||
|
if ( resolverId == s_resolverId )
|
||||||
|
{
|
||||||
|
// We requested this install, so we want to launch it
|
||||||
|
hookupResolver();
|
||||||
|
AccountManager::instance()->enableAccount( this );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
SpotifyAccount::atticaLoaded( Attica::Content::List )
|
SpotifyAccount::atticaLoaded( Attica::Content::List )
|
||||||
{
|
{
|
||||||
|
disconnect( AtticaManager::instance(), SIGNAL( resolversLoaded( Attica::Content::List ) ), this, SLOT( atticaLoaded( Attica::Content::List ) ) );
|
||||||
|
authenticate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -115,8 +115,8 @@ private slots:
|
|||||||
void startPlaylistSyncWithPlaylist( const QString& msgType, const QVariantMap& msg );
|
void startPlaylistSyncWithPlaylist( const QString& msgType, const QVariantMap& msg );
|
||||||
void playlistCreated( const QString& msgType, const QVariantMap& msg );
|
void playlistCreated( const QString& msgType, const QVariantMap& msg );
|
||||||
|
|
||||||
private:
|
|
||||||
void init();
|
void init();
|
||||||
|
private:
|
||||||
void hookupResolver();
|
void hookupResolver();
|
||||||
bool checkForResolver();
|
bool checkForResolver();
|
||||||
|
|
||||||
|
@@ -58,7 +58,7 @@ public:
|
|||||||
public slots:
|
public slots:
|
||||||
void installSucceeded( const QString& path )
|
void installSucceeded( const QString& path )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "install of binary resolver succeeded, enabling";
|
qDebug() << Q_FUNC_INFO << "install of binary resolver succeeded, enabling: " << path;
|
||||||
|
|
||||||
if ( m_manager.isNull() )
|
if ( m_manager.isNull() )
|
||||||
return;
|
return;
|
||||||
@@ -72,7 +72,9 @@ public slots:
|
|||||||
Tomahawk::Accounts::AccountManager::instance()->enableAccount( acct );
|
Tomahawk::Accounts::AccountManager::instance()->enableAccount( acct );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_manager.data()->m_resolverStates[ m_resolverId ].scriptPath = path;
|
||||||
m_manager.data()->m_resolverStates[ m_resolverId ].state = AtticaManager::Installed;
|
m_manager.data()->m_resolverStates[ m_resolverId ].state = AtticaManager::Installed;
|
||||||
|
|
||||||
TomahawkSettingsGui::instanceGui()->setAtticaResolverStates( m_manager.data()->m_resolverStates );
|
TomahawkSettingsGui::instanceGui()->setAtticaResolverStates( m_manager.data()->m_resolverStates );
|
||||||
emit m_manager.data()->resolverInstalled( m_resolverId );
|
emit m_manager.data()->resolverInstalled( m_resolverId );
|
||||||
emit m_manager.data()->resolverStateChanged( m_resolverId );
|
emit m_manager.data()->resolverStateChanged( m_resolverId );
|
||||||
@@ -106,7 +108,7 @@ AtticaManager::AtticaManager( QObject* parent )
|
|||||||
|
|
||||||
// resolvers
|
// resolvers
|
||||||
// m_manager.addProviderFile( QUrl( "http://bakery.tomahawk-player.org/resolvers/providers.xml" ) );
|
// m_manager.addProviderFile( QUrl( "http://bakery.tomahawk-player.org/resolvers/providers.xml" ) );
|
||||||
m_manager.addProviderFile( QUrl( "http://lycophron/resolvers/providers.xml" ) );
|
m_manager.addProviderFile( QUrl( "http://localhost/resolvers/providers.xml" ) );
|
||||||
|
|
||||||
qRegisterMetaType< Attica::Content >( "Attica::Content" );
|
qRegisterMetaType< Attica::Content >( "Attica::Content" );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user