From 7ec7607bbcf0fa99bd4b157b9b0f0c411d59f45d Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Sun, 14 Jan 2024 17:12:26 +0000 Subject: [PATCH] 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. --- qt/MakeDialog.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/qt/MakeDialog.cc b/qt/MakeDialog.cc index 4d0d193bb..08a4ab9f2 100644 --- a/qt/MakeDialog.cc +++ b/qt/MakeDialog.cc @@ -223,11 +223,9 @@ void MakeDialog::onSourceChanged() builder_.emplace(filename.toStdString()); } - if (!builder_) - { - updatePiecesLabel(); - } - else + updatePiecesLabel(); + + if (builder_) { ui_.pieceSizeSlider->setValue(log2(builder_->piece_size())); }