aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/extcap_options_dialog.cpp
diff options
context:
space:
mode:
authorMikael Kanstrup <mikael.kanstrup@gmail.com>2016-02-03 12:14:15 +0100
committerRoland Knall <rknall@gmail.com>2016-02-11 06:40:16 +0000
commit7a1eca1726609fcc75594c688756621c3329a509 (patch)
treeb4ba0bf5c915a8eeb12fa764009312ef78a8852d /ui/qt/extcap_options_dialog.cpp
parentfa56b68f4fc9b25eba4993a34eaa5807d9182d37 (diff)
extcap: Convert settings to preference friendly key names
Preferences are only allowed to contain lowercase ASCII letters, numbers, underscores or dot characters. Create a utility function to convert an extcap setting to its equivalent preference key and use it wherever conversion from setting to preference key is needed. Bug: 12064 Change-Id: I39bbac7de5f0f905bd41c54257fa997a3b32442d Reviewed-on: https://code.wireshark.org/review/13687 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'ui/qt/extcap_options_dialog.cpp')
-rw-r--r--ui/qt/extcap_options_dialog.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/ui/qt/extcap_options_dialog.cpp b/ui/qt/extcap_options_dialog.cpp
index ed7a0150e4..07c0523628 100644
--- a/ui/qt/extcap_options_dialog.cpp
+++ b/ui/qt/extcap_options_dialog.cpp
@@ -373,16 +373,15 @@ void ExtcapOptionsDialog::storeValues()
else
value = (*iter)->prefValue();
- QString prefKey = QString("%1.%2").arg(device_name).arg(argument->prefKey());
- if ( prefKey.length() > 0 )
+ QString key = argument->prefKey(device_name);
+ if (key.length() > 0)
{
- gchar * key = g_strdup(prefKey.toStdString().c_str());
gchar * val = g_strdup(value.length() == 0 ? " " : value.toStdString().c_str());
/* Setting the internally stored value for the preference to the new value */
(*iter)->argument()->storeval = g_strdup(val);
- g_hash_table_insert(entries, key, val);
+ g_hash_table_insert(entries, g_strdup(key.toStdString().c_str()), val);
}
}