Squelch recent display filter warnings.

Try to keep the main display filter editor from emitting warnings when
we populate the recent item list.

Change-Id: Ib0c150093e03d4d2ca2ac6cd72c0e37d041fe98b
Ping-Bug: 11438
Reviewed-on: https://code.wireshark.org/review/10157
Tested-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
This commit is contained in:
Gerald Combs 2015-08-20 11:39:02 -07:00
parent 36a74cb13a
commit e67098c5d0
1 changed files with 6 additions and 0 deletions

View File

@ -125,8 +125,14 @@ extern "C" gboolean dfilter_combo_add_recent(const gchar *filter) {
if (!cur_display_filter_combo)
return FALSE;
// Adding an item to a QComboBox also sets its lineEdit. In our case
// that means we might trigger a temporary status message so we block
// the lineEdit's signals.
// Another approach would be to update QComboBox->model directly.
bool block_state = cur_display_filter_combo->lineEdit()->blockSignals(true);
cur_display_filter_combo->addItem(filter);
cur_display_filter_combo->clearEditText();
cur_display_filter_combo->lineEdit()->blockSignals(block_state);
return TRUE;
}