diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-07-03 17:46:10 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-07-03 17:46:10 +0200 |
commit | d9f33bb09f3b13eab3839a660c0112d6033481a3 (patch) | |
tree | 5479311670ecc95f69d5f9cfeace8d4b51c85527 /src | |
parent | 262a43fc5dcc04731a8951ee44555f582f7e8106 (diff) | |
download | dabmux-d9f33bb09f3b13eab3839a660c0112d6033481a3.tar.gz dabmux-d9f33bb09f3b13eab3839a660c0112d6033481a3.tar.bz2 dabmux-d9f33bb09f3b13eab3839a660c0112d6033481a3.zip |
Allow empty component labels
Diffstat (limited to 'src')
-rw-r--r-- | src/ConfigParser.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ConfigParser.cpp b/src/ConfigParser.cpp index 8c5cbaa..443e26d 100644 --- a/src/ConfigParser.cpp +++ b/src/ConfigParser.cpp @@ -415,15 +415,17 @@ void parse_ptree(boost::property_tree::ptree& pt, component->type = component_type; int success = -5; - string componentlabel = pt_comp.get<string>("label"); + string componentlabel = pt_comp.get("label", ""); string componentshortlabel(componentlabel); try { componentshortlabel = pt_comp.get<string>("shortlabel"); success = component->label.setLabel(componentlabel, componentshortlabel); } catch (ptree_error &e) { - etiLog.level(warn) << "Component short label undefined, " - "truncating label " << componentlabel; + if (not componentlabel.empty()) { + etiLog.level(warn) << "Component short label undefined, " + "truncating label " << componentlabel; + } success = component->label.setLabel(componentlabel); } |