Commit ae394dfb authored by Kai Koehne's avatar Kai Koehne
Browse files

AppOutput: Make file path linkification more robust

Fixes that Qt Creator was opening e.g. 'alg_id.cpp' when the path
in application output ended with 'id.cpp'. Instead of maintaining
our own logic here we should rather rely on FileInProjectFinder.

Change-Id: I10337df03ddcfd54b3d3a1bd1573c220039a28bf
Reviewed-by: default avatarDaniel Teske <>
parent d9cb15e4
......@@ -239,24 +239,7 @@ void QtOutputFormatter::handleLink(const QString &href)
if (!fileName.isEmpty()) {
QFileInfo fi(fileName);
if (fi.isRelative()) {
// Yeah fileName is relative, no surprise
ProjectExplorer::Project *pro =;
if (pro) {
QString baseName = fi.fileName();
foreach (const QString &file, pro->files(Project::AllFiles)) {
if (file.endsWith(baseName)) {
// pick the first one...
fileName = file;
} else if (!fi.exists()) {
// map possible on-device path to source path
fileName = m_projectFinder.findFile(QUrl::fromLocalFile(fileName));
TextEditor::BaseTextEditorWidget::openEditorAt(fileName, line, 0);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment