mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-25 02:09:48 +01:00
Sort binary resolvers, then script resolvers by download count
This commit is contained in:
parent
098183ddca
commit
37b59126f6
@ -42,6 +42,15 @@ using namespace Attica;
|
||||
|
||||
AtticaManager* AtticaManager::s_instance = 0;
|
||||
|
||||
// Sort binary resolvers above script resolvers, and script resolvers by download count
|
||||
bool
|
||||
resolverSort( const Attica::Content& first, const Attica::Content& second )
|
||||
{
|
||||
if ( !first.attribute( "typeid" ).isEmpty() && second.attribute( "typeid" ).isEmpty() )
|
||||
return true;
|
||||
|
||||
return first.downloads() > second.downloads();
|
||||
}
|
||||
|
||||
AtticaManager::AtticaManager( QObject* parent )
|
||||
: QObject( parent )
|
||||
@ -353,7 +362,10 @@ AtticaManager::resolversList( BaseJob* j )
|
||||
syncServerData();
|
||||
|
||||
if ( ++m_resolverJobsLoaded == 2 )
|
||||
{
|
||||
qSort( m_resolvers.begin(), m_resolvers.end(), resolverSort );
|
||||
emit resolversLoaded( m_resolvers );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -404,7 +416,10 @@ AtticaManager::binaryResolversList( BaseJob* j )
|
||||
}
|
||||
|
||||
if ( ++m_resolverJobsLoaded == 2 )
|
||||
{
|
||||
qSort( m_resolvers.begin(), m_resolvers.end(), resolverSort );
|
||||
emit resolversLoaded( m_resolvers );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user