projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
DecodeSignal: Use name of last stacked PD unless the name was changed
[pulseview.git]
/
pv
/
data
/
decode
/
decoder.cpp
diff --git
a/pv/data/decode/decoder.cpp
b/pv/data/decode/decoder.cpp
index c6995bcf703a56cb13b4ba347acb2c61aa11d17e..f86c5d08dc86d9261718ab92e2005b1b30dbd914 100644
(file)
--- a/
pv/data/decode/decoder.cpp
+++ b/
pv/data/decode/decoder.cpp
@@
-87,12
+87,21
@@
void Decoder::set_option(const char *id, GVariant *value)
options_[id] = value;
// If we have a decoder instance, apply option value immediately
options_[id] = value;
// If we have a decoder instance, apply option value immediately
+ apply_all_options();
+}
+
+void Decoder::apply_all_options()
+{
if (decoder_inst_) {
GHashTable *const opt_hash = g_hash_table_new_full(g_str_hash,
g_str_equal, g_free, (GDestroyNotify)g_variant_unref);
if (decoder_inst_) {
GHashTable *const opt_hash = g_hash_table_new_full(g_str_hash,
g_str_equal, g_free, (GDestroyNotify)g_variant_unref);
- g_variant_ref(value);
- g_hash_table_insert(opt_hash, (void*)g_strdup(id), value);
+ for (const auto& option : options_) {
+ GVariant *const value = option.second;
+ g_variant_ref(value);
+ g_hash_table_replace(opt_hash, (void*)g_strdup(
+ option.first.c_str()), value);
+ }
srd_inst_option_set(decoder_inst_, opt_hash);
g_hash_table_destroy(opt_hash);
srd_inst_option_set(decoder_inst_, opt_hash);
g_hash_table_destroy(opt_hash);