1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 15:59:42 +01:00

Automatically upgrade resolvers

This commit is contained in:
Leo Franchi 2011-11-17 14:18:24 -05:00
parent 9f1ec0ce93
commit ca14fbf0aa
2 changed files with 8 additions and 2 deletions

View File

@ -45,6 +45,8 @@ AtticaManager::AtticaManager( QObject* parent )
// resolvers
m_manager.addProviderFile( QUrl( "http://bakery.tomahawk-player.org:10480/resolvers/providers.xml" ) );
qRegisterMetaType< Attica::Content >( "Attica::Content" );
}
@ -274,6 +276,7 @@ AtticaManager::syncServerData()
if ( newerVersion( r.version, upstream.version() ) )
{
m_resolverStates[ id ].state = NeedsUpgrade;
QMetaObject::invokeMethod( this, "upgradeResolver", Qt::QueuedConnection, Q_ARG( Attica::Content, upstream ) );
}
}
}

View File

@ -83,8 +83,6 @@ public:
ResolverState resolverState( const Attica::Content& resolver ) const;
QPixmap iconForResolver( const Attica::Content& id ); // Looks up in icon cache
void installResolver( const Attica::Content& resolver );
void upgradeResolver( const Attica::Content& resolver );
void uninstallResolver( const Attica::Content& resolver );
void uninstallResolver( const QString& pathToResolver );
QString pathFromId( const QString& resolverId ) const;
@ -92,6 +90,9 @@ public:
void uploadRating( const Attica::Content& c );
bool userHasRated( const Attica::Content& c ) const;
public slots:
void installResolver( const Attica::Content& resolver );
void upgradeResolver( const Attica::Content& resolver );
signals:
void resolversReloaded( const Attica::Content::List& resolvers );
@ -127,4 +128,6 @@ private:
static AtticaManager* s_instance;
};
Q_DECLARE_METATYPE( Attica::Content );
#endif // ATTICAMANAGER_H