Update pieces label on source change even if piece size doesn't change (#6516)

Label update is made when slider changes its value, and on source change
slider value is being set to a newly calculated, but not necessarily
different from the previous one, value. This means that the slider
change signal may not be emitted, in which case label continues to show
previous text, including "No source selected", which is misleading.
This commit is contained in:
Mike Gelfand 2024-01-14 17:12:26 +00:00 committed by Charles Kerr
parent 1ccef92cdc
commit 352fa985b2
1 changed files with 3 additions and 5 deletions

View File

@ -220,11 +220,9 @@ void MakeDialog::onSourceChanged()
builder_.emplace(filename.toStdString());
}
if (!builder_)
{
updatePiecesLabel();
}
else
updatePiecesLabel();
if (builder_)
{
ui_.pieceSizeSlider->setValue(log2(builder_->pieceSize()));
}