]> sigrok.org Git - pulseview.git/commitdiff
MainBar: Disallow negative sample rates
authorSoeren Apel <redacted>
Fri, 10 Aug 2018 21:35:38 +0000 (23:35 +0200)
committerUwe Hermann <redacted>
Tue, 21 Aug 2018 10:02:38 +0000 (12:02 +0200)
pv/toolbars/mainbar.cpp

index d78a153f160d0f14e45969572cfe671269ba07f0..3ee62f4c3dabbd519ced10b1f26c4f410bb2742e 100644 (file)
@@ -509,8 +509,8 @@ void MainBar::commit_sample_rate()
        const shared_ptr<sigrok::Device> 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,