projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c2db8ec
)
SamplingBar: Handle a failure to list the LIMIT_SAMPLES key
author
Joel Holdsworth
<joel@airwebreathe.org.uk>
Mon, 5 Jan 2015 20:11:12 +0000
(20:11 +0000)
committer
Joel Holdsworth
<joel@airwebreathe.org.uk>
Mon, 5 Jan 2015 20:13:54 +0000
(20:13 +0000)
pv/toolbars/samplingbar.cpp
patch
|
blob
|
history
diff --git
a/pv/toolbars/samplingbar.cpp
b/pv/toolbars/samplingbar.cpp
index 8c1b3c6d17691a42a1ee4dd80cbbf7d23ae106b4..710f3128af727cf4ef51ce90178d6efaa94f3ab6 100644
(file)
--- a/
pv/toolbars/samplingbar.cpp
+++ b/
pv/toolbars/samplingbar.cpp
@@
-293,9
+293,16
@@
void SamplingBar::update_sample_count_selector()
const auto iter = keys.find(ConfigKey::LIMIT_SAMPLES);
if (iter != keys.end() &&
(*iter).second.find(sigrok::LIST) != (*iter).second.end()) {
const auto iter = keys.find(ConfigKey::LIMIT_SAMPLES);
if (iter != keys.end() &&
(*iter).second.find(sigrok::LIST) != (*iter).second.end()) {
- auto gvar = device->config_list(ConfigKey::LIMIT_SAMPLES);
- g_variant_get(gvar.gobj(), "(tt)",
- &min_sample_count, &max_sample_count);
+ try {
+ auto gvar =
+ device->config_list(ConfigKey::LIMIT_SAMPLES);
+ if (gvar)
+ g_variant_get(gvar.gobj(), "(tt)",
+ &min_sample_count, &max_sample_count);
+ } catch(const sigrok::Error &e) {
+ // Failed to query sample limit
+ (void)e;
+ }
}
min_sample_count = min(max(min_sample_count, MinSampleCount),
}
min_sample_count = min(max(min_sample_count, MinSampleCount),