diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2019-02-25 17:45:39 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2019-03-04 09:52:13 +0000 |
commit | d0db212575909ca18244bdfc99b952dffcd0e902 (patch) | |
tree | f0fbfb40bc34b20a5f4539b6936c8854e78433ee /src/plugins/perfprofiler | |
parent | b0e125ac11b1ad80717366a1270412d6b6b1be41 (diff) |
Resolve ambiguous results of searches for relative file paths
Qt Creator extracts file names from the output of external processes in
various places, for instance from compilers during the build. It often
happens that such file names are not absolute, so they cannot be
directly opened in an editor when the user clicks on their
representation in some widget. That's why they are processed by the
FileInProjectFinder facility first.
This patch enhances the FileInProjectFinder to be able to return more
than one candidate for a relative file path, and allows the user to
choose between these candidates where possible. This way, we won't open
a random file anymore when a project contains more than one file with
the same name.
Fixes: QTCREATORBUG-13623
Change-Id: Id19c9eace3e6b3dbde89f6528e6d02b55872d747
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/perfprofiler')
-rw-r--r-- | src/plugins/perfprofiler/perfprofilertool.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/perfprofiler/perfprofilertool.cpp b/src/plugins/perfprofiler/perfprofilertool.cpp index 57de5ce14ac..662e9ef5484 100644 --- a/src/plugins/perfprofiler/perfprofilertool.cpp +++ b/src/plugins/perfprofiler/perfprofilertool.cpp @@ -540,7 +540,7 @@ void PerfProfilerTool::gotoSourceLocation(QString filePath, int lineNumber, int QFileInfo fi(filePath); if (!fi.isAbsolute() || !fi.exists() || !fi.isReadable()) { - fi.setFile(m_fileFinder.findFile(filePath)); + fi.setFile(m_fileFinder.findFile(filePath).first().toString()); if (!fi.exists() || !fi.isReadable()) return; } |