GUI: use early return
This commit is contained in:
parent
cf9ece4187
commit
d4d1d32937
|
@ -65,21 +65,22 @@ bool Project::IsOpen() const
|
||||||
bool Project::Open()
|
bool Project::Open()
|
||||||
{
|
{
|
||||||
mPFile = new ProjectFile(mFilename, this);
|
mPFile = new ProjectFile(mFilename, this);
|
||||||
if (QFile::exists(mFilename)) {
|
if (!QFile::exists(mFilename))
|
||||||
if (!mPFile->Read()) {
|
return false;
|
||||||
QMessageBox msg(QMessageBox::Critical,
|
|
||||||
tr("Cppcheck"),
|
if (!mPFile->Read()) {
|
||||||
tr("Could not read the project file."),
|
QMessageBox msg(QMessageBox::Critical,
|
||||||
QMessageBox::Ok,
|
tr("Cppcheck"),
|
||||||
mParentWidget);
|
tr("Could not read the project file."),
|
||||||
msg.exec();
|
QMessageBox::Ok,
|
||||||
mFilename = QString();
|
mParentWidget);
|
||||||
mPFile->SetFilename(mFilename);
|
msg.exec();
|
||||||
return false;
|
mFilename = QString();
|
||||||
}
|
mPFile->SetFilename(mFilename);
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Project::Edit()
|
bool Project::Edit()
|
||||||
|
|
Loading…
Reference in New Issue