]> sigrok.org Git - pulseview.git/blobdiff - pv/devicemanager.cpp
Really fix #1125 (and maybe #1139)
[pulseview.git] / pv / devicemanager.cpp
index 35efa12786bb524003bbdbe0ff4eecf54d59927e..5920486a9d6d8df54f7bb8dc8135bc38ff1620a8 100644 (file)
@@ -48,8 +48,6 @@ using std::string;
 using std::unique_ptr;
 using std::vector;
 
-using Glib::ustring;
-using Glib::Variant;
 using Glib::VariantBase;
 
 using sigrok::ConfigKey;
@@ -58,7 +56,8 @@ using sigrok::Driver;
 
 namespace pv {
 
-DeviceManager::DeviceManager(shared_ptr<Context> context, std::string driver) :
+DeviceManager::DeviceManager(shared_ptr<Context> context,
+       std::string driver, bool do_scan) :
        context_(context)
 {
        unique_ptr<QProgressDialog> progress(new QProgressDialog("",
@@ -86,6 +85,8 @@ DeviceManager::DeviceManager(shared_ptr<Context> context, std::string driver) :
         * best effort auto detection.
         */
        for (auto entry : context->drivers()) {
+               if (!do_scan)
+                       break;
                progress->setLabelText(QObject::tr("Scanning for %1...")
                        .arg(QString::fromStdString(entry.first)));