Catch a few common errors for failing .pro parsing

Task-number: QTCREATORBUG-7377

Change-Id: I43e1393acc09ee4fd923d6796b4a0298fb22ea71
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
Daniel Teske
2012-05-09 12:44:37 +02:00
parent 33144c12a9
commit d05d697ab3
5 changed files with 27 additions and 6 deletions

View File

@@ -1362,6 +1362,23 @@ void Qt4Project::configureAsExampleProject(const QStringList &platforms)
ProjectExplorer::ProjectExplorerPlugin::instance()->requestProjectModeUpdate(this);
}
// All the Qt4 run configurations should share code.
// This is a rather suboptimal way to do that for disabledReason()
// but more pratical then duplicated the code everywhere
QString Qt4Project::disabledReasonForRunConfiguration(const QString &proFilePath)
{
if (!QFileInfo(proFilePath).exists())
return tr("The .pro file '%1' does not exist.")
.arg(QFileInfo(proFilePath).fileName());
if (!m_rootProjectNode->findProFileFor(proFilePath))
return tr("The .pro file '%1' is not part of the project.")
.arg(QFileInfo(proFilePath).fileName());
return tr("The .pro file '%1' could not be parsed.")
.arg(QFileInfo(proFilePath).fileName());
}
} // namespace Qt4ProjectManager
#include "qt4project.moc"