aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/capture_filter_edit.cpp
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2013-08-31 16:53:24 +0000
committerGerald Combs <gerald@wireshark.org>2013-08-31 16:53:24 +0000
commit74b205bc84bd77d94be8f5cade866298f493fb0b (patch)
treedef6c1f8eb52158e2582bcd3a3f773d8ef30ce0a /ui/qt/capture_filter_edit.cpp
parentf875bf8de248af06336d7ceb6ddbcf9a8bdbbca9 (diff)
Set our connection capture filter in main() similar to the GTK+ version.
svn path=/trunk/; revision=51621
Diffstat (limited to 'ui/qt/capture_filter_edit.cpp')
-rw-r--r--ui/qt/capture_filter_edit.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/ui/qt/capture_filter_edit.cpp b/ui/qt/capture_filter_edit.cpp
index 2f1973434a..338fc3b06a 100644
--- a/ui/qt/capture_filter_edit.cpp
+++ b/ui/qt/capture_filter_edit.cpp
@@ -31,6 +31,7 @@
#include "ui/capture_globals.h"
#include "capture_filter_edit.h"
+#include "wireshark_application.h"
#include <QPainter>
#include <QStyleOptionFrame>
@@ -197,14 +198,13 @@ CaptureFilterEdit::CaptureFilterEdit(QWidget *parent, bool plain) :
QThread *syntax_thread = new QThread;
syntax_worker_ = new CaptureFilterSyntaxWorker;
syntax_worker_->moveToThread(syntax_thread);
+ 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_thread, SIGNAL(finished()), syntax_worker_, SLOT(deleteLater()));
syntax_thread->start();
-
- setText(global_capture_opts.default_options.cfilter);
}
void CaptureFilterEdit::paintEvent(QPaintEvent *evt) {
@@ -279,6 +279,11 @@ void CaptureFilterEdit::checkFilter()
checkFilter(text());
}
+void CaptureFilterEdit::initCaptureFilter()
+{
+ setText(global_capture_opts.default_options.cfilter);
+}
+
void CaptureFilterEdit::setFilterSyntaxState(QString filter, bool valid, QString err_msg)
{
if (filter.compare(text()) == 0) { // The user hasn't changed the filter