Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Adrian Hunter and committed by
Arnaldo Carvalho de Melo
35fa1cee 65b24292

+3 -1
+3 -1
tools/perf/scripts/python/exported-sql-viewer.py
··· 1975 1975 def FindDone(self, row): 1976 1976 self.find_bar.Idle() 1977 1977 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()))) 1979 1979 else: 1980 1980 self.find_bar.NotFound() 1981 1981 ··· 2188 2188 Ctrl-F displays a Find bar which finds substrings by either an exact match or a regular expression match. 2189 2189 Refer to Python documentation for the regular expression syntax. 2190 2190 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. 2191 2193 """ 2192 2194 2193 2195 # Help window