// 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(); }
void GameDetailsJob::processFetchedGameDetails( Attica::BaseJob* job ) { qDebug() << "Game list successfully fetched from the server!"; Attica::ItemJob<Attica::Content> *contentJob = static_cast<Attica::ItemJob<Attica::Content> *>( job ); if( contentJob->metadata().error() == Attica::Metadata::NoError ) { Attica::Content content = contentJob->result(); d->gameDetails = new GameDetailItem( content.name(), content.description(), content.version(), content.summary(), content.previewPicture(), content.attribute("typeid"), content.attribute("typename"), content.homePageEntry( 0 ).url().toString(), content.license(), content.changelog(), "", "", QStringList(), content.rating(), GameDetailItem::Downloadable, content.id() ); emitSucceeded(); } else { emitFailed(); } }