From: Soeren Apel Date: Tue, 4 Aug 2020 07:30:29 +0000 (+0200) Subject: Device binding: Notify user when a config option is ignored X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=fe1e6ad6ae644edd29ab226573e40561c9974694;p=pulseview.git Device binding: Notify user when a config option is ignored --- diff --git a/pv/binding/device.cpp b/pv/binding/device.cpp index 084d4651..96217051 100644 --- a/pv/binding/device.cpp +++ b/pv/binding/device.cpp @@ -61,10 +61,6 @@ Device::Device(shared_ptr configurable) : auto capabilities = configurable->config_capabilities(key); - if (!capabilities.count(Capability::GET) || - !capabilities.count(Capability::SET)) - continue; - string name_str; try { name_str = key->description(); @@ -74,6 +70,13 @@ Device::Device(shared_ptr configurable) : const QString name = QString::fromStdString(name_str); + if (!capabilities.count(Capability::GET) || + !capabilities.count(Capability::SET)) { + qDebug() << QString(tr("Note for device developers: Ignoring device configuration capability '%1' " \ + "as it is missing GET and/or SET")).arg(name); + continue; + } + const Property::Getter get = [&, key]() { return configurable_->config_get(key); }; const Property::Setter set = [&, key](Glib::VariantBase value) {