diff --git a/gui/gui.pro b/gui/gui.pro index 9f2e27229..68bad26c0 100644 --- a/gui/gui.pro +++ b/gui/gui.pro @@ -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 } diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 8d5f18629..5fcb2e894 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -965,10 +965,10 @@ void MainWindow::NewProjectFile() delete mProject; mProject = new Project(filepath, this); mProject->Create(); - mProject->Edit(); - - AddProjectMRU(filepath); - CheckProject(mProject); + if (mProject->Edit()) { + AddProjectMRU(filepath); + CheckProject(mProject); + } } void MainWindow::CloseProjectFile() diff --git a/gui/project.cpp b/gui/project.cpp index 2ab23e90f..c420f3f5c 100644 --- a/gui/project.cpp +++ b/gui/project.cpp @@ -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() diff --git a/gui/project.h b/gui/project.h index 18f088829..f4fe80ba3 100644 --- a/gui/project.h +++ b/gui/project.h @@ -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.