From patchwork Fri Dec 14 12:52:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10760177 Return-Path: Received: from mail-eopbgr750048.outbound.protection.outlook.com ([40.107.75.48]:44920 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729846AbeLNMwp (ORCPT ); Fri, 14 Dec 2018 07:52:45 -0500 From: Yordan Karadzhov To: "rostedt@goodmis.org" CC: "linux-trace-devel@vger.kernel.org" Subject: [PATCH v2 4/8] kernel-shark-qt: Avoid spurious searches Date: Fri, 14 Dec 2018 12:52:38 +0000 Message-ID: <20181214125212.9637-5-ykaradzhov@vmware.com> References: <20181214125212.9637-1-ykaradzhov@vmware.com> In-Reply-To: <20181214125212.9637-1-ykaradzhov@vmware.com> Content-Language: en-US MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org List-ID: We do not want to search if the text field of search panel is empty. Most probably this is an accidental key press or mouse click. Signed-off-by: Yordan Karadzhov --- kernel-shark-qt/src/KsTraceViewer.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kernel-shark-qt/src/KsTraceViewer.cpp b/kernel-shark-qt/src/KsTraceViewer.cpp index aeed5f7..971793f 100644 --- a/kernel-shark-qt/src/KsTraceViewer.cpp +++ b/kernel-shark-qt/src/KsTraceViewer.cpp @@ -331,6 +331,15 @@ void KsTraceViewer::_search() _matchList.clear(); xText = _searchLineEdit.text(); + if (xText.isEmpty()) { + /* + * No text is provided by the user. Most probably this + * is an accidental key press. Just reenable the input. + */ + _lockSearchPanel(false); + return; + } + xColumn = _columnComboBox.currentIndex(); xSelect = _selectComboBox.currentIndex();