diff --git a/admin/mac/macdeploy.py b/admin/mac/macdeploy.py index 71bdefb77..3a2ffffd8 100755 --- a/admin/mac/macdeploy.py +++ b/admin/mac/macdeploy.py @@ -495,11 +495,6 @@ for plugin in VLC_PLUGINS: for plugin in TOMAHAWK_PLUGINS: FixPlugin(plugin, '../MacOS') -try: - FixPlugin('spotify_tomahawkresolver', '../MacOS') -except: - print 'Failed to find spotify resolver' - try: FixPlugin('tomahawk_crash_reporter', '../MacOS') except: diff --git a/src/accounts/spotify/SpotifyAccount.cpp b/src/accounts/spotify/SpotifyAccount.cpp index 902c5695e..c3e4106f5 100644 --- a/src/accounts/spotify/SpotifyAccount.cpp +++ b/src/accounts/spotify/SpotifyAccount.cpp @@ -27,6 +27,7 @@ #include "utils/TomahawkUtils.h" #include "ActionCollection.h" #include "Pipeline.h" +#include "accounts/AccountManager.h" #ifndef ENABLE_HEADLESS #include "jobview/JobStatusView.h" @@ -86,6 +87,13 @@ SpotifyAccount::~SpotifyAccount() void 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*" ); setAccountFriendlyName( "Spotify" ); @@ -122,6 +130,7 @@ SpotifyAccount::hookupResolver() 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() ) ) ); connect( m_spotifyResolver.data(), SIGNAL( changed() ), this, SLOT( resolverChanged() ) ); @@ -226,14 +235,20 @@ SpotifyAccount::connectionState() const void 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 SpotifyAccount::atticaLoaded( Attica::Content::List ) { - + disconnect( AtticaManager::instance(), SIGNAL( resolversLoaded( Attica::Content::List ) ), this, SLOT( atticaLoaded( Attica::Content::List ) ) ); + authenticate(); } diff --git a/src/accounts/spotify/SpotifyAccount.h b/src/accounts/spotify/SpotifyAccount.h index 44930cb5e..7d23dddde 100644 --- a/src/accounts/spotify/SpotifyAccount.h +++ b/src/accounts/spotify/SpotifyAccount.h @@ -115,8 +115,8 @@ private slots: void startPlaylistSyncWithPlaylist( const QString& msgType, const QVariantMap& msg ); void playlistCreated( const QString& msgType, const QVariantMap& msg ); -private: void init(); +private: void hookupResolver(); bool checkForResolver(); diff --git a/src/libtomahawk/AtticaManager.cpp b/src/libtomahawk/AtticaManager.cpp index 857ed434f..9ae1d27cf 100644 --- a/src/libtomahawk/AtticaManager.cpp +++ b/src/libtomahawk/AtticaManager.cpp @@ -58,7 +58,7 @@ public: public slots: 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() ) return; @@ -72,7 +72,9 @@ public slots: 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; + TomahawkSettingsGui::instanceGui()->setAtticaResolverStates( m_manager.data()->m_resolverStates ); emit m_manager.data()->resolverInstalled( m_resolverId ); emit m_manager.data()->resolverStateChanged( m_resolverId ); @@ -106,7 +108,7 @@ AtticaManager::AtticaManager( QObject* parent ) // resolvers // 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" ); }