From 24c0f86edae915dd30a4faf9a60051ff1511d079 Mon Sep 17 00:00:00 2001 From: mlangkabel Date: Fri, 15 Jun 2018 18:53:50 +0200 Subject: [PATCH] logic: only return existing paths in indexed header path detection of CDB, CBP and Sonargraph sourcegroups --- .../QtProjectWizzardContentPaths.cpp | 35 +++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp index 40988f11..f23ab8af 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp @@ -289,7 +289,17 @@ std::vector QtProjectWizzardContentIndexedHeaderPaths::getIndexedPaths LOG_WARNING("Unable to fetch indexed header paths. The provided Sonargraph project path does not exist."); } } - return utility::getTopLevelPaths(indexedHeaderPaths); + + std::vector topLevelPaths; + for (const FilePath& path : utility::getTopLevelPaths(indexedHeaderPaths)) + { + if (path.exists()) + { + topLevelPaths.push_back(path); + } + } + + return topLevelPaths; } std::vector QtProjectWizzardContentIndexedHeaderPaths::getIndexedPathsDerivedFromCodeblocksProject( @@ -319,7 +329,17 @@ std::vector QtProjectWizzardContentIndexedHeaderPaths::getIndexedPaths LOG_WARNING("Unable to fetch indexed header paths. The provided Sonargraph project path does not exist."); } } - return utility::getTopLevelPaths(indexedHeaderPaths); + + std::vector topLevelPaths; + for (const FilePath& path : utility::getTopLevelPaths(indexedHeaderPaths)) + { + if (path.exists()) + { + topLevelPaths.push_back(path); + } + } + + return topLevelPaths; } std::vector QtProjectWizzardContentIndexedHeaderPaths::getIndexedPathsDerivedFromCDB( @@ -348,7 +368,16 @@ std::vector QtProjectWizzardContentIndexedHeaderPaths::getIndexedPaths } } - return utility::getTopLevelPaths(indexedHeaderPaths); + std::vector topLevelPaths; + for (const FilePath& path : utility::getTopLevelPaths(indexedHeaderPaths)) + { + if (path.exists()) + { + topLevelPaths.push_back(path); + } + } + + return topLevelPaths; } QtProjectWizzardContentIndexedHeaderPaths::QtProjectWizzardContentIndexedHeaderPaths(