Projects: Improve opening of projects

Move logic to detect already open projects into ProjectExplorer itself,
along with some check for the canonicalFilePath.

Remove the same logic from the individual projectmanagers.

Put check that the path is a file into project managers. So far all of
them assume the project file to be a file (e.g. a xcode project manager
would expect a directory though).

Task-number: QTCREATORBUG-9350
Change-Id: I3901958395e3c594c8cfba9a85dc7d3ec3334afb
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Tobias Hunger
2013-05-27 11:17:47 +02:00
parent 711e67ad65
commit a52063ee39
8 changed files with 65 additions and 71 deletions

View File

@@ -126,8 +126,13 @@ void CMakeManager::runCMake(ProjectExplorer::Project *project)
ProjectExplorer::Project *CMakeManager::openProject(const QString &fileName, QString *errorString)
{
Q_UNUSED(errorString)
// TODO check whether this project is already opened
if (!QFileInfo(fileName).isFile()) {
if (errorString)
*errorString = tr("Failed opening project '%1': Project is not a file")
.arg(fileName);
return 0;
}
return new CMakeProject(this, fileName);
}