|
|
|
@ -23,6 +23,8 @@
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_APPSTREAM
|
|
|
|
|
#include "ItemAppStream.h"
|
|
|
|
|
#include <AppStreamQt/pool.h>
|
|
|
|
|
#include <memory>
|
|
|
|
|
#endif
|
|
|
|
|
#include "PackageChooserPage.h"
|
|
|
|
|
#include "PackageModel.h"
|
|
|
|
@ -209,6 +211,11 @@ PackageChooserViewStep::fillModel( const QVariantList& items )
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_APPSTREAM
|
|
|
|
|
std::unique_ptr< AppStream::Pool > pool;
|
|
|
|
|
bool poolOk = false;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
cDebug() << "Loading PackageChooser model items from config";
|
|
|
|
|
int item_index = 0;
|
|
|
|
|
for ( const auto& item_it : items )
|
|
|
|
@ -232,7 +239,16 @@ PackageChooserViewStep::fillModel( const QVariantList& items )
|
|
|
|
|
else if ( item_map.contains( "appstream" ) )
|
|
|
|
|
{
|
|
|
|
|
#ifdef HAVE_APPSTREAM
|
|
|
|
|
m_model->addPackage( fromAppStream( item_map ) );
|
|
|
|
|
if ( !pool )
|
|
|
|
|
{
|
|
|
|
|
pool = std::make_unique< AppStream::Pool >();
|
|
|
|
|
pool->setLocale( QStringLiteral( "ALL" ) );
|
|
|
|
|
poolOk = pool->load();
|
|
|
|
|
}
|
|
|
|
|
if ( pool && poolOk )
|
|
|
|
|
{
|
|
|
|
|
m_model->addPackage( fromAppStream( *pool, item_map ) );
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
cWarning() << "Loading AppStream data is not supported.";
|
|
|
|
|
#endif
|
|
|
|
|