summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2016-09-30 08:07:25 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2016-09-30 08:07:25 (GMT)
commitcdd89582a7c22fdbb8709a0047f324df79e10684 (patch)
tree411f2258641e208e6bcdb2a72021db10fccc734b
parent92e71151321fd642e5dc14948a30d1f61edfcbe4 (diff)
avoid that files are opened duplicated, we want canonical names, if possible
-rw-r--r--addons/katebuild-plugin/plugin_katebuild.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/addons/katebuild-plugin/plugin_katebuild.cpp b/addons/katebuild-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 = 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 = m_make_dir + QLatin1Char('/') + filename;
}
+ // get canonical path, if possible, to avoid duplicated opened files
+ auto canonicalFilePath(QFileInfo(filename).canonicalFilePath());
+ if (!canonicalFilePath.isEmpty()) {
+ filename = canonicalFilePath;
+ }
+
// Now we have the data we need show the error/warning
addError(filename, line_n, QString(), msg);
-
}