X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fdialogs%2Fconnect.cpp;h=d554b4c181fefc9b12f56ee214e5acc839777766;hb=9ab0d1f7b53d4e10f6ee7abd0b02816eafac5f99;hp=11cf0e7b5de3e211643d62d6697ec9b6b80f1c10;hpb=19adbc2c342b190161ec1223377a3619974b91f7;p=pulseview.git diff --git a/pv/dialogs/connect.cpp b/pv/dialogs/connect.cpp index 11cf0e7b..d554b4c1 100644 --- a/pv/dialogs/connect.cpp +++ b/pv/dialogs/connect.cpp @@ -18,14 +18,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include "connect.h" #include "pv/devicemanager.h" -#include "pv/devinst.h" +#include "pv/device/device.h" extern "C" { /* __STDC_FORMAT_MACROS is required for PRIu64 and friends (in C++). */ @@ -34,8 +34,8 @@ extern "C" { #include } -using boost::shared_ptr; using std::list; +using std::shared_ptr; using std::string; extern sr_context *sr_ctx; @@ -82,18 +82,17 @@ Connect::Connect(QWidget *parent, pv::DeviceManager &device_manager) : _layout.addWidget(&_button_box); } -shared_ptr Connect::get_selected_device() const +shared_ptr Connect::get_selected_device() const { const QListWidgetItem *const item = _device_list.currentItem(); if (!item) - return shared_ptr(); + return shared_ptr(); const sr_dev_inst *const sdi = (sr_dev_inst*)item->data( Qt::UserRole).value(); assert(sdi); - std::map >:: - const_iterator iter = _device_map.find(sdi); + const auto iter = _device_map.find(sdi); assert(iter != _device_map.end()); return (*iter).second; @@ -170,12 +169,12 @@ void Connect::scan_pressed() drvopts = g_slist_append(drvopts, src); } - const list< shared_ptr > devices = _device_manager.driver_scan( - driver, drvopts); + const list< shared_ptr > devices = + _device_manager.driver_scan(driver, drvopts); g_slist_free_full(drvopts, (GDestroyNotify)free_drvopts); - BOOST_FOREACH(shared_ptr dev_inst, devices) + for (shared_ptr dev_inst : devices) { assert(dev_inst); const sr_dev_inst *const sdi = dev_inst->dev_inst(); @@ -184,9 +183,9 @@ void Connect::scan_pressed() const string title = dev_inst->format_device_title(); QString text = QString::fromUtf8(title.c_str()); - if (sdi->probes) { - text += QString(" with %1 probes").arg( - g_slist_length(sdi->probes)); + if (sdi->channels) { + text += QString(" with %1 channels").arg( + g_slist_length(sdi->channels)); } QListWidgetItem *const item = new QListWidgetItem(text,