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 { win32 {
DEFINES += _CRT_SECURE_NO_WARNINGS DEFINES += _CRT_SECURE_NO_WARNINGS
RC_FILE = cppcheck-gui.rc RC_FILE = cppcheck-gui.rc
HEADERS += ../cli/resource.h HEADERS += ../lib/version.h
LIBS += -lshlwapi LIBS += -lshlwapi
} }

View File

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

View File

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

View File

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