mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-02 20:28:14 +02:00
Automatically upgrade resolvers
This commit is contained in:
@@ -45,6 +45,8 @@ AtticaManager::AtticaManager( QObject* parent )
|
|||||||
|
|
||||||
// resolvers
|
// resolvers
|
||||||
m_manager.addProviderFile( QUrl( "http://bakery.tomahawk-player.org:10480/resolvers/providers.xml" ) );
|
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() ) )
|
if ( newerVersion( r.version, upstream.version() ) )
|
||||||
{
|
{
|
||||||
m_resolverStates[ id ].state = NeedsUpgrade;
|
m_resolverStates[ id ].state = NeedsUpgrade;
|
||||||
|
QMetaObject::invokeMethod( this, "upgradeResolver", Qt::QueuedConnection, Q_ARG( Attica::Content, upstream ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -83,8 +83,6 @@ public:
|
|||||||
ResolverState resolverState( const Attica::Content& resolver ) const;
|
ResolverState resolverState( const Attica::Content& resolver ) const;
|
||||||
QPixmap iconForResolver( const Attica::Content& id ); // Looks up in icon cache
|
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 Attica::Content& resolver );
|
||||||
void uninstallResolver( const QString& pathToResolver );
|
void uninstallResolver( const QString& pathToResolver );
|
||||||
QString pathFromId( const QString& resolverId ) const;
|
QString pathFromId( const QString& resolverId ) const;
|
||||||
@@ -92,6 +90,9 @@ public:
|
|||||||
void uploadRating( const Attica::Content& c );
|
void uploadRating( const Attica::Content& c );
|
||||||
bool userHasRated( const Attica::Content& c ) const;
|
bool userHasRated( const Attica::Content& c ) const;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void installResolver( const Attica::Content& resolver );
|
||||||
|
void upgradeResolver( const Attica::Content& resolver );
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void resolversReloaded( const Attica::Content::List& resolvers );
|
void resolversReloaded( const Attica::Content::List& resolvers );
|
||||||
@@ -127,4 +128,6 @@ private:
|
|||||||
static AtticaManager* s_instance;
|
static AtticaManager* s_instance;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE( Attica::Content );
|
||||||
|
|
||||||
#endif // ATTICAMANAGER_H
|
#endif // ATTICAMANAGER_H
|
||||||
|
Reference in New Issue
Block a user