]> sigrok.org Git - pulseview.git/blobdiff - pv/toolbars/samplingbar.cpp
Don't attempt to set SR_CONF_LIMIT_SAMPLES when it's not supported
[pulseview.git] / pv / toolbars / samplingbar.cpp
index f58f4fc38fd60c2ecedce0aefae3bd8468fa6ffa..be29e74bb534643183fd739e5d1785f63f974e22 100644 (file)
@@ -115,8 +115,6 @@ void SamplingBar::set_device_list(
        }
 
        _updating_device_selector = false;
-
-       on_device_selected();
 }
 
 shared_ptr<pv::device::DevInst> SamplingBar::get_selected_device() const
@@ -145,6 +143,8 @@ void SamplingBar::set_selected_device(shared_ptr<pv::device::DevInst> dev_inst)
        for (int i = 0; i < _device_selector.count(); i++)
                if (dev_inst->dev_inst() ==
                        _device_selector.itemData(i).value<void*>()) {
+                       // Calling this leads to on_device_selected being
+                       // invoked, which updates the sampling bar widgets.
                        _device_selector.setCurrentIndex(i);
                        return;
                }
@@ -316,7 +316,8 @@ void SamplingBar::commit_sample_count()
        // Set the sample count
        assert(!_updating_sample_count);
        _updating_sample_count = true;
-       if (!dev_inst->set_config(NULL, SR_CONF_LIMIT_SAMPLES,
+       if (_sample_count_supported &&
+               !dev_inst->set_config(NULL, SR_CONF_LIMIT_SAMPLES,
                g_variant_new_uint64(sample_count))) {
                qDebug() << "Failed to configure sample count.";
                return;