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:
Kai Koehne
2012-01-02 15:54:51 +01:00
parent 1dc7e0d3ed
commit 2cf6cd6cba

View File

@@ -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();
}