aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2014-12-20 22:27:54 +0100
committerGerald Combs <gerald@wireshark.org>2014-12-21 04:13:40 +0000
commit81798009b97549ad0879d1c01a3b9c60ed726ed9 (patch)
tree4cdaea47b4e050b511fd160c523e5f344173770f
parent86d1b542350dd67c45824004d974f9fb30e0fbe3 (diff)
Qt: fix a crash when closing a file while capture file properties window is open
refresh_button_ and copy_comment_button_ are not used neither initialized, get rid of them Also clear text areas and disable buttons Change-Id: I418d712313041dcf4f15aceee01497f01ae74918 Reviewed-on: https://code.wireshark.org/review/5927 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
-rw-r--r--ui/qt/capture_file_properties_dialog.cpp16
-rw-r--r--ui/qt/capture_file_properties_dialog.h3
2 files changed, 14 insertions, 5 deletions
diff --git a/ui/qt/capture_file_properties_dialog.cpp b/ui/qt/capture_file_properties_dialog.cpp
index 47673ad548..96816e8f94 100644
--- a/ui/qt/capture_file_properties_dialog.cpp
+++ b/ui/qt/capture_file_properties_dialog.cpp
@@ -90,11 +90,23 @@ void CaptureFilePropertiesDialog::setCaptureFile(capture_file *cf)
void CaptureFilePropertiesDialog::updateWidgets()
{
+ QPushButton *refresh_bt = ui->buttonBox->button(QDialogButtonBox::Reset);
QPushButton *save_bt = ui->buttonBox->button(QDialogButtonBox::Save);
+ QPushButton *copy_bt = ui->buttonBox->button(QDialogButtonBox::Apply);
+
if (!cap_file_) {
- refresh_button_->setEnabled(false);
+ if (refresh_bt) {
+ refresh_bt->setEnabled(false);
+ }
+ ui->detailsTextEdit->clear();
+ ui->commentsTextEdit->clear();
ui->commentsTextEdit->setReadOnly(true);
- save_bt->setEnabled(false);
+ if (save_bt) {
+ save_bt->setEnabled(false);
+ }
+ if (copy_bt) {
+ copy_bt->setEnabled(false);
+ }
return;
}
diff --git a/ui/qt/capture_file_properties_dialog.h b/ui/qt/capture_file_properties_dialog.h
index c4df9f1316..27e6a4ff95 100644
--- a/ui/qt/capture_file_properties_dialog.h
+++ b/ui/qt/capture_file_properties_dialog.h
@@ -72,9 +72,6 @@ private:
Ui::SummaryDialog *ui;
capture_file *cap_file_;
- QPushButton *refresh_button_;
- QPushButton *copy_comment_button_;
-
QString timeToString(time_t ti_time);
QString summaryToHtml();