aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/bluetooth_hci_summary_dialog.cpp
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-12-31 19:36:12 -0800
committerGuy Harris <guy@alum.mit.edu>2019-01-01 05:03:42 +0000
commit2d41b15495e245d9292ba42dd3954bdebc9f3290 (patch)
tree40282b7aab9f1347489126dd98974a681dca888f /ui/qt/bluetooth_hci_summary_dialog.cpp
parentba589a4e445a8ad8054073eff846087fc61c9ef8 (diff)
Add a "failed" return for tap packet routines.
This allows taps that can fail to report an error and fail; a failed tap's packet routine won't be called again, so they don't have to keep track of whether they've failed themselves. We make the return value from the packet routine an enum. Don't have a separate type for the per-packet routine for "follow" taps; they're expected to act like tap packet routines, so just use the type for tap packet routines. One tap packet routine returned -1; that's not a valid return value, and wasn't one before this change (the return value was a boolean), so presume the intent was "don't redraw". Another tap routine's early return, without doing any work, returned TRUE; this is presumably an error (no work done, no need to redraw), so presumably it should be "don't redraw". Clean up some white space while we're at it. Change-Id: Ia7d2b717b2cace4b13c2b886e699aa4d79cc82c8 Reviewed-on: https://code.wireshark.org/review/31283 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/qt/bluetooth_hci_summary_dialog.cpp')
-rw-r--r--ui/qt/bluetooth_hci_summary_dialog.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/ui/qt/bluetooth_hci_summary_dialog.cpp b/ui/qt/bluetooth_hci_summary_dialog.cpp
index 19b82f0542..044a6beb7d 100644
--- a/ui/qt/bluetooth_hci_summary_dialog.cpp
+++ b/ui/qt/bluetooth_hci_summary_dialog.cpp
@@ -44,7 +44,7 @@ static const int column_number_reason = 7;
static const int column_number_hardware_error = 8;
static const int column_number_occurrence = 9;
-static gboolean
+static tap_packet_status
bluetooth_hci_summary_tap_packet(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *edt, const void* data)
{
bluetooth_hci_summary_tapinfo_t *tapinfo = (bluetooth_hci_summary_tapinfo_t *) tapinfo_ptr;
@@ -52,7 +52,7 @@ bluetooth_hci_summary_tap_packet(void *tapinfo_ptr, packet_info *pinfo, epan_dis
if (tapinfo->tap_packet)
tapinfo->tap_packet(tapinfo, pinfo, edt, data);
- return TRUE;
+ return TAP_PACKET_REDRAW;
}
static void
@@ -332,7 +332,7 @@ void BluetoothHciSummaryDialog::tapReset(void *tapinfo_ptr)
dialog->item_hardware_errors_->setText(column_number_occurrence, "0");
}
-gboolean BluetoothHciSummaryDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data)
+tap_packet_status BluetoothHciSummaryDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data)
{
bluetooth_hci_summary_tapinfo_t *tapinfo = static_cast<bluetooth_hci_summary_tapinfo_t *>(tapinfo_ptr);
BluetoothHciSummaryDialog *dialog = static_cast<BluetoothHciSummaryDialog *>(tapinfo->ui);
@@ -346,10 +346,10 @@ gboolean BluetoothHciSummaryDialog::tapPacket(void *tapinfo_ptr, packet_info *pi
QString name;
if (dialog->file_closed_)
- return FALSE;
+ return TAP_PACKET_DONT_REDRAW;
if (pinfo->rec->rec_type != REC_TYPE_PACKET)
- return FALSE;
+ return TAP_PACKET_DONT_REDRAW;
name = tr("Unknown");
@@ -365,7 +365,7 @@ gboolean BluetoothHciSummaryDialog::tapPacket(void *tapinfo_ptr, packet_info *pi
if (interface && dialog->ui->interfaceComboBox->currentIndex() > 0) {
if (dialog->ui->interfaceComboBox->currentText() != interface)
- return TRUE;
+ return TAP_PACKET_REDRAW;
}
}
@@ -377,7 +377,7 @@ gboolean BluetoothHciSummaryDialog::tapPacket(void *tapinfo_ptr, packet_info *pi
if (dialog->ui->adapterComboBox->currentIndex() > 0) {
if (dialog->ui->adapterComboBox->currentText() != adapter)
- return TRUE;
+ return TAP_PACKET_REDRAW;
}
switch (tap_hci->type) {
@@ -768,7 +768,7 @@ gboolean BluetoothHciSummaryDialog::tapPacket(void *tapinfo_ptr, packet_info *pi
dialog->ui->tableTreeWidget->resizeColumnToContents(i);
}
- return TRUE;
+ return TAP_PACKET_REDRAW;
}
void BluetoothHciSummaryDialog::interfaceCurrentIndexChanged(int)