summaryrefslogtreecommitdiff
path: root/ui/qt/wireshark_application.cpp
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2015-12-10 14:03:27 +0100
committerStig Bjørlykke <stig@bjorlykke.org>2015-12-10 14:08:58 +0000
commitbfcd1e65141c7929e447132fcb26f4044276ec20 (patch)
treeebad6261b7155f93e84ac0ccd4e4c8541e86b5cd /ui/qt/wireshark_application.cpp
parent5062fe0a88a246cc1202fa991e3f37a7733a8371 (diff)
downloadwireshark-bfcd1e65141c7929e447132fcb26f4044276ec20.tar.gz
Qt: Reset preferences when reloading Lua plugins
Reading configuration files may duplicate some entries, so ensure we reset preferences before reloading. Change-Id: I746414cbc10c206ddf47669856f329b9e0202a0d Reviewed-on: https://code.wireshark.org/review/12496 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'ui/qt/wireshark_application.cpp')
-rw-r--r--ui/qt/wireshark_application.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/ui/qt/wireshark_application.cpp b/ui/qt/wireshark_application.cpp
index d7a3671331..1d0701f5b9 100644
--- a/ui/qt/wireshark_application.cpp
+++ b/ui/qt/wireshark_application.cpp
@@ -349,11 +349,8 @@ void WiresharkApplication::setConfigurationProfile(const gchar *profile_name)
set_profile_name (profile_name);
emit profileNameChanged(profile_name);
- /* Reset current preferences and apply the new */
- prefs_reset();
-// menu_prefs_reset();
-
- (void) readConfigurationFiles (&gdp_path, &dp_path);
+ /* Apply new preferences */
+ readConfigurationFiles (&gdp_path, &dp_path, true);
if (!recent_read_profile_static(&rf_path, &rf_open_errno)) {
simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
@@ -880,7 +877,7 @@ void WiresharkApplication::allSystemsGo()
#endif
}
-_e_prefs *WiresharkApplication::readConfigurationFiles(char **gdp_path, char **dp_path)
+_e_prefs *WiresharkApplication::readConfigurationFiles(char **gdp_path, char **dp_path, bool reset)
{
int gpf_open_errno, gpf_read_errno;
int cf_open_errno, df_open_errno;
@@ -891,6 +888,11 @@ _e_prefs *WiresharkApplication::readConfigurationFiles(char **gdp_path, char **d
int pf_open_errno, pf_read_errno;
e_prefs *prefs_p;
+ if (reset) {
+ // reset preferences before reading
+ prefs_reset();
+ }
+
/* load the decode as entries of this profile */
load_decode_as_entries();