summaryrefslogtreecommitdiff
path: root/ui/qt/capture_filter_edit.cpp
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2016-01-01 18:00:19 +0100
committerStig Bjørlykke <stig@bjorlykke.org>2016-01-05 09:13:39 +0000
commitdfbea5d47c449670d6b4e989fec49b1cc680c497 (patch)
treebb328a05de160302f5d08023210fbc69dab77754 /ui/qt/capture_filter_edit.cpp
parent85fd9df235dcf77117b45ade4494c99e983595ec (diff)
downloadwireshark-dfbea5d47c449670d6b4e989fec49b1cc680c497.tar.gz
Qt: Don't check capture filter for user DLTs
This makes it possible to use a capture filter on an interface with user DLTs (147-162). Bug: 11656 Ping-Bug: 11668 Change-Id: Ie9931b27e8dc8ea239e7e04e26d0ae1cacba50c9 Reviewed-on: https://code.wireshark.org/review/12996 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'ui/qt/capture_filter_edit.cpp')
-rw-r--r--ui/qt/capture_filter_edit.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/ui/qt/capture_filter_edit.cpp b/ui/qt/capture_filter_edit.cpp
index 99b8fa8e48..7e7765e4e0 100644
--- a/ui/qt/capture_filter_edit.cpp
+++ b/ui/qt/capture_filter_edit.cpp
@@ -205,8 +205,8 @@ CaptureFilterEdit::CaptureFilterEdit(QWidget *parent, bool plain) :
connect(wsApp, SIGNAL(appInitialized()), this, SLOT(initCaptureFilter()));
connect(syntax_thread, SIGNAL(started()), syntax_worker_, SLOT(start()));
connect(syntax_thread, SIGNAL(started()), this, SLOT(checkFilter()));
- connect(syntax_worker_, SIGNAL(syntaxResult(QString,bool,QString)),
- this, SLOT(setFilterSyntaxState(QString,bool,QString)));
+ connect(syntax_worker_, SIGNAL(syntaxResult(QString,int,QString)),
+ this, SLOT(setFilterSyntaxState(QString,int,QString)));
connect(syntax_thread, SIGNAL(finished()), syntax_worker_, SLOT(deleteLater()));
syntax_thread->start();
@@ -286,7 +286,7 @@ void CaptureFilterEdit::checkFilter(const QString& text)
}
if (empty) {
- setFilterSyntaxState(text, true, QString());
+ setFilterSyntaxState(text, Empty, QString());
} else {
syntax_worker_->checkFilter(text);
}
@@ -304,13 +304,13 @@ void CaptureFilterEdit::initCaptureFilter()
#endif // HAVE_LIBPCAP
}
-void CaptureFilterEdit::setFilterSyntaxState(QString filter, bool valid, QString err_msg)
+void CaptureFilterEdit::setFilterSyntaxState(QString filter, int state, QString err_msg)
{
+ bool valid = (state != Invalid);
+
if (filter.compare(text()) == 0) { // The user hasn't changed the filter
- if (valid) {
- setSyntaxState(text().isEmpty() ? Empty : Valid);
- } else {
- setSyntaxState(Invalid);
+ setSyntaxState((SyntaxState)state);
+ if (!valid) {
emit pushFilterSyntaxStatus(err_msg);
}
}