forked from qt-creator/qt-creator
QmlProject: Print a warning if the mainFile given is not readable
Change-Id: If5951bb3121b13287a3ccf9d684bf23e0673231c Reviewed-by: Daniel Teske <daniel.teske@nokia.com> Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
This commit is contained in:
@@ -122,6 +122,17 @@ void QmlProject::parseProject(RefreshOptions options)
|
||||
if (m_projectItem) {
|
||||
m_projectItem.data()->setSourceDirectory(projectDir().path());
|
||||
m_modelManager->updateSourceFiles(m_projectItem.data()->files(), true);
|
||||
|
||||
QString mainFilePath = m_projectItem.data()->mainFile();
|
||||
if (!mainFilePath.isEmpty()) {
|
||||
mainFilePath = projectDir().absoluteFilePath(mainFilePath);
|
||||
if (!QFileInfo(mainFilePath).isReadable()) {
|
||||
messageManager->printToOutputPane(
|
||||
tr("Warning while loading project file %1.").arg(m_fileName));
|
||||
messageManager->printToOutputPane(
|
||||
tr("File '%' does not exist or is not readable.").arg(mainFilePath), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
m_rootNode->refresh();
|
||||
}
|
||||
|
Reference in New Issue
Block a user