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:
@@ -120,14 +120,14 @@ static void addSystemHeaderPaths(QList<ProjectExplorer::HeaderPath> &paths,
|
||||
Utils::FileName includePath = stdcppPath;
|
||||
Utils::FileName cppLibsPath = stdcppPath;
|
||||
cppLibsPath.appendPath("libs/" + getArch(triple) + "/include/");
|
||||
paths.prepend({cppLibsPath.toString(), ProjectExplorer::IncludePathType::System});
|
||||
paths.prepend({cppLibsPath.toString(), ProjectExplorer::HeaderPathType::System});
|
||||
includePath.appendPath("include/");
|
||||
paths.prepend({includePath.toString(), ProjectExplorer::IncludePathType::System});
|
||||
paths.prepend({includePath.toString(), ProjectExplorer::HeaderPathType::System});
|
||||
|
||||
paths.prepend({ndkPath.toString() + "/sysroot/usr/include/" + triple,
|
||||
ProjectExplorer::IncludePathType::System});
|
||||
ProjectExplorer::HeaderPathType::System});
|
||||
paths.prepend({ndkPath.toString() + "/sysroot/usr/include",
|
||||
ProjectExplorer::IncludePathType::System});
|
||||
ProjectExplorer::HeaderPathType::System});
|
||||
}
|
||||
|
||||
AndroidToolChain::SystemHeaderPathsRunner AndroidToolChain::createSystemHeaderPathsRunner() const
|
||||
|
||||
@@ -467,7 +467,7 @@ bool ClangCompletionAssistProcessor::completeInclude(const QTextCursor &cursor)
|
||||
// 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);
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ static const ProjectExplorer::HeaderPaths toHeaderPaths(const QStringList &paths
|
||||
{
|
||||
ProjectExplorer::HeaderPaths result;
|
||||
foreach (const QString &path, paths)
|
||||
result.push_back({path, ProjectExplorer::IncludePathType::User});
|
||||
result.push_back({path, ProjectExplorer::HeaderPathType::User});
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -270,7 +270,7 @@ void QuickFixOperationTest::run(const QList<QuickFixTestDocument::Ptr> &testDocu
|
||||
int operationIndex)
|
||||
{
|
||||
ProjectExplorer::HeaderPaths headerPaths;
|
||||
headerPaths.push_back({headerPath, ProjectExplorer::IncludePathType::User});
|
||||
headerPaths.push_back({headerPath, ProjectExplorer::HeaderPathType::User});
|
||||
QuickFixOperationTest(testDocuments, factory, headerPaths, operationIndex);
|
||||
}
|
||||
|
||||
@@ -3673,7 +3673,7 @@ void CppEditorPlugin::test_quickfix_AddIncludeForUndefinedIdentifier_noDoubleQtH
|
||||
testDocuments << QuickFixTestDocument::create(base + "/fileWantsToUseQDir.cpp", original, expected);
|
||||
|
||||
ProjectExplorer::HeaderPaths headerPaths{{TestIncludePaths::globalQtCoreIncludePath(),
|
||||
ProjectExplorer::IncludePathType::User}};
|
||||
ProjectExplorer::HeaderPathType::User}};
|
||||
|
||||
AddIncludeForUndefinedIdentifier factory;
|
||||
const QStringList expectedOperations = QStringList("Add #include <QDir>");
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -219,7 +219,7 @@ ToolChain::SystemHeaderPathsRunner AbstractMsvcToolChain::createSystemHeaderPath
|
||||
QMutexLocker locker(m_headerPathsMutex);
|
||||
if (m_headerPaths.isEmpty()) {
|
||||
foreach (const QString &path, env.value(QLatin1String("INCLUDE")).split(QLatin1Char(';')))
|
||||
m_headerPaths.append({path, IncludePathType::System});
|
||||
m_headerPaths.append({path, HeaderPathType::System});
|
||||
}
|
||||
return m_headerPaths;
|
||||
};
|
||||
|
||||
@@ -175,7 +175,7 @@ ToolChain::SystemHeaderPathsRunner CustomToolChain::createSystemHeaderPathsRunne
|
||||
QList<HeaderPath> flagHeaderPaths;
|
||||
for (const QString &cxxFlag : cxxFlags) {
|
||||
if (cxxFlag.startsWith(QLatin1String("-I"))) {
|
||||
flagHeaderPaths.push_back({cxxFlag.mid(2).trimmed(), IncludePathType::System});
|
||||
flagHeaderPaths.push_back({cxxFlag.mid(2).trimmed(), HeaderPathType::System});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ QStringList CustomToolChain::headerPathsList() const
|
||||
void CustomToolChain::setHeaderPaths(const QStringList &list)
|
||||
{
|
||||
QList<HeaderPath> tmp = Utils::transform(list, [](const QString &headerPath) {
|
||||
return HeaderPath(headerPath.trimmed(), IncludePathType::System);
|
||||
return HeaderPath(headerPath.trimmed(), HeaderPathType::System);
|
||||
});
|
||||
|
||||
if (m_systemHeaderPaths == tmp)
|
||||
|
||||
@@ -151,20 +151,20 @@ QList<HeaderPath> GccToolChain::gccHeaderPaths(const FileName &gcc, const QStrin
|
||||
}
|
||||
|
||||
if (!line.isEmpty() && line.startsWith("#include")) {
|
||||
auto kind = IncludePathType::User;
|
||||
auto kind = HeaderPathType::User;
|
||||
while (cpp.canReadLine()) {
|
||||
line = cpp.readLine();
|
||||
if (line.startsWith("#include")) {
|
||||
kind = IncludePathType::System;
|
||||
kind = HeaderPathType::System;
|
||||
} else if (! line.isEmpty() && QChar(line.at(0)).isSpace()) {
|
||||
IncludePathType thisHeaderKind = kind;
|
||||
HeaderPathType thisHeaderKind = kind;
|
||||
|
||||
line = line.trimmed();
|
||||
|
||||
const int index = line.indexOf(" (framework directory)");
|
||||
if (index != -1) {
|
||||
line.truncate(index);
|
||||
thisHeaderKind = IncludePathType::Framework;
|
||||
thisHeaderKind = HeaderPathType::Framework;
|
||||
}
|
||||
|
||||
const QString headerPath = QFileInfo(QFile::decodeName(line)).canonicalFilePath();
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
enum class IncludePathType {
|
||||
enum class HeaderPathType {
|
||||
Invalid,
|
||||
User,
|
||||
System,
|
||||
@@ -41,18 +41,18 @@ class HeaderPath
|
||||
{
|
||||
public:
|
||||
HeaderPath() = default;
|
||||
HeaderPath(const QString &path, IncludePathType type)
|
||||
HeaderPath(const QString &path, HeaderPathType type)
|
||||
: path(path), type(type)
|
||||
{ }
|
||||
|
||||
bool isValid() const
|
||||
{
|
||||
return type != IncludePathType::Invalid;
|
||||
return type != HeaderPathType::Invalid;
|
||||
}
|
||||
|
||||
bool isFrameworkPath() const
|
||||
{
|
||||
return type == IncludePathType::Framework;
|
||||
return type == HeaderPathType::Framework;
|
||||
}
|
||||
|
||||
bool operator==(const HeaderPath &other) const
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
}
|
||||
|
||||
QString path;
|
||||
IncludePathType type = IncludePathType::Invalid;
|
||||
HeaderPathType type = HeaderPathType::Invalid;
|
||||
};
|
||||
|
||||
inline uint qHash(const HeaderPath &key, uint seed = 0)
|
||||
|
||||
@@ -983,7 +983,7 @@ void QbsProject::updateCppCodeModel()
|
||||
list.removeDuplicates();
|
||||
ProjectExplorer::HeaderPaths grpHeaderPaths;
|
||||
foreach (const QString &p, list)
|
||||
grpHeaderPaths += {FileName::fromUserInput(p).toString(), IncludePathType::User};
|
||||
grpHeaderPaths += {FileName::fromUserInput(p).toString(), HeaderPathType::User};
|
||||
|
||||
list = props.getModulePropertiesAsStringList(QLatin1String(CONFIG_CPP_MODULE),
|
||||
QLatin1String(CONFIG_FRAMEWORKPATHS));
|
||||
@@ -991,7 +991,7 @@ void QbsProject::updateCppCodeModel()
|
||||
QLatin1String(CONFIG_SYSTEM_FRAMEWORKPATHS)));
|
||||
list.removeDuplicates();
|
||||
foreach (const QString &p, list)
|
||||
grpHeaderPaths += {FileName::fromUserInput(p).toString(), IncludePathType::Framework};
|
||||
grpHeaderPaths += {FileName::fromUserInput(p).toString(), HeaderPathType::Framework};
|
||||
|
||||
rpp.setHeaderPaths(grpHeaderPaths);
|
||||
|
||||
|
||||
@@ -315,13 +315,13 @@ void QmakeProject::updateCppCodeModel()
|
||||
// Header paths
|
||||
ProjectExplorer::HeaderPaths headerPaths;
|
||||
foreach (const QString &inc, pro->variableValue(Variable::IncludePath)) {
|
||||
const ProjectExplorer::HeaderPath headerPath{inc, IncludePathType::User};
|
||||
const ProjectExplorer::HeaderPath headerPath{inc, HeaderPathType::User};
|
||||
if (!headerPaths.contains(headerPath))
|
||||
headerPaths += headerPath;
|
||||
}
|
||||
|
||||
if (qtVersion && !qtVersion->frameworkInstallPath().isEmpty()) {
|
||||
headerPaths += {qtVersion->frameworkInstallPath(), IncludePathType::Framework};
|
||||
headerPaths += {qtVersion->frameworkInstallPath(), HeaderPathType::Framework};
|
||||
}
|
||||
rpp.setHeaderPaths(headerPaths);
|
||||
|
||||
|
||||
@@ -253,10 +253,10 @@ TEST_F(ProjectUpdater, CreateSortedCompilerMacros)
|
||||
|
||||
TEST_F(ProjectUpdater, CreateSortedIncludeSearchPaths)
|
||||
{
|
||||
ProjectExplorer::HeaderPath includePath{"/to/path1", ProjectExplorer::IncludePathType::User};
|
||||
ProjectExplorer::HeaderPath includePath2{"/to/path2", ProjectExplorer::IncludePathType::User};
|
||||
ProjectExplorer::HeaderPath includePath{"/to/path1", ProjectExplorer::HeaderPathType::User};
|
||||
ProjectExplorer::HeaderPath includePath2{"/to/path2", ProjectExplorer::HeaderPathType::User};
|
||||
ProjectExplorer::HeaderPath invalidPath;
|
||||
ProjectExplorer::HeaderPath frameworkPath{"/framework/path", ProjectExplorer::IncludePathType::Framework};
|
||||
ProjectExplorer::HeaderPath frameworkPath{"/framework/path", ProjectExplorer::HeaderPathType::Framework};
|
||||
|
||||
auto paths = updater.createIncludeSearchPaths({frameworkPath, includePath2, includePath, invalidPath});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user