All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>, Andi Kleen <ak@linux.intel.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH V2 4/4] perf scripts python: exported-sql-viewer.py: Fix table find when table re-ordered
Date: Sun,  4 Nov 2018 17:12:38 +0200	[thread overview]
Message-ID: <20181104151238.15947-5-adrian.hunter@intel.com> (raw)
In-Reply-To: <20181104151238.15947-1-adrian.hunter@intel.com>

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>
---
 tools/perf/scripts/python/exported-sql-viewer.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/scripts/python/exported-sql-viewer.py b/tools/perf/scripts/python/exported-sql-viewer.py
index c2fcf6c5237a..f278ce5ebab7 100755
--- a/tools/perf/scripts/python/exported-sql-viewer.py
+++ b/tools/perf/scripts/python/exported-sql-viewer.py
@@ -1975,7 +1975,7 @@ class TableWindow(QMdiSubWindow, ResizeColumnsToContentsBase):
 	def FindDone(self, row):
 		self.find_bar.Idle()
 		if row >= 0:
-			self.view.setCurrentIndex(self.model.index(row, 0, QModelIndex()))
+			self.view.setCurrentIndex(self.model.mapFromSource(self.data_model.index(row, 0, QModelIndex())))
 		else:
 			self.find_bar.NotFound()
 
@@ -2188,6 +2188,8 @@ For PostgreSQL databases, information_schema.tables/views/columns are included.
 Ctrl-F displays a Find bar which finds substrings by either an exact match or a regular expression match.
 Refer to Python documentation for the regular expression syntax.
 All columns are searched, but only currently fetched rows are searched.
+<p>N.B. Results are found in id order, so if the table is re-ordered, find-next and find-previous
+will go to the next/previous result in id order, instead of display order.
 """
 
 # Help window
-- 
2.17.1


  parent reply	other threads:[~2018-11-04 15:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-04 15:12 [PATCH V2 0/4] perf scripts python: exported-sql-viewer.py Adrian Hunter
2018-11-04 15:12 ` [PATCH V2 1/4] perf scripts python: exported-sql-viewer.py: Fall back to /usr/local/lib/libxed.so Adrian Hunter
2018-11-06 19:15   ` [tip:perf/urgent] " tip-bot for Adrian Hunter
2018-11-04 15:12 ` [PATCH V2 2/4] perf scripts python: exported-sql-viewer.py: Add Selected branches report Adrian Hunter
2018-11-06 19:15   ` [tip:perf/urgent] " tip-bot for Adrian Hunter
2018-11-04 15:12 ` [PATCH V2 3/4] perf scripts python: exported-sql-viewer.py: Add help window Adrian Hunter
2018-11-06 19:16   ` [tip:perf/urgent] " tip-bot for Adrian Hunter
2018-11-04 15:12 ` Adrian Hunter [this message]
2018-11-06 19:16   ` [tip:perf/urgent] perf scripts python: exported-sql-viewer.py: Fix table find when table re-ordered tip-bot for Adrian Hunter
2018-11-05 17:53 ` [PATCH V2 0/4] perf scripts python: exported-sql-viewer.py Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181104151238.15947-5-adrian.hunter@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.