Qt: Fix no interface load preference handling

In handling the capture preferences frame, the preference to not load
interfaces on startup is handled incorrectly. Instead of using the
preference value itself, the validity of the pointer to the preference is
used. This leads to some confusing logic.
Replacing this code with proper preference retrieval.
This was introduced with commit 7a07832712

CID 1439697

Change-Id: I9bf3df413d89f8df55553a7218f34d425eb103de
Reviewed-on: https://code.wireshark.org/review/33187
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
This commit is contained in:
Jaap Keuter 2019-05-13 22:51:10 +02:00 committed by Peter Wu
parent 1573d4ddb2
commit 757ada0e24
1 changed files with 2 additions and 1 deletions

View File

@ -69,7 +69,8 @@ void CapturePreferencesFrame::updateWidgets()
default_device_string = prefs_get_string_value(pref_device_, pref_stashed);
}
ui->defaultInterfaceComboBox->clear();
if (global_capture_opts.all_ifaces->len == 0 && !pref_no_interface_load_) {
if ((global_capture_opts.all_ifaces->len == 0) &&
(prefs_get_bool_value(pref_no_interface_load_, pref_stashed) == FALSE)) {
/*
* No interfaces - try refreshing the local interfaces, to
* see whether any have showed up (or privileges have changed