]> sigrok.org Git - pulseview.git/blobdiff - pv/widgets/timestampspinbox.cpp
Fix #805 by resetting selected device on failure
[pulseview.git] / pv / widgets / timestampspinbox.cpp
index 59af82f65407629b0937ec66bc14308b190188d1..463a846277d814bcebed936335e18d73a6314f55 100644 (file)
@@ -104,8 +104,7 @@ void TimestampSpinBox::on_editingFinished()
                captures.removeFirst(); // remove entire match
                QString str = captures.join("");
                setValue(pv::util::Timestamp(str.toStdString()));
-       }
-       else {
+       } else {
                // replace the malformed entered string with the old value
                updateEdit();
        }
@@ -113,8 +112,8 @@ void TimestampSpinBox::on_editingFinished()
 
 void TimestampSpinBox::updateEdit()
 {
-       QString newtext = pv::util::format_si_value(
-               value_, "s", pv::util::SIPrefix::none, precision_);
+       QString newtext = pv::util::format_time_si(
+               value_, pv::util::SIPrefix::none, precision_);
        lineEdit()->setText(newtext);
 }