mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 19:05:46 -05:00
[netinstall] Edge cases of zero, or unset, groups urls
- consumers may wait for loadingDone(), so always emit that even if no URL list is set.
This commit is contained in:
parent
9569105575
commit
4dd6ecd54e
3 changed files with 12 additions and 9 deletions
|
@ -136,26 +136,23 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
|
|||
// Lastly, load the groups data
|
||||
const QString key = QStringLiteral( "groupsUrl" );
|
||||
const auto& groupsUrlVariant = configurationMap.value( key );
|
||||
m_queue = new LoaderQueue( this );
|
||||
if ( groupsUrlVariant.type() == QVariant::String )
|
||||
{
|
||||
m_queue = new LoaderQueue( this );
|
||||
m_queue->append( SourceItem::makeSourceItem( groupsUrlVariant.toString(), configurationMap ) );
|
||||
}
|
||||
else if ( groupsUrlVariant.type() == QVariant::List )
|
||||
{
|
||||
m_queue = new LoaderQueue( this );
|
||||
for ( const auto& s : groupsUrlVariant.toStringList() )
|
||||
{
|
||||
m_queue->append( SourceItem::makeSourceItem( s, configurationMap ) );
|
||||
}
|
||||
}
|
||||
if ( m_queue && m_queue->count() > 0 )
|
||||
{
|
||||
cDebug() << "Loading netinstall from" << m_queue->count() << "alternate sources.";
|
||||
setStatus( required() ? Status::FailedNoData : Status::Ok );
|
||||
connect( m_queue, &LoaderQueue::done, this, &Config::loadingDone );
|
||||
m_queue->load();
|
||||
}
|
||||
|
||||
setStatus( required() ? Status::FailedNoData : Status::Ok );
|
||||
cDebug() << "Loading netinstall from" << m_queue->count() << "alternate sources.";
|
||||
connect( m_queue, &LoaderQueue::done, this, &Config::loadingDone );
|
||||
m_queue->load();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -347,6 +347,7 @@ ItemTests::testUrlFallback_data()
|
|||
QTest::newRow( "error" ) << "1a-single-error.conf" << smash( S::FailedBadData ) << 0;
|
||||
QTest::newRow( "second" ) << "1b-single-small.conf" << smash( S::Ok ) << 2;
|
||||
QTest::newRow( "none" ) << "1c-none.conf" << smash( S::FailedNoData ) << 0;
|
||||
QTest::newRow( "unset" ) << "1c-unset.conf" << smash( S::FailedNoData ) << 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
5
src/modules/netinstall/tests/1c-unset.conf
Normal file
5
src/modules/netinstall/tests/1c-unset.conf
Normal file
|
@ -0,0 +1,5 @@
|
|||
# SPDX-FileCopyrightText: no
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
#
|
||||
---
|
||||
required: true
|
Loading…
Add table
Reference in a new issue