From 1898cd63494c56d101519f2ed583f0abbeda873c Mon Sep 17 00:00:00 2001 From: lllucius Date: Fri, 4 Oct 2013 03:15:51 +0000 Subject: [PATCH] In tree view, search label and key. In name view, search label. In key view, search key. --- src/widgets/KeyView.cpp | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/src/widgets/KeyView.cpp b/src/widgets/KeyView.cpp index 3d2a7d001..b1d66207d 100644 --- a/src/widgets/KeyView.cpp +++ b/src/widgets/KeyView.cpp @@ -760,15 +760,28 @@ KeyView::RefreshLines() { KeyNode & node = mNodes[i]; - // Search the label (with possible prefix) and key - // - // The x"01" separator is used to prevent finding a - // match comprising the end of the label and beginning - // of the key. It was chosen since it's not very likely - // to appear in the filter itself. - wxString searchit = node.label.Lower() + - wxT("\01x") + - node.key.Lower(); + // Search columns based on view type + wxString searchit; + switch (mViewType) + { + // The x"01" separator is used to prevent finding a + // match comprising the end of the label and beginning + // of the key. It was chosen since it's not very likely + // to appear in the filter itself. + case ViewByTree: + searchit = node.label.Lower() + + wxT("\01x") + + node.key.Lower(); + break; + + case ViewByName: + searchit = node.label.Lower(); + break; + + case ViewByKey: + searchit = node.key.Lower(); + break; + } if (searchit.Find(mFilter) == wxNOT_FOUND) { // Not found so continue to next node