[packagechooser] Refactor fromApp*()

- These don't have to be static methods of PackageItem, a free
   function is more convenient.
 - Since it's not API of PackageItem anymore, need to
   - update tests not to use API
   - do API-not-available warnings in consumers
This commit is contained in:
Adriaan de Groot 2019-08-20 04:15:35 -04:00
parent 17abbeda96
commit 0a92ef7655
8 changed files with 102 additions and 56 deletions

View file

@ -71,7 +71,7 @@ fromComponent( AppStream::Component& component )
map.insert( "id", component.id() );
map.insert( "name", component.name() );
map.insert( "description", component.description() );
map.insert( "package", component.packageNames().join(",") );
map.insert( "package", component.packageNames().join( "," ) );
auto screenshots = component.screenshots();
if ( screenshots.count() > 0 )
@ -96,7 +96,7 @@ fromComponent( AppStream::Component& component )
}
PackageItem
PackageItem::fromAppStream( const QVariantMap& item_map )
fromAppStream( const QVariantMap& item_map )
{
QString appstreamId = CalamaresUtils::getString( item_map, "appstream" );
if ( appstreamId.isEmpty() )