From 4b19bdd6f1297d463037aeb8038378de26d4241b Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 5 Dec 2013 12:43:34 +0100 Subject: [PATCH] Resolve links and normalize file names when opening editors again. For the check if a certain editor is already open. Broke with 8c2e3fd2cbaeb1178ae3991de794ee6d74c84d85. Task-number: QTCREATORBUG-10836 Task-number: QTCREATORBUG-10945 Task-number: QTCREATORBUG-10994 Change-Id: Id1b20cd935986306f85a659f19dff52f2ee38052 Reviewed-by: Daniel Teske Reviewed-by: David Schulz Reviewed-by: Robert Loehning --- src/plugins/coreplugin/editormanager/documentmodel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/editormanager/documentmodel.cpp b/src/plugins/coreplugin/editormanager/documentmodel.cpp index 737b2fc5faa..be48667591f 100644 --- a/src/plugins/coreplugin/editormanager/documentmodel.cpp +++ b/src/plugins/coreplugin/editormanager/documentmodel.cpp @@ -29,6 +29,7 @@ #include "documentmodel.h" #include "ieditor.h" +#include #include #include @@ -194,8 +195,9 @@ int DocumentModel::indexOfFilePath(const QString &filePath) const { if (filePath.isEmpty()) return -1; + const QString fixedPath = DocumentManager::fixFileName(filePath, DocumentManager::KeepLinks); for (int i = 0; i < d->m_documents.count(); ++i) { - if (d->m_documents.at(i)->fileName() == filePath) + if (DocumentManager::fixFileName(d->m_documents.at(i)->fileName(), DocumentManager::KeepLinks) == fixedPath) return i; } return -1;