Skip to content

Commit 35fa1ce

Browse files
ahunter6acmel
authored andcommitted
perf scripts python: exported-sql-viewer.py: Fix table find when table re-ordered
Table rows can be re-ordered by selecting a column to sort by. After re-ordering, the "find" operation was highlighting the wrong row, fix it. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/20181104151238.15947-5-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 65b2429 commit 35fa1ce

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/perf/scripts/python/exported-sql-viewer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1975,7 +1975,7 @@ def Find(self, value, direction, pattern, context):
19751975
def FindDone(self, row):
19761976
self.find_bar.Idle()
19771977
if row >= 0:
1978-
self.view.setCurrentIndex(self.model.index(row, 0, QModelIndex()))
1978+
self.view.setCurrentIndex(self.model.mapFromSource(self.data_model.index(row, 0, QModelIndex())))
19791979
else:
19801980
self.find_bar.NotFound()
19811981

@@ -2188,6 +2188,8 @@ def setActiveSubWindow(self, nr):
21882188
Ctrl-F displays a Find bar which finds substrings by either an exact match or a regular expression match.
21892189
Refer to Python documentation for the regular expression syntax.
21902190
All columns are searched, but only currently fetched rows are searched.
2191+
<p>N.B. Results are found in id order, so if the table is re-ordered, find-next and find-previous
2192+
will go to the next/previous result in id order, instead of display order.
21912193
"""
21922194

21932195
# Help window

0 commit comments

Comments
 (0)