forked from qt-creator/qt-creator
Resolve links and normalize file names when opening editors again.
For the check if a certain editor is already open.
Broke with 8c2e3fd2cb
.
Task-number: QTCREATORBUG-10836
Task-number: QTCREATORBUG-10945
Task-number: QTCREATORBUG-10994
Change-Id: Id1b20cd935986306f85a659f19dff52f2ee38052
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "documentmodel.h"
|
||||
#include "ieditor.h"
|
||||
#include <coreplugin/documentmanager.h>
|
||||
#include <coreplugin/idocument.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -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;
|
||||
|
Reference in New Issue
Block a user