|
|
|
@ -55,7 +55,7 @@ void Notebook::open(const boost::filesystem::path &file_path) { |
|
|
|
auto language=Source::guess_language(file_path); |
|
|
|
auto language=Source::guess_language(file_path); |
|
|
|
if(language && (language->get_id()=="chdr" || language->get_id()=="c" || language->get_id()=="cpp" || language->get_id()=="objc")) { |
|
|
|
if(language && (language->get_id()=="chdr" || language->get_id()=="c" || language->get_id()=="cpp" || language->get_id()=="objc")) { |
|
|
|
boost::filesystem::path project_path; |
|
|
|
boost::filesystem::path project_path; |
|
|
|
if(directories.cmake && directories.cmake->project_path!="") |
|
|
|
if(directories.cmake && directories.cmake->project_path!="" && file_path.string().substr(0, directories.cmake->project_path.string().size())==directories.cmake->project_path.string()) |
|
|
|
project_path=directories.cmake->project_path; |
|
|
|
project_path=directories.cmake->project_path; |
|
|
|
else { |
|
|
|
else { |
|
|
|
project_path=file_path.parent_path(); |
|
|
|
project_path=file_path.parent_path(); |
|
|
|
@ -119,7 +119,7 @@ bool Notebook::save(int page) { |
|
|
|
//If CMakeLists.txt have been modified:
|
|
|
|
//If CMakeLists.txt have been modified:
|
|
|
|
//TODO: recreate cmake even without directories open?
|
|
|
|
//TODO: recreate cmake even without directories open?
|
|
|
|
if(view->file_path.filename()=="CMakeLists.txt") { |
|
|
|
if(view->file_path.filename()=="CMakeLists.txt") { |
|
|
|
if(directories.cmake && directories.cmake->project_path!="" && view->file_path>=directories.cmake->project_path && CMake::create_compile_commands(directories.cmake->project_path)) { |
|
|
|
if(directories.cmake && directories.cmake->project_path!="" && view->file_path.string().substr(0, directories.cmake->project_path.string().size())==directories.cmake->project_path.string() && CMake::create_compile_commands(directories.cmake->project_path)) { |
|
|
|
directories.open_folder(); |
|
|
|
directories.open_folder(); |
|
|
|
for(auto source_view: source_views) { |
|
|
|
for(auto source_view: source_views) { |
|
|
|
if(auto source_clang_view=dynamic_cast<Source::ClangView*>(source_view)) { |
|
|
|
if(auto source_clang_view=dynamic_cast<Source::ClangView*>(source_view)) { |
|
|
|
|