X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=ba232e25d0cb5afae12d5bb3f80a09f6b2fe3714;hp=0397c7f4a6076de6782f364be497ae8f462ad560;hb=6e3f046e779b939efebdfa4d9e68fe28d9beee59;hpb=82c7f64018db2a90f44704e55ba469151522762f diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 0397c7f4..ba232e25 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -305,7 +305,8 @@ void MainWindow::setup_add_decoders(QMenu *parent) { GSList *l = g_slist_sort(g_slist_copy( (GSList*)srd_decoder_list()), decoder_name_cmp); - while ((l = l->next)) { + for(; l; l = l->next) + { QAction *const action = parent->addAction(QString( ((srd_decoder*)l->data)->name)); action->setData(qVariantFromValue(l->data)); @@ -391,11 +392,16 @@ void MainWindow::add_decoder(QObject *action) const std::vector< boost::shared_ptr > &sigs = _session.get_signals(); - dialogs::Decoder dlg(this, dec, sigs); - if(dlg.exec() != QDialog::Accepted) + GHashTable *const options = g_hash_table_new_full(g_str_hash, + g_str_equal, g_free, (GDestroyNotify)g_variant_unref); + + dialogs::Decoder dlg(this, dec, sigs, options); + if(dlg.exec() != QDialog::Accepted) { + g_hash_table_destroy(options); return; + } - _session.add_decoder(dec); + _session.add_decoder(dec, dlg.get_probes(), options); } void MainWindow::run_stop()