src: Added logic and UI for excluding files and directories from analysis

bug id = 68, 47
This commit is contained in:
Eberhard Graether
2016-06-07 10:46:36 +02:00
parent 6edcd77eb2
commit b10c55e7f9
10 changed files with 113 additions and 7 deletions
@@ -244,7 +244,7 @@ bool QtProjectWizzardContentPathsSource::check()
QStringList QtProjectWizzardContentPathsSource::getFileNames() const
{
std::vector<FilePath> sourcePaths = m_settings->getAbsoluteSourcePaths();
std::vector<FilePath> excludePaths = m_settings->getAbsoluteExcludePaths();
std::vector<std::string> extensions = m_settings->getSourceExtensions();
std::vector<FileInfo> fileInfos = FileSystem::getFileInfosFromPaths(sourcePaths, extensions);
@@ -255,6 +255,21 @@ QStringList QtProjectWizzardContentPathsSource::getFileNames() const
{
FilePath path = info.path;
bool excluded = false;
for (FilePath p : excludePaths)
{
if (p == path || p.contains(path))
{
excluded = true;
break;
}
}
if (excluded)
{
continue;
}
if (projectPath.exists())
{
path = path.relativeTo(projectPath);
@@ -294,6 +309,30 @@ QtProjectWizzardContentPathsCDBHeader::QtProjectWizzardContentPathsCDBHeader(
);
}
QtProjectWizzardContentPathsExclude::QtProjectWizzardContentPathsExclude(
ProjectSettings* settings, QtProjectWizzardWindow* window
)
: QtProjectWizzardContentPaths(settings, window)
{
setInfo(
"Exclude Paths",
"Add all directories or files you want to exclude from the analysis.",
"Exclude Paths define the files and directories that will be left out from the analysis by Coati."
);
}
void QtProjectWizzardContentPathsExclude::load()
{
m_list->setList(m_settings->getExcludePaths());
}
void QtProjectWizzardContentPathsExclude::save()
{
m_settings->setExcludePaths(m_list->getList());
}
QtProjectWizzardContentPathsHeaderSearch::QtProjectWizzardContentPathsHeaderSearch(
ProjectSettings* settings, QtProjectWizzardWindow* window
)