mirror of
https://github.com/altlinux/ALTMediaWriter.git
synced 2024-10-26 08:55:03 +03:00
fix null variant qml errors
select a valid release/variant during loading
This commit is contained in:
parent
9e6d2805e3
commit
b92267989a
@ -452,6 +452,8 @@ void ReleaseManager::loadReleaseFile(const QString &fileContents) {
|
||||
Release *release = get(i);
|
||||
|
||||
if (release->name().toLower().contains(name)) {
|
||||
// Select first release to get a valid variant to avoid null selected variant
|
||||
m_selectedIndex = i;
|
||||
release->updateUrl(url, arch, imageType, board);
|
||||
}
|
||||
}
|
||||
@ -695,8 +697,8 @@ void Release::updateUrl(const QString &url, Architecture *architecture, ImageTyp
|
||||
emit variantsChanged();
|
||||
|
||||
// Select first variant by default
|
||||
// TODO: use setSelectedVariantIndex()? Need to avoid checking for (if changed) condition in there then
|
||||
if (m_variants.count() == 1) {
|
||||
m_selectedVariant = 0;
|
||||
emit selectedVariantChanged();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user