[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

@ -88,26 +88,6 @@ PackageItem::PackageItem::PackageItem( const QVariantMap& item_map )
}
}
#ifndef HAVE_XML
PackageItem
PackageItem::fromAppData( const QVariantMap& item_map )
{
cWarning() << "Loading AppData XML is not supported.";
return PackageItem();
}
#endif
#ifndef HAVE_APPSTREAM
PackageItem
PackageItem::fromAppStream( const QVariantMap& item_map )
{
cWarning() << "Loading AppStream data is not supported.";
return PackageItem();
}
#endif
PackageListModel::PackageListModel( QObject* parent )
: QAbstractListModel( parent )
{