[packagechooser] Build AppStream Pool first

- Don't build a Pool for each PackageItem loaded
 - Do make it load all languages instead of only the current one
This commit is contained in:
Adriaan de Groot 2019-08-20 04:38:24 -04:00
parent 0a92ef7655
commit d8af11adee
3 changed files with 24 additions and 10 deletions

View file

@ -96,7 +96,7 @@ fromComponent( AppStream::Component& component )
}
PackageItem
fromAppStream( const QVariantMap& item_map )
fromAppStream( AppStream::Pool& pool, const QVariantMap& item_map )
{
QString appstreamId = CalamaresUtils::getString( item_map, "appstream" );
if ( appstreamId.isEmpty() )
@ -106,13 +106,6 @@ fromAppStream( const QVariantMap& item_map )
}
cDebug() << "Loading AppStream data for" << appstreamId;
AppStream::Pool pool;
if ( !pool.load() )
{
cWarning() << "AppStream load failed" << pool.lastError();
return PackageItem();
}
auto itemList = pool.componentsById( appstreamId );
if ( itemList.count() < 1 )
{