diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2015-12-02 22:15:28 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-12-03 04:54:50 +0000 |
commit | 6b7da34b4b8b6f5e6a0c7ee3bf4d2f3ec2af4333 (patch) | |
tree | 842007eeea989651ee12609accee0c9a4a73c26f | |
parent | ea447aad1fb26e50e790c9370f2e90c8b5d2e3d9 (diff) |
Qt: Check display filter when changing profile
The Display Filter Macros may have changed and if a macro is currently
used in the display filter then cf_redissect_packets() will bail
out in an assert if trying to apply an invalid filter.
Change-Id: I842016360672d76d190454ce80ccc7604f2075b3
Reviewed-on: https://code.wireshark.org/review/12388
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | ui/qt/main_window.cpp | 2 | ||||
-rw-r--r-- | ui/qt/main_window.h | 1 | ||||
-rw-r--r-- | ui/qt/main_window_slots.cpp | 13 | ||||
-rw-r--r-- | ui/qt/wireshark_application.cpp | 2 | ||||
-rw-r--r-- | ui/qt/wireshark_application.h | 1 |
5 files changed, 14 insertions, 5 deletions
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp index 310f419923..9100ce7e4b 100644 --- a/ui/qt/main_window.cpp +++ b/ui/qt/main_window.cpp @@ -465,6 +465,8 @@ MainWindow::MainWindow(QWidget *parent) : this, SLOT(filterExpressionsChanged())); connect(wsApp, SIGNAL(filterExpressionsChanged()), this, SLOT(filterExpressionsChanged())); + connect(wsApp, SIGNAL(checkDisplayFilter()), + this, SLOT(checkDisplayFilter())); connect(wsApp, SIGNAL(fieldsChanged()), this, SLOT(fieldsChanged())); diff --git a/ui/qt/main_window.h b/ui/qt/main_window.h index abafcfe1f7..a6afdf560e 100644 --- a/ui/qt/main_window.h +++ b/ui/qt/main_window.h @@ -278,6 +278,7 @@ private slots: void interfaceSelectionChanged(); void captureFilterSyntaxChanged(bool valid); void redissectPackets(); + void checkDisplayFilter(); void fieldsChanged(); void showAccordionFrame(AccordionFrame *show_frame, bool toggle = false); void showColumnEditor(int column); diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index 86ba833bd6..c4992ab5c0 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -1345,15 +1345,20 @@ void MainWindow::redissectPackets() proto_free_deregistered_fields(); } -void MainWindow::fieldsChanged() +void MainWindow::checkDisplayFilter() { - color_filters_reload(); - tap_listeners_dfilter_recompile(); - if (!df_combo_box_->checkDisplayFilter()) { g_free(CaptureFile::globalCapFile()->dfilter); CaptureFile::globalCapFile()->dfilter = NULL; } +} + +void MainWindow::fieldsChanged() +{ + color_filters_reload(); + tap_listeners_dfilter_recompile(); + + emit checkDisplayFilter(); if (have_custom_cols(&CaptureFile::globalCapFile()->cinfo)) { // Recreate packet list columns according to new/changed/deleted fields diff --git a/ui/qt/wireshark_application.cpp b/ui/qt/wireshark_application.cpp index e986e0416a..46c0ce4a5c 100644 --- a/ui/qt/wireshark_application.cpp +++ b/ui/qt/wireshark_application.cpp @@ -380,7 +380,7 @@ void WiresharkApplication::setConfigurationProfile(const gchar *profile_name) emit preferencesChanged(); emit recentFilesRead(); emit filterExpressionsChanged(); -// macros_post_update(); + emit checkDisplayFilter(); /* Enable all protocols and disable from the disabled list */ proto_enable_all(); diff --git a/ui/qt/wireshark_application.h b/ui/qt/wireshark_application.h index dc1ba99f40..d236b97ea0 100644 --- a/ui/qt/wireshark_application.h +++ b/ui/qt/wireshark_application.h @@ -149,6 +149,7 @@ signals: void packetDissectionChanged(); void preferencesChanged(); void addressResolutionChanged(); + void checkDisplayFilter(); void fieldsChanged(); void openStatCommandDialog(const QString &menu_path, const char *arg, void *userdata); |