CppTools: Move ProjectPart in its own header file

Also extracting inline HeaderPath class and change projects list in vector
because the size is  larger than a pointer.

Change-Id: I885fdff3fe9bccc877634d1615249755f5b674fd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Marco Bubke
2016-01-13 14:12:15 +01:00
parent 42d570a3fe
commit 2b4cadf1fe
34 changed files with 532 additions and 372 deletions

View File

@@ -129,15 +129,15 @@ CppSourceProcessor::~CppSourceProcessor()
void CppSourceProcessor::setWorkingCopy(const WorkingCopy &workingCopy)
{ m_workingCopy = workingCopy; }
void CppSourceProcessor::setHeaderPaths(const ProjectPart::HeaderPaths &headerPaths)
void CppSourceProcessor::setHeaderPaths(const ProjectPartHeaderPaths &headerPaths)
{
m_headerPaths.clear();
for (int i = 0, ei = headerPaths.size(); i < ei; ++i) {
const ProjectPart::HeaderPath &path = headerPaths.at(i);
const ProjectPartHeaderPath &path = headerPaths.at(i);
if (path.type == ProjectPart::HeaderPath::IncludePath)
m_headerPaths.append(ProjectPart::HeaderPath(cleanPath(path.path), path.type));
if (path.type == ProjectPartHeaderPath::IncludePath)
m_headerPaths.append(ProjectPartHeaderPath(cleanPath(path.path), path.type));
else
addFrameworkPath(path);
}
@@ -155,15 +155,15 @@ void CppSourceProcessor::setLanguageFeatures(const LanguageFeatures languageFeat
// has private frameworks in:
// <framework-path>/ApplicationServices.framework/Frameworks
// if the "Frameworks" folder exists inside the top level framework.
void CppSourceProcessor::addFrameworkPath(const ProjectPart::HeaderPath &frameworkPath)
void CppSourceProcessor::addFrameworkPath(const ProjectPartHeaderPath &frameworkPath)
{
QTC_ASSERT(frameworkPath.isFrameworkPath(), return);
// The algorithm below is a bit too eager, but that's because we're not getting
// in the frameworks we're linking against. If we would have that, then we could
// add only those private frameworks.
const ProjectPart::HeaderPath cleanFrameworkPath(cleanPath(frameworkPath.path),
frameworkPath.type);
const ProjectPartHeaderPath cleanFrameworkPath(cleanPath(frameworkPath.path),
frameworkPath.type);
if (!m_headerPaths.contains(cleanFrameworkPath))
m_headerPaths.append(cleanFrameworkPath);
@@ -175,8 +175,8 @@ void CppSourceProcessor::addFrameworkPath(const ProjectPart::HeaderPath &framewo
const QFileInfo privateFrameworks(framework.absoluteFilePath(),
QLatin1String("Frameworks"));
if (privateFrameworks.exists() && privateFrameworks.isDir())
addFrameworkPath(ProjectPart::HeaderPath(privateFrameworks.absoluteFilePath(),
frameworkPath.type));
addFrameworkPath(ProjectPartHeaderPath(privateFrameworks.absoluteFilePath(),
frameworkPath.type));
}
}
@@ -312,7 +312,7 @@ QString CppSourceProcessor::resolveFile_helper(const QString &fileName, IncludeT
const QString name = frameworkName + QLatin1String(".framework/Headers/")
+ fileName.mid(index + 1);
foreach (const ProjectPart::HeaderPath &headerPath, m_headerPaths) {
foreach (const ProjectPartHeaderPath &headerPath, m_headerPaths) {
if (!headerPath.isFrameworkPath())
continue;
const QString path = headerPath.path + name;