History

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.

Adrian Hunter committed 8 years ago

Commit 35fa1ce1 parent 65b24291 file · +3 −1Browse files

Showing the changes to tools/perf/scripts/python (1 of 1 file). Show all

Unified · Split

tools/perf/scripts/python/exported-sql-viewer.py+3−1
@@ -1975,7 +1975,7 @@ class TableWindow(QMdiSubWindow, ResizeColumnsToContentsBase): · 1974 unmodified lines
1975 def FindDone(self, row):1975 def FindDone(self, row):
1976 self.find_bar.Idle()1976 self.find_bar.Idle()
1977 if row >= 0: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 else:1979 else:
1980 self.find_bar.NotFound()1980 self.find_bar.NotFound()
1981 1981
@@ -2188,6 +2188,8 @@ For PostgreSQL databases, information_schema.tables/views/columns are included. · 206 unmodified lines
2188Ctrl-F displays a Find bar which finds substrings by either an exact match or a regular expression match.2188Ctrl-F displays a Find bar which finds substrings by either an exact match or a regular expression match.
2189Refer to Python documentation for the regular expression syntax.2189Refer to Python documentation for the regular expression syntax.
2190All columns are searched, but only currently fetched rows are searched.2190All 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
2192will go to the next/previous result in id order, instead of display order.
2191"""2193"""
2192 2194
2193# Help window2195# Help window

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t