aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2017-08-30 15:24:49 +0200
committerAnders Broman <a.broman58@gmail.com>2017-08-31 04:34:39 +0000
commitc199952f5c66c61d908c5052de9172fe11a3f260 (patch)
tree6daea82e74661f672aa5af035e2ce65c27afe2d9 /ui
parent51789050633fc4554413a6f79439c9162c1c8cfb (diff)
extcap: fix parameters save in preferences file
Since g583150198b, extcap_arg structures holds a pointer to the current preference value. So let's not update its value outside of the prefs API otherwise the call to prefs_set_string_value() with pref_current done afterwards will never notify the change and the updated value will not be written in the preference file. Moreover update ExtcapArgument::resetValue() method to have an empty string instead of a NULL pointer. Otherwise prefs_set_string_value() will not notify the change and save the restored default value in the preference file either. Change-Id: Ie70e79d471c75e25705c7654e420a7706ebc4032 Reviewed-on: https://code.wireshark.org/review/23308 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/extcap_argument.cpp4
-rw-r--r--ui/qt/extcap_options_dialog.cpp3
2 files changed, 1 insertions, 6 deletions
diff --git a/ui/qt/extcap_argument.cpp b/ui/qt/extcap_argument.cpp
index 6a74cc7e07..3e21a36fba 100644
--- a/ui/qt/extcap_argument.cpp
+++ b/ui/qt/extcap_argument.cpp
@@ -662,11 +662,9 @@ QString ExtcapArgument::prefValue()
void ExtcapArgument::resetValue()
{
- // XXX consider using the preferences API which can store the default value
- // and put that here instead of an empty value.
if (_argument->pref_valptr) {
g_free(*_argument->pref_valptr);
- *_argument->pref_valptr = NULL;
+ *_argument->pref_valptr = g_strdup("");
}
}
diff --git a/ui/qt/extcap_options_dialog.cpp b/ui/qt/extcap_options_dialog.cpp
index c70f5531bb..946007df58 100644
--- a/ui/qt/extcap_options_dialog.cpp
+++ b/ui/qt/extcap_options_dialog.cpp
@@ -494,9 +494,6 @@ void ExtcapOptionsDialog::storeValues()
{
gchar * val = g_strdup(value.length() == 0 ? " " : value.toStdString().c_str());
- /* Setting the internally stored value for the preference to the new value */
- extcap_pref_store((*iter)->argument(), val);
-
g_hash_table_insert(entries, g_strdup(key.toStdString().c_str()), val);
}
}