]> sigrok.org Git - pulseview.git/commitdiff
Fix #1549 by notifying user of wrong input parameter names
authorSoeren Apel <redacted>
Fri, 29 May 2020 19:24:34 +0000 (21:24 +0200)
committerSoeren Apel <redacted>
Fri, 29 May 2020 19:24:34 +0000 (21:24 +0200)
pv/session.cpp

index 9ec8bd07264036e85c052c05695749f4bccf797b..ea3fe07b4e312c8bece64035967edf4e6e5c692f 100644 (file)
@@ -621,8 +621,12 @@ Session::input_format_options(vector<string> user_spec,
                 * data type.
                 */
                auto found = fmt_opts.find(key);
-               if (found == fmt_opts.end())
+               if (found == fmt_opts.end()) {
+                       qCritical() << "Supplied input option" << QString::fromStdString(key) <<
+                               "is not a valid option for this input module, it will be ignored!";
                        continue;
+               }
+
                shared_ptr<Option> opt = found->second;
                result[key] = opt->parse_string(val);
        }
@@ -647,7 +651,7 @@ void Session::load_init_file(const string &file_name,
                                return f.first == user_name; });
                if (iter == formats.end()) {
                        MainWindow::show_session_error(tr("Error"),
-                               tr("Unexpected input format: %s").arg(QString::fromStdString(format)));
+                               tr("Unexpected input format: %1").arg(QString::fromStdString(format)));
                        return;
                }
                input_format = (*iter).second;