Browse Source

cmake error messages no longer appear twice when saving CMakeLists.txt

merge-requests/365/head
eidheim 10 years ago
parent
commit
4a6d92c893
  1. 8
      src/notebook.cc

8
src/notebook.cc

@ -248,14 +248,14 @@ bool Notebook::save(int page) {
boost::filesystem::path project_path; boost::filesystem::path project_path;
if(view->file_path.filename()=="CMakeLists.txt") { if(view->file_path.filename()=="CMakeLists.txt") {
auto &directories=Directories::get(); auto &directories=Directories::get();
if(directories.cmake && directories.cmake->project_path!="" && view->file_path.generic_string().substr(0, directories.cmake->project_path.generic_string().size()+1)==directories.cmake->project_path.generic_string()+'/' && CMake::create_compile_commands(directories.cmake->project_path)) { if(directories.cmake && directories.cmake->project_path!="" && view->file_path.generic_string().substr(0, directories.cmake->project_path.generic_string().size()+1)==directories.cmake->project_path.generic_string()+'/') {
project_path=directories.cmake->project_path; if(CMake::create_compile_commands(directories.cmake->project_path))
project_path=directories.cmake->project_path;
} }
else { else {
CMake cmake(view->file_path.parent_path()); CMake cmake(view->file_path.parent_path());
if(cmake.project_path!="" && CMake::create_compile_commands(cmake.project_path)) { if(cmake.project_path!="" && CMake::create_compile_commands(cmake.project_path))
project_path=cmake.project_path; project_path=cmake.project_path;
}
} }
if(project_path!="") { if(project_path!="") {
for(auto source_view: source_views) { for(auto source_view: source_views) {

Loading…
Cancel
Save