aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2021-11-06 17:14:20 -0700
committerGerald Combs <gerald@wireshark.org>2021-11-08 22:20:24 +0000
commite5eb17d41450e760b97e46fc223ac1b6ead0fd27 (patch)
tree8294cd201f18627bc8b0fd22bf18bae09d410c90 /ui
parent846b17ee9a5398d94da4aa465f8d5f462914b6c6 (diff)
UAT: Allow missing fields.
Add uat_set_default_values, which lets us provide default values for fields that might be missing from the end of a UAT line. Set a default value for the I/O Graph dialog's Y Axis Factor. Fixes the backward compatibility issue described in #17623
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/io_graph_dialog.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/qt/io_graph_dialog.cpp b/ui/qt/io_graph_dialog.cpp
index 97450a04fc..e64b37ce6e 100644
--- a/ui/qt/io_graph_dialog.cpp
+++ b/ui/qt/io_graph_dialog.cpp
@@ -130,6 +130,11 @@ static io_graph_settings_t *iog_settings_ = NULL;
static guint num_io_graphs_ = 0;
static uat_t *iog_uat_ = NULL;
+// y_axis_factor was added in 3.6. Provide backward compatibility.
+static const char *iog_uat_defaults_[] = {
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "1"
+};
+
extern "C" {
//Allow the enable/disable field to be a checkbox, but for backwards compatibility,
@@ -1202,6 +1207,8 @@ void IOGraphDialog::loadProfileGraphs()
NULL,
io_graph_fields);
+ uat_set_default_values(iog_uat_, iog_uat_defaults_);
+
char* err = NULL;
if (!uat_load(iog_uat_, NULL, &err)) {
report_failure("Error while loading %s: %s. Default graph values will be used", iog_uat_->name, err);