]> sigrok.org Git - pulseview.git/blobdiff - pv/devicemanager.cpp
main: introduce -D cmdline option, don't auto-scan for devices
[pulseview.git] / pv / devicemanager.cpp
index ccd3716a7509ff342827b9b8eaac30c4f3bcd403..5920486a9d6d8df54f7bb8dc8135bc38ff1620a8 100644 (file)
@@ -56,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("",
@@ -84,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)));