From kde-commits Fri Sep 30 08:07:59 2016 From: Christoph Cullmann Date: Fri, 30 Sep 2016 08:07:59 +0000 To: kde-commits Subject: [kate] addons/katebuild-plugin: avoid that files are opened duplicated, we want canonical names, if Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=147522288820345 Git commit cdd89582a7c22fdbb8709a0047f324df79e10684 by Christoph Cullmann. Committed on 30/09/2016 at 08:07. Pushed by cullmann into branch 'master'. avoid that files are opened duplicated, we want canonical names, if possible M +7 -2 addons/katebuild-plugin/plugin_katebuild.cpp http://commits.kde.org/kate/cdd89582a7c22fdbb8709a0047f324df79e10684 diff --git a/addons/katebuild-plugin/plugin_katebuild.cpp b/addons/katebuil= d-plugin/plugin_katebuild.cpp index 86f9303..c6a7471 100644 --- a/addons/katebuild-plugin/plugin_katebuild.cpp +++ b/addons/katebuild-plugin/plugin_katebuild.cpp @@ -370,7 +370,7 @@ void KateBuildView::slotErrorSelected(QTreeWidgetItem *= item) const int column =3D item->data(2, Qt::UserRole).toInt(); = // open file (if needed, otherwise, this will activate only the right = view...) - m_win->openUrl(QUrl::fromUserInput(filename)); + m_win->openUrl(QUrl::fromLocalFile(filename)); = // any view active? if (!m_win->activeView()) { @@ -828,9 +828,14 @@ void KateBuildView::processLine(const QString &line) filename =3D m_make_dir + QLatin1Char('/') + filename; } = + // get canonical path, if possible, to avoid duplicated opened files + auto canonicalFilePath(QFileInfo(filename).canonicalFilePath()); + if (!canonicalFilePath.isEmpty()) { + filename =3D canonicalFilePath; + } + // Now we have the data we need show the error/warning addError(filename, line_n, QString(), msg); - } = =20