forked from qt-creator/qt-creator
ProjectExplorer: Rename IncludePathType to HeaderPathType
It is the type used by the HeaderPath class, so reflect that in the name. I also considered to rename HeaderPath to IncludePath, but that name is reflected in a lot of users, which would also need to be adjusted for consistency. That would blow up the patch size for little value IMHO. Change-Id: I51421dbd3ab8b2874dc32fc82dc394c9b93ce5e9 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -198,7 +198,7 @@ void CompilerOptionsBuilder::enableExceptions()
|
||||
|
||||
void CompilerOptionsBuilder::addHeaderPathOptions()
|
||||
{
|
||||
using ProjectExplorer::IncludePathType;
|
||||
using ProjectExplorer::HeaderPathType;
|
||||
|
||||
QStringList result;
|
||||
|
||||
@@ -212,15 +212,15 @@ void CompilerOptionsBuilder::addHeaderPathOptions()
|
||||
QString prefix;
|
||||
Utils::FileName path;
|
||||
switch (headerPath.type) {
|
||||
case IncludePathType::Framework:
|
||||
case HeaderPathType::Framework:
|
||||
prefix = QLatin1String("-F");
|
||||
break;
|
||||
case IncludePathType::System:
|
||||
case HeaderPathType::System:
|
||||
prefix = "-isystem";
|
||||
break;
|
||||
default: // This shouldn't happen, but let's be nice..:
|
||||
// intentional fall-through:
|
||||
case IncludePathType::User:
|
||||
case HeaderPathType::User:
|
||||
prefix = includeDirOptionForPath(headerPath.path);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -89,9 +89,9 @@ QString Utils::toString(CPlusPlus::Document::DiagnosticMessage::Level level)
|
||||
return QString();
|
||||
}
|
||||
|
||||
QString Utils::toString(ProjectExplorer::IncludePathType type)
|
||||
QString Utils::toString(ProjectExplorer::HeaderPathType type)
|
||||
{
|
||||
#define CASE_LANGUAGEVERSION(x) case ProjectExplorer::IncludePathType::x: return QLatin1String(#x"Path")
|
||||
#define CASE_LANGUAGEVERSION(x) case ProjectExplorer::HeaderPathType::x: return QLatin1String(#x"Path")
|
||||
switch (type) {
|
||||
CASE_LANGUAGEVERSION(Invalid);
|
||||
CASE_LANGUAGEVERSION(User);
|
||||
@@ -466,14 +466,14 @@ Dumper::~Dumper()
|
||||
m_out << "*** END Code Model Inspection Report\n";
|
||||
}
|
||||
|
||||
static void printIncludeType(QTextStream &out, ProjectExplorer::IncludePathType type)
|
||||
static void printIncludeType(QTextStream &out, ProjectExplorer::HeaderPathType type)
|
||||
{
|
||||
using ProjectExplorer::IncludePathType;
|
||||
using ProjectExplorer::HeaderPathType;
|
||||
switch (type) {
|
||||
case IncludePathType::Invalid: out << "(invalid include path)"; break;
|
||||
case IncludePathType::User: out << "(user include path)"; break;
|
||||
case IncludePathType::System: out << "(system include path)"; break;
|
||||
case IncludePathType::Framework: out << "(framework path)"; break;
|
||||
case HeaderPathType::Invalid: out << "(invalid include path)"; break;
|
||||
case HeaderPathType::User: out << "(user include path)"; break;
|
||||
case HeaderPathType::System: out << "(system include path)"; break;
|
||||
case HeaderPathType::Framework: out << "(framework path)"; break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ struct CPPTOOLS_EXPORT Utils
|
||||
static QString toString(const QDateTime &dateTime);
|
||||
static QString toString(CPlusPlus::Document::CheckMode checkMode);
|
||||
static QString toString(CPlusPlus::Document::DiagnosticMessage::Level level);
|
||||
static QString toString(ProjectExplorer::IncludePathType type);
|
||||
static QString toString(ProjectExplorer::HeaderPathType type);
|
||||
static QString toString(CppTools::ProjectPart::LanguageVersion languageVersion);
|
||||
static QString toString(CppTools::ProjectPart::LanguageExtensions languageExtension);
|
||||
static QString toString(CppTools::ProjectPart::QtVersion qtVersion);
|
||||
|
||||
@@ -1260,7 +1260,7 @@ bool InternalCppCompletionAssistProcessor::completeInclude(const QTextCursor &cu
|
||||
// Make completion for all relevant includes
|
||||
ProjectExplorer::HeaderPaths headerPaths = m_interface->headerPaths();
|
||||
const ProjectExplorer::HeaderPath currentFilePath(QFileInfo(m_interface->fileName()).path(),
|
||||
ProjectExplorer::IncludePathType::User);
|
||||
ProjectExplorer::HeaderPathType::User);
|
||||
if (!headerPaths.contains(currentFilePath))
|
||||
headerPaths.append(currentFilePath);
|
||||
|
||||
|
||||
@@ -186,16 +186,16 @@ void CppToolsPlugin::test_modelmanager_paths_are_clean()
|
||||
ProjectPart::Ptr part(new ProjectPart);
|
||||
part->qtVersion = ProjectPart::Qt5;
|
||||
part->projectMacros = {ProjectExplorer::Macro("OH_BEHAVE", "-1")};
|
||||
part->headerPaths = {{testDataDir.includeDir(false), IncludePathType::User},
|
||||
{testDataDir.frameworksDir(false), IncludePathType::Framework}};
|
||||
part->headerPaths = {{testDataDir.includeDir(false), HeaderPathType::User},
|
||||
{testDataDir.frameworksDir(false), HeaderPathType::Framework}};
|
||||
pi.appendProjectPart(part);
|
||||
|
||||
mm->updateProjectInfo(pi);
|
||||
|
||||
ProjectExplorer::HeaderPaths headerPaths = mm->headerPaths();
|
||||
QCOMPARE(headerPaths.size(), 2);
|
||||
QVERIFY(headerPaths.contains({testDataDir.includeDir(), IncludePathType::User}));
|
||||
QVERIFY(headerPaths.contains({testDataDir.frameworksDir(), IncludePathType::Framework}));
|
||||
QVERIFY(headerPaths.contains({testDataDir.includeDir(), HeaderPathType::User}));
|
||||
QVERIFY(headerPaths.contains({testDataDir.frameworksDir(), HeaderPathType::Framework}));
|
||||
}
|
||||
|
||||
/// Check: Frameworks headers are resolved.
|
||||
@@ -215,8 +215,8 @@ void CppToolsPlugin::test_modelmanager_framework_headers()
|
||||
ProjectPart::Ptr part(new ProjectPart);
|
||||
part->qtVersion = ProjectPart::Qt5;
|
||||
part->projectMacros = {{"OH_BEHAVE", "-1"}};
|
||||
part->headerPaths = {{testDataDir.includeDir(false), IncludePathType::User},
|
||||
{testDataDir.frameworksDir(false), IncludePathType::Framework}};
|
||||
part->headerPaths = {{testDataDir.includeDir(false), HeaderPathType::User},
|
||||
{testDataDir.frameworksDir(false), HeaderPathType::Framework}};
|
||||
const QString &source = testDataDir.fileFromSourcesDir(
|
||||
_("test_modelmanager_framework_headers.cpp"));
|
||||
part->files << ProjectFile(source, ProjectFile::CXXSource);
|
||||
@@ -262,7 +262,7 @@ void CppToolsPlugin::test_modelmanager_refresh_also_includes_of_project_files()
|
||||
ProjectPart::Ptr part(new ProjectPart);
|
||||
part->qtVersion = ProjectPart::Qt5;
|
||||
part->projectMacros = {{"OH_BEHAVE", "-1"}};
|
||||
part->headerPaths = {{testDataDir.includeDir(false), IncludePathType::User}};
|
||||
part->headerPaths = {{testDataDir.includeDir(false), HeaderPathType::User}};
|
||||
part->files.append(ProjectFile(testCpp, ProjectFile::CXXSource));
|
||||
pi.appendProjectPart(part);
|
||||
|
||||
@@ -754,7 +754,7 @@ void CppToolsPlugin::test_modelmanager_defines_per_project()
|
||||
part1->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
||||
part1->qtVersion = ProjectPart::NoQt;
|
||||
part1->projectMacros = {{"SUB1"}};
|
||||
part1->headerPaths = {{testDataDirectory.includeDir(false), IncludePathType::User}};
|
||||
part1->headerPaths = {{testDataDirectory.includeDir(false), HeaderPathType::User}};
|
||||
|
||||
ProjectPart::Ptr part2(new ProjectPart);
|
||||
part2->projectFile = QLatin1String("project1.projectfile");
|
||||
@@ -762,7 +762,7 @@ void CppToolsPlugin::test_modelmanager_defines_per_project()
|
||||
part2->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
||||
part2->qtVersion = ProjectPart::NoQt;
|
||||
part2->projectMacros = {{"SUB2"}};
|
||||
part2->headerPaths = {{testDataDirectory.includeDir(false), IncludePathType::User}};
|
||||
part2->headerPaths = {{testDataDirectory.includeDir(false), HeaderPathType::User}};
|
||||
|
||||
ProjectInfo pi = ProjectInfo(project);
|
||||
pi.appendProjectPart(part1);
|
||||
@@ -818,7 +818,7 @@ void CppToolsPlugin::test_modelmanager_precompiled_headers()
|
||||
part1->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
||||
part1->qtVersion = ProjectPart::NoQt;
|
||||
part1->precompiledHeaders.append(pch1File);
|
||||
part1->headerPaths = {{testDataDirectory.includeDir(false), IncludePathType::User}};
|
||||
part1->headerPaths = {{testDataDirectory.includeDir(false), HeaderPathType::User}};
|
||||
part1->updateLanguageFeatures();
|
||||
|
||||
ProjectPart::Ptr part2(new ProjectPart);
|
||||
@@ -827,7 +827,7 @@ void CppToolsPlugin::test_modelmanager_precompiled_headers()
|
||||
part2->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
||||
part2->qtVersion = ProjectPart::NoQt;
|
||||
part2->precompiledHeaders.append(pch2File);
|
||||
part2->headerPaths = {{testDataDirectory.includeDir(false), IncludePathType::User}};
|
||||
part2->headerPaths = {{testDataDirectory.includeDir(false), HeaderPathType::User}};
|
||||
part2->updateLanguageFeatures();
|
||||
|
||||
ProjectInfo pi = ProjectInfo(project);
|
||||
@@ -899,13 +899,13 @@ void CppToolsPlugin::test_modelmanager_defines_per_editor()
|
||||
part1->files.append(ProjectFile(main1File, ProjectFile::CXXSource));
|
||||
part1->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
||||
part1->qtVersion = ProjectPart::NoQt;
|
||||
part1->headerPaths = {{testDataDirectory.includeDir(false), IncludePathType::User}};
|
||||
part1->headerPaths = {{testDataDirectory.includeDir(false), HeaderPathType::User}};
|
||||
|
||||
ProjectPart::Ptr part2(new ProjectPart);
|
||||
part2->files.append(ProjectFile(main2File, ProjectFile::CXXSource));
|
||||
part2->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
||||
part2->qtVersion = ProjectPart::NoQt;
|
||||
part2->headerPaths = {{testDataDirectory.includeDir(false), IncludePathType::User}};
|
||||
part2->headerPaths = {{testDataDirectory.includeDir(false), HeaderPathType::User}};
|
||||
|
||||
ProjectInfo pi = ProjectInfo(project);
|
||||
pi.appendProjectPart(part1);
|
||||
|
||||
@@ -96,7 +96,7 @@ void RawProjectPart::setIncludePaths(const QStringList &includePaths)
|
||||
headerPaths.clear();
|
||||
|
||||
foreach (const QString &includeFile, includePaths) {
|
||||
ProjectExplorer::HeaderPath hp(includeFile, ProjectExplorer::IncludePathType::User);
|
||||
ProjectExplorer::HeaderPath hp(includeFile, ProjectExplorer::HeaderPathType::User);
|
||||
|
||||
// The simple project managers are utterly ignorant of frameworks on macOS, and won't report
|
||||
// framework paths. The work-around is to check if the include path ends in ".framework",
|
||||
@@ -104,7 +104,7 @@ void RawProjectPart::setIncludePaths(const QStringList &includePaths)
|
||||
if (includeFile.endsWith(QLatin1String(".framework"))) {
|
||||
const int slashIdx = includeFile.lastIndexOf(QLatin1Char('/'));
|
||||
if (slashIdx != -1) {
|
||||
hp = {includeFile.left(slashIdx), ProjectExplorer::IncludePathType::Framework};
|
||||
hp = {includeFile.left(slashIdx), ProjectExplorer::HeaderPathType::Framework};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -132,13 +132,13 @@ void CppSourceProcessor::setWorkingCopy(const WorkingCopy &workingCopy)
|
||||
|
||||
void CppSourceProcessor::setHeaderPaths(const ProjectExplorer::HeaderPaths &headerPaths)
|
||||
{
|
||||
using ProjectExplorer::IncludePathType;
|
||||
using ProjectExplorer::HeaderPathType;
|
||||
m_headerPaths.clear();
|
||||
|
||||
for (int i = 0, ei = headerPaths.size(); i < ei; ++i) {
|
||||
const ProjectExplorer::HeaderPath &path = headerPaths.at(i);
|
||||
|
||||
if (path.type == IncludePathType::User || path.type == IncludePathType::System)
|
||||
if (path.type == HeaderPathType::User || path.type == HeaderPathType::System)
|
||||
m_headerPaths.append({cleanPath(path.path), path.type});
|
||||
else
|
||||
addFrameworkPath(path);
|
||||
@@ -165,7 +165,7 @@ void CppSourceProcessor::addFrameworkPath(const ProjectExplorer::HeaderPath &fra
|
||||
// in the frameworks we're linking against. If we would have that, then we could
|
||||
// add only those private frameworks.
|
||||
const ProjectExplorer::HeaderPath cleanFrameworkPath(cleanPath(frameworkPath.path),
|
||||
ProjectExplorer::IncludePathType::Framework);
|
||||
ProjectExplorer::HeaderPathType::Framework);
|
||||
if (!m_headerPaths.contains(cleanFrameworkPath))
|
||||
m_headerPaths.append(cleanFrameworkPath);
|
||||
|
||||
@@ -178,7 +178,7 @@ void CppSourceProcessor::addFrameworkPath(const ProjectExplorer::HeaderPath &fra
|
||||
QLatin1String("Frameworks"));
|
||||
if (privateFrameworks.exists() && privateFrameworks.isDir())
|
||||
addFrameworkPath({privateFrameworks.absoluteFilePath(),
|
||||
ProjectExplorer::IncludePathType::Framework});
|
||||
ProjectExplorer::HeaderPathType::Framework});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ using namespace CPlusPlus;
|
||||
using namespace CppTools;
|
||||
using namespace CppTools::Tests;
|
||||
using namespace CppTools::Internal;
|
||||
using ProjectExplorer::IncludePathType;
|
||||
using ProjectExplorer::HeaderPathType;
|
||||
|
||||
typedef Document::Include Include;
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
QScopedPointer<CppSourceProcessor> sourceProcessor(
|
||||
CppModelManager::createSourceProcessor());
|
||||
const ProjectExplorer::HeaderPath hp(TestIncludePaths::directoryOfTestFile(),
|
||||
IncludePathType::User);
|
||||
HeaderPathType::User);
|
||||
sourceProcessor->setHeaderPaths({hp});
|
||||
sourceProcessor->run(filePath);
|
||||
|
||||
@@ -208,8 +208,8 @@ void CppToolsPlugin::test_cppsourceprocessor_includeNext()
|
||||
|
||||
CppSourceProcessor::DocumentCallback documentCallback = [](const Document::Ptr &){};
|
||||
CppSourceProcessor sourceProcessor(Snapshot(), documentCallback);
|
||||
ProjectExplorer::HeaderPaths headerPaths = {{customHeaderPath, IncludePathType::User},
|
||||
{systemHeaderPath, IncludePathType::User}};
|
||||
ProjectExplorer::HeaderPaths headerPaths = {{customHeaderPath, HeaderPathType::User},
|
||||
{systemHeaderPath, HeaderPathType::User}};
|
||||
sourceProcessor.setHeaderPaths(headerPaths);
|
||||
|
||||
sourceProcessor.run(mainFilePath);
|
||||
|
||||
@@ -535,7 +535,7 @@ static QList<Include> includesForSource(const QString &filePath)
|
||||
cmm->GC();
|
||||
QScopedPointer<CppSourceProcessor> sourceProcessor(CppModelManager::createSourceProcessor());
|
||||
sourceProcessor->setHeaderPaths({{TestIncludePaths::globalIncludePath(),
|
||||
ProjectExplorer::IncludePathType::User}});
|
||||
ProjectExplorer::HeaderPathType::User}});
|
||||
sourceProcessor->run(filePath);
|
||||
|
||||
Document::Ptr document = cmm->document(filePath);
|
||||
|
||||
Reference in New Issue
Block a user