Fixed freeze when canceling projectfile dialog when creating a new Project.

Updated gui.pro (forgot it in last commit)
This commit is contained in:
PKEuS 2012-10-14 14:13:54 +02:00
parent 67fb2dc2c9
commit b0f5b7dce0
4 changed files with 10 additions and 7 deletions

View File

@ -134,6 +134,6 @@ SOURCES += aboutdialog.cpp \
win32 {
DEFINES += _CRT_SECURE_NO_WARNINGS
RC_FILE = cppcheck-gui.rc
HEADERS += ../cli/resource.h
HEADERS += ../lib/version.h
LIBS += -lshlwapi
}

View File

@ -965,11 +965,11 @@ void MainWindow::NewProjectFile()
delete mProject;
mProject = new Project(filepath, this);
mProject->Create();
mProject->Edit();
if (mProject->Edit()) {
AddProjectMRU(filepath);
CheckProject(mProject);
}
}
void MainWindow::CloseProjectFile()
{

View File

@ -82,7 +82,7 @@ bool Project::Open()
return false;
}
void Project::Edit()
bool Project::Edit()
{
ProjectFileDialog dlg(mFilename, mParentWidget);
QString root = mPFile->GetRootPath();
@ -118,7 +118,9 @@ void Project::Edit()
mParentWidget);
msg.exec();
}
return writeSuccess;
}
return false;
}
void Project::Create()

View File

@ -66,8 +66,9 @@ public:
/**
* @brief Edit the project file.
* @return true if editing was successful.
*/
void Edit();
bool Edit();
/**
* @brief Create new project file.