forked from qt-creator/qt-creator
ProjectManager: Centralize "File not found handling"
That's the only error that was ever checked for, in all nine project manager. In the hypothetical case that we'll need something else than the name of a file to identify a "project file", we'd probably need to touch the signature anyway. Until then, remove the duplication. Change-Id: Iba00b8f71309a908e2d29c0a58c50b685eca0cae Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -156,17 +156,9 @@ void CMakeManager::rescanProject(Project *project)
|
||||
cmakeProject->runCMake(); // by my experience: every rescan run requires cmake run too
|
||||
}
|
||||
|
||||
Project *CMakeManager::openProject(const QString &fileName, QString *errorString)
|
||||
Project *CMakeManager::openProject(const QString &fileName)
|
||||
{
|
||||
Utils::FileName file = Utils::FileName::fromString(fileName);
|
||||
if (!file.toFileInfo().isFile()) {
|
||||
if (errorString)
|
||||
*errorString = tr("Failed opening project \"%1\": Project is not a file")
|
||||
.arg(file.toUserOutput());
|
||||
return 0;
|
||||
}
|
||||
|
||||
return new CMakeProject(file);
|
||||
return new CMakeProject(Utils::FileName::fromString(fileName));
|
||||
}
|
||||
|
||||
QString CMakeManager::mimeType() const
|
||||
|
||||
Reference in New Issue
Block a user