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:
@@ -94,7 +94,7 @@ class PythonProjectManager : public IProjectManager
|
||||
Q_OBJECT
|
||||
public:
|
||||
QString mimeType() const override { return QLatin1String(PythonMimeType); }
|
||||
Project *openProject(const QString &fileName, QString *errorString) override;
|
||||
Project *openProject(const QString &fileName) override;
|
||||
};
|
||||
|
||||
class PythonProject : public Project
|
||||
@@ -361,15 +361,8 @@ PythonRunConfigurationWidget::PythonRunConfigurationWidget(PythonRunConfiguratio
|
||||
setEnabled(runConfiguration->isEnabled());
|
||||
}
|
||||
|
||||
Project *PythonProjectManager::openProject(const QString &fileName, QString *errorString)
|
||||
Project *PythonProjectManager::openProject(const QString &fileName)
|
||||
{
|
||||
if (!QFileInfo(fileName).isFile()) {
|
||||
if (errorString)
|
||||
*errorString = tr("Failed opening project \"%1\": Project is not a file.")
|
||||
.arg(fileName);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return new PythonProject(fileName);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user