aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2014-10-02 09:28:28 -0700
committerGerald Combs <gerald@wireshark.org>2014-10-02 17:40:20 +0000
commitc0cdf9473a36e84632da6559898509f0c10e4bef (patch)
tree4f9724d8955629e16ca3525e078beae08165f95f
parentabfa0911f77558daebcccf309313b304b91c07c2 (diff)
Qt: Keep dialogs from blocking tests.
If WIRESHARK_QUIT_AFTER_CAPTURE is set, call exit(0). This keeps us from emitting the aboutToQuit signal and doing things that might pop up dialogs. Change-Id: I6e986b6e7ad824d8b5258e34a12c32869f5b2d34 Reviewed-on: https://code.wireshark.org/review/4421 Reviewed-by: Gerald Combs <gerald@wireshark.org>
-rw-r--r--ui/qt/main_window_slots.cpp18
-rw-r--r--ui/qt/wireshark_application.cpp3
2 files changed, 10 insertions, 11 deletions
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp
index b1951028aa..eeb20009b5 100644
--- a/ui/qt/main_window_slots.cpp
+++ b/ui/qt/main_window_slots.cpp
@@ -420,9 +420,9 @@ void MainWindow::captureCaptureUpdateFinished(capture_session *cap_session) {
setWindowIcon(wsApp->normalIcon());
if (global_capture_opts.quit_after_cap) {
- /* command line asked us to quit after the capture */
- /* don't pop up a dialog to ask for unsaved files etc. */
- wsApp->quit();
+ // Command line asked us to quit after capturing.
+ // Don't pop up a dialog to ask for unsaved files etc.
+ exit(0);
}
#endif // HAVE_LIBPCAP
}
@@ -445,9 +445,9 @@ void MainWindow::captureCaptureFixedFinished(capture_session *cap_session) {
setWindowIcon(wsApp->normalIcon());
if (global_capture_opts.quit_after_cap) {
- /* command line asked us to quit after the capture */
- /* don't pop up a dialog to ask for unsaved files etc. */
- wsApp->quit();
+ // Command line asked us to quit after capturing.
+ // Don't pop up a dialog to ask for unsaved files etc.
+ exit(0);
}
#endif // HAVE_LIBPCAP
}
@@ -471,9 +471,9 @@ void MainWindow::captureCaptureFailed(capture_session *cap_session) {
setWindowIcon(wsApp->normalIcon());
if (global_capture_opts.quit_after_cap) {
- /* command line asked us to quit after the capture */
- /* don't pop up a dialog to ask for unsaved files etc. */
- wsApp->quit();
+ // Command line asked us to quit after capturing.
+ // Don't pop up a dialog to ask for unsaved files etc.
+ exit(0);
}
#endif // HAVE_LIBPCAP
}
diff --git a/ui/qt/wireshark_application.cpp b/ui/qt/wireshark_application.cpp
index 189762f280..b13d563e17 100644
--- a/ui/qt/wireshark_application.cpp
+++ b/ui/qt/wireshark_application.cpp
@@ -533,8 +533,7 @@ void WiresharkApplication::clearRecentItems() {
void WiresharkApplication::cleanup()
{
software_update_cleanup();
- /* write user's recent file to disk
- * It is no problem to write this file, even if we do not quit */
+ // Write the user's recent file(s) to disk.
write_profile_recent();
write_recent();
}