Fix usage of EditorManager::editorsForFileName

And move to using the corresponding method in document model.

Change-Id: I80b12ceab8a91c5393b9c0422d660a8896ae09d8
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Eike Ziller
2013-07-18 12:26:23 +02:00
parent bc88c0b89e
commit 8c2e3fd2cb
11 changed files with 47 additions and 85 deletions

View File

@@ -1333,14 +1333,14 @@ void DocumentManager::executeOpenWithMenuAction(QAction *action)
OpenWithEntry entry = qvariant_cast<OpenWithEntry>(data);
if (entry.editorFactory) {
// close any open editors that have this file open, but have a different type.
EditorManager *em = EditorManager::instance();
QList<IEditor *> editorsOpenForFile = em->editorsForFileName(entry.fileName);
QList<IEditor *> editorsOpenForFile
= EditorManager::documentModel()->editorsForFilePath(entry.fileName);
if (!editorsOpenForFile.isEmpty()) {
foreach (IEditor *openEditor, editorsOpenForFile) {
if (entry.editorFactory->id() == openEditor->id())
editorsOpenForFile.removeAll(openEditor);
}
if (!em->closeEditors(editorsOpenForFile)) // don't open if cancel was pressed
if (!EditorManager::instance()->closeEditors(editorsOpenForFile)) // don't open if cancel was pressed
return;
}