diff --git a/src/lib/settings/ApplicationSettings.cpp b/src/lib/settings/ApplicationSettings.cpp index e1d543e3..5ce763c3 100644 --- a/src/lib/settings/ApplicationSettings.cpp +++ b/src/lib/settings/ApplicationSettings.cpp @@ -87,6 +87,11 @@ bool ApplicationSettings::load(const FilePath& filePath, bool readOnly) cxxHeaderSearchPaths = utility::replaceOrAddCxxCompilerHeaderPath(cxxHeaderSearchPaths); migration->setValuesInSettings(settings, "indexing/cxx/header_search_paths/header_search_path", cxxHeaderSearchPaths); + + if (cxxHeaderSearchPaths.size() == 1) + { + migration->setValueInSettings(settings, "indexing/cxx/has_prefilled_header_search_paths", false); + } } )); diff --git a/src/lib_gui/utility/path_detector/cxx_header/CxxFrameworkPathDetector.cpp b/src/lib_gui/utility/path_detector/cxx_header/CxxFrameworkPathDetector.cpp index b8a99895..6d6d363b 100644 --- a/src/lib_gui/utility/path_detector/cxx_header/CxxFrameworkPathDetector.cpp +++ b/src/lib_gui/utility/path_detector/cxx_header/CxxFrameworkPathDetector.cpp @@ -18,7 +18,11 @@ std::vector CxxFrameworkPathDetector::getPaths() const { if (utility::isPostfix(" (framework directory)", path)) { - frameworkPaths.push_back(FilePath(utility::replace(path, " (framework directory)", "")).makeCanonical()); + FilePath p = FilePath(utility::replace(path, " (framework directory)", "")).makeCanonical(); + if (p.exists()) + { + frameworkPaths.push_back(p); + } } } return frameworkPaths; diff --git a/src/lib_gui/utility/path_detector/cxx_header/CxxHeaderPathDetector.cpp b/src/lib_gui/utility/path_detector/cxx_header/CxxHeaderPathDetector.cpp index 46af08fe..2b9d137e 100644 --- a/src/lib_gui/utility/path_detector/cxx_header/CxxHeaderPathDetector.cpp +++ b/src/lib_gui/utility/path_detector/cxx_header/CxxHeaderPathDetector.cpp @@ -19,6 +19,7 @@ std::vector CxxHeaderPathDetector::getPaths() const for (const std::string& path : paths) { if (!utility::isPostfix(" (framework directory)", path) && + FilePath(path).getCanonical().exists() && !FilePath(path).getCanonical().getConcatenated(L"/stdarg.h").exists()) { headerSearchPaths.push_back(FilePath(path).makeCanonical());