forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user