]> sigrok.org Git - pulseview.git/commitdiff
Application: Do not show unsupported device drivers in version info
authorSoeren Apel <redacted>
Tue, 21 Dec 2021 21:09:51 +0000 (22:09 +0100)
committerSoeren Apel <redacted>
Tue, 21 Dec 2021 21:09:51 +0000 (22:09 +0100)
main.cpp
pv/application.cpp
pv/application.hpp

index d3c52adb15ebee8c03dbe52bf20c871d7d330440..0867187c57b23815dc6bb0de32efbe16001233cf 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -332,7 +332,7 @@ int main(int argc, char *argv[])
                // Create the device manager, initialise the drivers
                pv::DeviceManager device_manager(context, driver, do_scan);
 
-               a.collect_version_info(context);
+               a.collect_version_info(device_manager);
                if (show_version) {
                        a.print_version_info();
                } else {
index a34a6ca758350671e37a3d8a92ddf195e1e52ede..15195d067da801e594ce573ccf756a79200d4986 100644 (file)
@@ -143,7 +143,7 @@ void Application::on_setting_changed(const QString &key, const QVariant &value)
                switch_language(value.toString());
 }
 
-void Application::collect_version_info(shared_ptr<sigrok::Context> context)
+void Application::collect_version_info(pv::DeviceManager &device_manager)
 {
        // Library versions and features
        version_info_.emplace_back(applicationName(), applicationVersion());
@@ -211,17 +211,18 @@ void Application::collect_version_info(shared_ptr<sigrok::Context> context)
 #endif
 
        // Device drivers
-       for (auto& entry : context->drivers())
-               driver_list_.emplace_back(QString::fromUtf8(entry.first.c_str()),
-                       QString::fromUtf8(entry.second->long_name().c_str()));
+       for (auto& entry : device_manager.context()->drivers())
+               if (device_manager.driver_supported(entry.second))
+                       driver_list_.emplace_back(QString::fromUtf8(entry.first.c_str()),
+                               QString::fromUtf8(entry.second->long_name().c_str()));
 
        // Input formats
-       for (auto& entry : context->input_formats())
+       for (auto& entry : device_manager.context()->input_formats())
                input_format_list_.emplace_back(QString::fromUtf8(entry.first.c_str()),
                        QString::fromUtf8(entry.second->description().c_str()));
 
        // Output formats
-       for (auto& entry : context->output_formats())
+       for (auto& entry : device_manager.context()->output_formats())
                output_format_list_.emplace_back(QString::fromUtf8(entry.first.c_str()),
                        QString::fromUtf8(entry.second->description().c_str()));
 
index 75ddbc0603a5b62936caa028def364dd85b38fa7..bfe4657009ae82407e139261914eb22ff461d2c9 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <libsigrokcxx/libsigrokcxx.hpp>
 
+#include "devicemanager.hpp"
 #include "globalsettings.hpp"
 
 using std::shared_ptr;
@@ -47,7 +48,7 @@ public:
 
        void on_setting_changed(const QString &key, const QVariant &value);
 
-       void collect_version_info(shared_ptr<sigrok::Context> context);
+       void collect_version_info(pv::DeviceManager &device_manager);
        void print_version_info();
 
        vector< pair<QString, QString> > get_version_info() const;