mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 09:55:37 -04:00
[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:
parent
0a92ef7655
commit
d8af11adee
3 changed files with 24 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue