forked from qt-creator/qt-creator
QmlProject: Do not open .qml.ui file if a file from that project is open
The wizards and example browser already open a .ui.qml file. In this case we do not want to open the first one. Change-Id: I8278ca28cd02dfde2b4ab0ffd1b551073d85859f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Aleksei German <aleksei.german@qt.io>
This commit is contained in:
@@ -151,8 +151,14 @@ QmlProject::QmlProject(const Utils::FilePath &fileName)
|
||||
return node->filePath().completeSuffix() == "ui.qml"
|
||||
&& node->filePath().parentDir() == folder;
|
||||
});
|
||||
if (!uiFiles.isEmpty())
|
||||
Core::EditorManager::openEditor(uiFiles.first(), Utils::Id());
|
||||
if (!uiFiles.isEmpty()) {
|
||||
Utils::FilePath currentFile;
|
||||
if (auto cd = Core::EditorManager::currentDocument())
|
||||
currentFile = cd->filePath();
|
||||
|
||||
if (currentFile.isEmpty() || !isKnownFile(currentFile))
|
||||
Core::EditorManager::openEditor(uiFiles.first(), Utils::Id());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user