Update to new configuration API.
[pulseview.git] / pv / dialogs / connect.cpp
index 20836901b006a981cebb107d88054e51ef98a899..4d33cc9f3b6d1d2e1ebbc798147f53e307d80744 100644 (file)
@@ -106,10 +106,10 @@ void Connect::populate_drivers()
                 * @todo Add support for non-monotonic devices i.e. DMMs
                 * and sensors.
                 */
-               bool supported_device = driver->config_check(
-                       ConfigKey::LOGIC_ANALYZER, ConfigKey::DEVICE_OPTIONS) |
-                                       driver->config_check(
-                       ConfigKey::OSCILLOSCOPE, ConfigKey::DEVICE_OPTIONS);
+               const auto keys = driver->config_keys();
+
+               bool supported_device = keys.count(ConfigKey::LOGIC_ANALYZER) |
+                       keys.count(ConfigKey::OSCILLOSCOPE);
 
                if (supported_device)
                        drivers_.addItem(QString("%1 (%2)").arg(
@@ -172,12 +172,11 @@ void Connect::scan_pressed()
        const list< shared_ptr<HardwareDevice> > devices =
                device_manager_.driver_scan(driver, drvopts);
 
-       for (shared_ptr<HardwareDevice> device : devices)
-       {
+       for (shared_ptr<HardwareDevice> device : devices) {
                assert(device);
 
                QString text = QString::fromStdString(
-                       device_manager_.get_display_name(device));
+                       device->display_name(device_manager_));
                text += QString(" with %1 channels").arg(
                        device->device()->channels().size());
 
@@ -198,7 +197,7 @@ void Connect::device_selected(int index)
 
        unset_connection();
 
-       if (driver->config_check(ConfigKey::SERIALCOMM, ConfigKey::SCAN_OPTIONS))
+       if (driver->scan_options().count(ConfigKey::SERIALCOMM))
                set_serial_connection(driver);
 }