]> sigrok.org Git - pulseview.git/blobdiff - pv/dialogs/connect.cpp
Adapt to config key capabilities.
[pulseview.git] / pv / dialogs / connect.cpp
index 611c9cc50d7f3fb10a81963f1a4138de06b9064b..1156d6f5c87b2e79993f6cea7426e8411adc51e4 100644 (file)
@@ -18,7 +18,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#include <boost/foreach.hpp>
+#include <cassert>
 
 #include <libsigrok/libsigrok.h>
 
@@ -34,8 +34,8 @@ extern "C" {
 #include <libsigrok/libsigrok.h>
 }
 
-using boost::shared_ptr;
 using std::list;
+using std::shared_ptr;
 using std::string;
 
 extern sr_context *sr_ctx;
@@ -92,8 +92,7 @@ shared_ptr<device::Device> Connect::get_selected_device() const
                Qt::UserRole).value<void*>();
        assert(sdi);
 
-       std::map<const sr_dev_inst*, boost::shared_ptr<pv::device::Device> >::
-               const_iterator iter = _device_map.find(sdi);
+       const auto iter = _device_map.find(sdi);
        assert(iter != _device_map.end());
 
        return (*iter).second;
@@ -120,7 +119,7 @@ void Connect::populate_drivers()
                        hwopts = (const int32_t *)g_variant_get_fixed_array(gvar_opts,
                                        &num_opts, sizeof(int32_t));
                        for (unsigned int j = 0; j < num_opts; j++)
-                               if (hwopts[j] == SR_CONF_SAMPLERATE) {
+                               if ((hwopts[j] & SR_CONF_MASK) == SR_CONF_SAMPLERATE) {
                                        supported_device = true;
                                        break;
                                }
@@ -175,7 +174,7 @@ void Connect::scan_pressed()
 
        g_slist_free_full(drvopts, (GDestroyNotify)free_drvopts);
 
-       BOOST_FOREACH(shared_ptr<device::Device> dev_inst, devices)
+       for (shared_ptr<device::Device> dev_inst : devices)
        {
                assert(dev_inst);
                const sr_dev_inst *const sdi = dev_inst->dev_inst();
@@ -185,7 +184,7 @@ void Connect::scan_pressed()
                QString text = QString::fromUtf8(title.c_str());
 
                if (sdi->channels) {
-                       text += QString(" with %1 probes").arg(
+                       text += QString(" with %1 channels").arg(
                                g_slist_length(sdi->channels));
                }