diff options
author | Gerald Combs <gerald@zing.org> | 2015-10-03 09:45:16 -0700 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-10-05 02:58:28 +0000 |
commit | 2496aed28eecc3466f8de49f67393b0798c664fb (patch) | |
tree | 7b805c2df25b8e78a2c5dc9d35665398b5ccda40 | |
parent | 05e037565902fd3043f3f475da0c7b5265d09425 (diff) |
Qt: Don't update the recent list while capturing.
If a recent file is on a network share we'll create traffic which can
show up in the capture.
This doesn't fix the issue entirely, e.g. if you're capturing in one
instance of Wireshark and have another one open. The proper fix in that
case is to switch to QFileSystemWatcher as described at the top of
::WiresharkApplication.
Ping-Bug: 11546
Change-Id: If21f1bb213fe1d862c09b1b2edd78c8baf983461
Reviewed-on: https://code.wireshark.org/review/10774
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
-rw-r--r-- | ui/qt/main_window.cpp | 9 | ||||
-rw-r--r-- | ui/qt/wireshark_application.cpp | 6 | ||||
-rw-r--r-- | ui/qt/wireshark_application.h | 3 |
3 files changed, 17 insertions, 1 deletions
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp index ef59ae124a..b053c0c1cf 100644 --- a/ui/qt/main_window.cpp +++ b/ui/qt/main_window.cpp @@ -396,6 +396,15 @@ MainWindow::MainWindow(QWidget *parent) : connect(&capture_file_, SIGNAL(captureCaptureUpdateContinue(capture_session*)), main_ui_->statusBar, SLOT(updateCaptureStatistics(capture_session*))); + connect(&capture_file_, SIGNAL(captureCaptureUpdateStarted(capture_session *)), + wsApp, SLOT(captureStarted())); + connect(&capture_file_, SIGNAL(captureCaptureUpdateFinished(capture_session *)), + wsApp, SLOT(captureFinished())); + connect(&capture_file_, SIGNAL(captureCaptureFixedStarted(capture_session *)), + wsApp, SLOT(captureStarted())); + connect(&capture_file_, SIGNAL(captureCaptureFixedFinished(capture_session *)), + wsApp, SLOT(captureFinished())); + connect(&capture_file_, SIGNAL(captureFileOpened()), this, SLOT(captureFileOpened())); connect(&capture_file_, SIGNAL(captureFileReadStarted()), diff --git a/ui/qt/wireshark_application.cpp b/ui/qt/wireshark_application.cpp index 3d5f983d7f..3607ced737 100644 --- a/ui/qt/wireshark_application.cpp +++ b/ui/qt/wireshark_application.cpp @@ -188,6 +188,9 @@ void WiresharkApplication::refreshRecentFiles(void) { recent_item_status *ri; RecentFileStatus *rf_status; + // We're in the middle of a capture. Don't create traffic. + if (active_captures_ > 0) return; + foreach (ri, recent_items_) { if (ri->in_thread) { continue; @@ -478,7 +481,8 @@ void WiresharkApplication::itemStatusFinished(const QString filename, qint64 siz WiresharkApplication::WiresharkApplication(int &argc, char **argv) : QApplication(argc, argv), initialized_(false), - is_reloading_lua_(false) + is_reloading_lua_(false), + active_captures_(0) { wsApp = this; setApplicationName("Wireshark"); diff --git a/ui/qt/wireshark_application.h b/ui/qt/wireshark_application.h index 807fb84a80..dc1ba99f40 100644 --- a/ui/qt/wireshark_application.h +++ b/ui/qt/wireshark_application.h @@ -129,6 +129,7 @@ private: QIcon capture_icon_; static QString window_title_separator_; QList<AppSignal> app_signals_; + int active_captures_; protected: bool event(QEvent *event); @@ -156,6 +157,8 @@ signals: public slots: void clearRecentItems(); void captureFileReadStarted(); + void captureStarted() { active_captures_++; } + void captureFinished() { active_captures_--; } void updateTaps(); private slots: |