From: Soeren Apel Date: Fri, 10 Aug 2018 21:35:38 +0000 (+0200) Subject: MainBar: Disallow negative sample rates X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c31d9f6a38c451faf0b86b5299dde366f968b058;p=pulseview.git MainBar: Disallow negative sample rates --- diff --git a/pv/toolbars/mainbar.cpp b/pv/toolbars/mainbar.cpp index d78a153f..3ee62f4c 100644 --- a/pv/toolbars/mainbar.cpp +++ b/pv/toolbars/mainbar.cpp @@ -509,8 +509,8 @@ void MainBar::commit_sample_rate() const shared_ptr sr_dev = device->device(); sample_rate = sample_rate_.value(); - if (sample_rate == 0) - return; + if (sample_rate < 0) + sample_rate_.set_value(0); try { sr_dev->config_set(ConfigKey::SAMPLERATE,