Commit 2b4cadf1 authored by Marco Bubke's avatar Marco Bubke

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: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
parent 42d570a3
...@@ -41,7 +41,7 @@ ClangCompletionAssistInterface::ClangCompletionAssistInterface( ...@@ -41,7 +41,7 @@ ClangCompletionAssistInterface::ClangCompletionAssistInterface(
int position, int position,
const QString &fileName, const QString &fileName,
TextEditor::AssistReason reason, TextEditor::AssistReason reason,
const CppTools::ProjectPart::HeaderPaths &headerPaths, const CppTools::ProjectPartHeaderPaths &headerPaths,
const CPlusPlus::LanguageFeatures &features) const CPlusPlus::LanguageFeatures &features)
: AssistInterface(textEditorWidget->document(), position, fileName, reason) : AssistInterface(textEditorWidget->document(), position, fileName, reason)
, m_ipcCommunicator(ipcCommunicator) , m_ipcCommunicator(ipcCommunicator)
...@@ -56,7 +56,7 @@ bool ClangCompletionAssistInterface::objcEnabled() const ...@@ -56,7 +56,7 @@ bool ClangCompletionAssistInterface::objcEnabled() const
return true; // TODO: return true; // TODO:
} }
const CppTools::ProjectPart::HeaderPaths &ClangCompletionAssistInterface::headerPaths() const const CppTools::ProjectPartHeaderPaths &ClangCompletionAssistInterface::headerPaths() const
{ {
return m_headerPaths; return m_headerPaths;
} }
...@@ -66,7 +66,7 @@ CPlusPlus::LanguageFeatures ClangCompletionAssistInterface::languageFeatures() c ...@@ -66,7 +66,7 @@ CPlusPlus::LanguageFeatures ClangCompletionAssistInterface::languageFeatures() c
return m_languageFeatures; return m_languageFeatures;
} }
void ClangCompletionAssistInterface::setHeaderPaths(const CppTools::ProjectPart::HeaderPaths &headerPaths) void ClangCompletionAssistInterface::setHeaderPaths(const CppTools::ProjectPartHeaderPaths &headerPaths)
{ {
m_headerPaths = headerPaths; m_headerPaths = headerPaths;
} }
......
...@@ -47,21 +47,21 @@ public: ...@@ -47,21 +47,21 @@ public:
int position, int position,
const QString &fileName, const QString &fileName,
TextEditor::AssistReason reason, TextEditor::AssistReason reason,
const CppTools::ProjectPart::HeaderPaths &headerPaths, const CppTools::ProjectPartHeaderPaths &headerPaths,
const CPlusPlus::LanguageFeatures &features); const CPlusPlus::LanguageFeatures &features);
IpcCommunicator &ipcCommunicator() const; IpcCommunicator &ipcCommunicator() const;
bool objcEnabled() const; bool objcEnabled() const;
const CppTools::ProjectPart::HeaderPaths &headerPaths() const; const CppTools::ProjectPartHeaderPaths &headerPaths() const;
CPlusPlus::LanguageFeatures languageFeatures() const; CPlusPlus::LanguageFeatures languageFeatures() const;
const TextEditor::TextEditorWidget *textEditorWidget() const; const TextEditor::TextEditorWidget *textEditorWidget() const;
void setHeaderPaths(const CppTools::ProjectPart::HeaderPaths &headerPaths); // For tests void setHeaderPaths(const CppTools::ProjectPartHeaderPaths &headerPaths); // For tests
private: private:
IpcCommunicator &m_ipcCommunicator; IpcCommunicator &m_ipcCommunicator;
QStringList m_options; QStringList m_options;
CppTools::ProjectPart::HeaderPaths m_headerPaths; CppTools::ProjectPartHeaderPaths m_headerPaths;
CPlusPlus::LanguageFeatures m_languageFeatures; CPlusPlus::LanguageFeatures m_languageFeatures;
const TextEditor::TextEditorWidget *m_textEditorWidget; const TextEditor::TextEditorWidget *m_textEditorWidget;
}; };
......
...@@ -565,9 +565,9 @@ bool ClangCompletionAssistProcessor::completeInclude(const QTextCursor &cursor) ...@@ -565,9 +565,9 @@ bool ClangCompletionAssistProcessor::completeInclude(const QTextCursor &cursor)
} }
// Make completion for all relevant includes // Make completion for all relevant includes
CppTools::ProjectPart::HeaderPaths headerPaths = m_interface->headerPaths(); CppTools::ProjectPartHeaderPaths headerPaths = m_interface->headerPaths();
const CppTools::ProjectPart::HeaderPath currentFilePath(QFileInfo(m_interface->fileName()).path(), const CppTools::ProjectPartHeaderPath currentFilePath(QFileInfo(m_interface->fileName()).path(),
CppTools::ProjectPart::HeaderPath::IncludePath); CppTools::ProjectPartHeaderPath::IncludePath);
if (!headerPaths.contains(currentFilePath)) if (!headerPaths.contains(currentFilePath))
headerPaths.append(currentFilePath); headerPaths.append(currentFilePath);
...@@ -575,7 +575,7 @@ bool ClangCompletionAssistProcessor::completeInclude(const QTextCursor &cursor) ...@@ -575,7 +575,7 @@ bool ClangCompletionAssistProcessor::completeInclude(const QTextCursor &cursor)
const ::Utils::MimeType mimeType = mdb.mimeTypeForName(QLatin1String("text/x-c++hdr")); const ::Utils::MimeType mimeType = mdb.mimeTypeForName(QLatin1String("text/x-c++hdr"));
const QStringList suffixes = mimeType.suffixes(); const QStringList suffixes = mimeType.suffixes();
foreach (const CppTools::ProjectPart::HeaderPath &headerPath, headerPaths) { foreach (const CppTools::ProjectPartHeaderPath &headerPath, headerPaths) {
QString realPath = headerPath.path; QString realPath = headerPath.path;
if (!directoryPrefix.isEmpty()) { if (!directoryPrefix.isEmpty()) {
realPath += QLatin1Char('/'); realPath += QLatin1Char('/');
......
...@@ -432,13 +432,13 @@ public: ...@@ -432,13 +432,13 @@ public:
QString senderLog; QString senderLog;
}; };
const CppTools::ProjectPart::HeaderPaths toHeaderPaths(const QStringList &paths) const CppTools::ProjectPartHeaderPaths toHeaderPaths(const QStringList &paths)
{ {
using namespace CppTools; using namespace CppTools;
ProjectPart::HeaderPaths result; ProjectPartHeaderPaths result;
foreach (const QString &path, paths) foreach (const QString &path, paths)
result << ProjectPart::HeaderPath(path, ProjectPart::HeaderPath::IncludePath); result << ProjectPartHeaderPath(path, ProjectPartHeaderPath::IncludePath);
return result; return result;
} }
......
...@@ -109,7 +109,7 @@ QList<QuickFixTestDocument::Ptr> singleDocument(const QByteArray &original, ...@@ -109,7 +109,7 @@ QList<QuickFixTestDocument::Ptr> singleDocument(const QByteArray &original,
} }
BaseQuickFixTestCase::BaseQuickFixTestCase(const QList<QuickFixTestDocument::Ptr> &testDocuments, BaseQuickFixTestCase::BaseQuickFixTestCase(const QList<QuickFixTestDocument::Ptr> &testDocuments,
const ProjectPart::HeaderPaths &headerPaths) const ProjectPartHeaderPaths &headerPaths)
: m_testDocuments(testDocuments) : m_testDocuments(testDocuments)
, m_cppCodeStylePreferences(0) , m_cppCodeStylePreferences(0)
, m_restoreHeaderPaths(false) , m_restoreHeaderPaths(false)
...@@ -229,7 +229,7 @@ static QString &removeTrailingWhitespace(QString &input) ...@@ -229,7 +229,7 @@ static QString &removeTrailingWhitespace(QString &input)
QuickFixOperationTest::QuickFixOperationTest(const QList<QuickFixTestDocument::Ptr> &testDocuments, QuickFixOperationTest::QuickFixOperationTest(const QList<QuickFixTestDocument::Ptr> &testDocuments,
CppQuickFixFactory *factory, CppQuickFixFactory *factory,
const ProjectPart::HeaderPaths &headerPaths, const ProjectPartHeaderPaths &headerPaths,
int operationIndex, int operationIndex,
const QByteArray &expectedFailMessage) const QByteArray &expectedFailMessage)
: BaseQuickFixTestCase(testDocuments, headerPaths) : BaseQuickFixTestCase(testDocuments, headerPaths)
...@@ -272,15 +272,15 @@ void QuickFixOperationTest::run(const QList<QuickFixTestDocument::Ptr> &testDocu ...@@ -272,15 +272,15 @@ void QuickFixOperationTest::run(const QList<QuickFixTestDocument::Ptr> &testDocu
const QString &headerPath, const QString &headerPath,
int operationIndex) int operationIndex)
{ {
ProjectPart::HeaderPaths headerPaths; ProjectPartHeaderPaths headerPaths;
headerPaths += ProjectPart::HeaderPath(headerPath, ProjectPart::HeaderPath::IncludePath); headerPaths += ProjectPartHeaderPath(headerPath, ProjectPartHeaderPath::IncludePath);
QuickFixOperationTest(testDocuments, factory, headerPaths, operationIndex); QuickFixOperationTest(testDocuments, factory, headerPaths, operationIndex);
} }
QuickFixOfferedOperationsTest::QuickFixOfferedOperationsTest( QuickFixOfferedOperationsTest::QuickFixOfferedOperationsTest(
const QList<QuickFixTestDocument::Ptr> &testDocuments, const QList<QuickFixTestDocument::Ptr> &testDocuments,
CppQuickFixFactory *factory, CppQuickFixFactory *factory,
const ProjectPart::HeaderPaths &headerPaths, const ProjectPartHeaderPaths &headerPaths,
const QStringList &expectedOperations) const QStringList &expectedOperations)
: BaseQuickFixTestCase(testDocuments, headerPaths) : BaseQuickFixTestCase(testDocuments, headerPaths)
{ {
...@@ -1857,7 +1857,7 @@ void CppEditorPlugin::test_quickfix_GenerateGetterSetter_onlyGetter() ...@@ -1857,7 +1857,7 @@ void CppEditorPlugin::test_quickfix_GenerateGetterSetter_onlyGetter()
testDocuments << QuickFixTestDocument::create("file.cpp", original, expected); testDocuments << QuickFixTestDocument::create("file.cpp", original, expected);
GenerateGetterSetter factory; GenerateGetterSetter factory;
QuickFixOperationTest(testDocuments, &factory, ProjectPart::HeaderPaths(), 1); QuickFixOperationTest(testDocuments, &factory, ProjectPartHeaderPaths(), 1);
} }
/// Checks: Only generate setter /// Checks: Only generate setter
...@@ -1894,7 +1894,7 @@ void CppEditorPlugin::test_quickfix_GenerateGetterSetter_onlySetter() ...@@ -1894,7 +1894,7 @@ void CppEditorPlugin::test_quickfix_GenerateGetterSetter_onlySetter()
testDocuments << QuickFixTestDocument::create("file.cpp", original, expected); testDocuments << QuickFixTestDocument::create("file.cpp", original, expected);
GenerateGetterSetter factory; GenerateGetterSetter factory;
QuickFixOperationTest(testDocuments, &factory, ProjectPart::HeaderPaths(), 2); QuickFixOperationTest(testDocuments, &factory, ProjectPartHeaderPaths(), 2);
} }
/// Checks: Offer a "generate getter" quick fix if there is a setter /// Checks: Offer a "generate getter" quick fix if there is a setter
...@@ -2015,7 +2015,7 @@ void CppEditorPlugin::test_quickfix_InsertDefFromDecl_afterClass() ...@@ -2015,7 +2015,7 @@ void CppEditorPlugin::test_quickfix_InsertDefFromDecl_afterClass()
testDocuments << QuickFixTestDocument::create("file.cpp", original, expected); testDocuments << QuickFixTestDocument::create("file.cpp", original, expected);
InsertDefFromDecl factory; InsertDefFromDecl factory;
QuickFixOperationTest(testDocuments, &factory, ProjectPart::HeaderPaths(), 1); QuickFixOperationTest(testDocuments, &factory, ProjectPartHeaderPaths(), 1);
} }
/// Check from header file: If there is a source file, insert the definition in the source file. /// Check from header file: If there is a source file, insert the definition in the source file.
...@@ -2201,7 +2201,7 @@ void CppEditorPlugin::test_quickfix_InsertDefFromDecl_insideClass() ...@@ -2201,7 +2201,7 @@ void CppEditorPlugin::test_quickfix_InsertDefFromDecl_insideClass()
"};"; "};";
InsertDefFromDecl factory; InsertDefFromDecl factory;
QuickFixOperationTest(singleDocument(original, expected), &factory, ProjectPart::HeaderPaths(), QuickFixOperationTest(singleDocument(original, expected), &factory, ProjectPartHeaderPaths(),
1); 1);
} }
...@@ -2215,7 +2215,7 @@ void CppEditorPlugin::test_quickfix_InsertDefFromDecl_notTriggeringWhenDefinitio ...@@ -2215,7 +2215,7 @@ void CppEditorPlugin::test_quickfix_InsertDefFromDecl_notTriggeringWhenDefinitio
"void Foo::bar() {}\n"; "void Foo::bar() {}\n";
InsertDefFromDecl factory; InsertDefFromDecl factory;
QuickFixOperationTest(singleDocument(original, ""), &factory, ProjectPart::HeaderPaths(), 1); QuickFixOperationTest(singleDocument(original, ""), &factory, ProjectPartHeaderPaths(), 1);
} }
/// Find right implementation file. /// Find right implementation file.
...@@ -2629,7 +2629,7 @@ void insertToSectionDeclFromDef(const QByteArray &section, int sectionIndex) ...@@ -2629,7 +2629,7 @@ void insertToSectionDeclFromDef(const QByteArray &section, int sectionIndex)
testDocuments << QuickFixTestDocument::create("file.cpp", original, expected); testDocuments << QuickFixTestDocument::create("file.cpp", original, expected);
InsertDeclFromDef factory; InsertDeclFromDef factory;
QuickFixOperationTest(testDocuments, &factory, ProjectPart::HeaderPaths(), sectionIndex); QuickFixOperationTest(testDocuments, &factory, ProjectPartHeaderPaths(), sectionIndex);
} }
/// Check from source file: Insert in header file. /// Check from source file: Insert in header file.
...@@ -3391,9 +3391,9 @@ void CppEditorPlugin::test_quickfix_AddIncludeForUndefinedIdentifier_noDoubleQtH ...@@ -3391,9 +3391,9 @@ void CppEditorPlugin::test_quickfix_AddIncludeForUndefinedIdentifier_noDoubleQtH
original = expected = "@QDir dir;\n"; original = expected = "@QDir dir;\n";
testDocuments << QuickFixTestDocument::create(base + "/fileWantsToUseQDir.cpp", original, expected); testDocuments << QuickFixTestDocument::create(base + "/fileWantsToUseQDir.cpp", original, expected);
ProjectPart::HeaderPaths headerPaths; ProjectPartHeaderPaths headerPaths;
headerPaths += ProjectPart::HeaderPath(TestIncludePaths::globalQtCoreIncludePath(), headerPaths += ProjectPartHeaderPath(TestIncludePaths::globalQtCoreIncludePath(),
ProjectPart::HeaderPath::IncludePath); ProjectPartHeaderPath::IncludePath);
AddIncludeForUndefinedIdentifier factory; AddIncludeForUndefinedIdentifier factory;
const QStringList expectedOperations = QStringList() << QLatin1String("Add #include <QDir>"); const QStringList expectedOperations = QStringList() << QLatin1String("Add #include <QDir>");
...@@ -3561,7 +3561,7 @@ void CppEditorPlugin::test_quickfix_MoveFuncDefOutside_MemberFuncOutside2() ...@@ -3561,7 +3561,7 @@ void CppEditorPlugin::test_quickfix_MoveFuncDefOutside_MemberFuncOutside2()
testDocuments << QuickFixTestDocument::create("file.cpp", original, expected); testDocuments << QuickFixTestDocument::create("file.cpp", original, expected);
MoveFuncDefOutside factory; MoveFuncDefOutside factory;
QuickFixOperationTest(testDocuments, &factory, ProjectPart::HeaderPaths(), 1); QuickFixOperationTest(testDocuments, &factory, ProjectPartHeaderPaths(), 1);
} }
/// Check: Move definition from header to cpp (with namespace). /// Check: Move definition from header to cpp (with namespace).
...@@ -3868,7 +3868,7 @@ void CppEditorPlugin::test_quickfix_MoveFuncDefOutside_afterClass() ...@@ -3868,7 +3868,7 @@ void CppEditorPlugin::test_quickfix_MoveFuncDefOutside_afterClass()
testDocuments << QuickFixTestDocument::create("file.cpp", original, expected); testDocuments << QuickFixTestDocument::create("file.cpp", original, expected);
MoveFuncDefOutside factory; MoveFuncDefOutside factory;
QuickFixOperationTest(testDocuments, &factory, ProjectPart::HeaderPaths(), 1); QuickFixOperationTest(testDocuments, &factory, ProjectPartHeaderPaths(), 1);
} }
/// Check if whitespace is respected for operator functions /// Check if whitespace is respected for operator functions
...@@ -3943,7 +3943,7 @@ void CppEditorPlugin::test_quickfix_MoveFuncDefOutside_macroUses() ...@@ -3943,7 +3943,7 @@ void CppEditorPlugin::test_quickfix_MoveFuncDefOutside_macroUses()
MoveFuncDefOutside factory; MoveFuncDefOutside factory;
QuickFixOperationTest(singleDocument(original, expected), &factory, QuickFixOperationTest(singleDocument(original, expected), &factory,
ProjectPart::HeaderPaths(), 0, "QTCREATORBUG-12314"); ProjectPartHeaderPaths(), 0, "QTCREATORBUG-12314");
} }
/// Check: revert test_quickfix_MoveFuncDefOutside_MemberFuncToCpp() /// Check: revert test_quickfix_MoveFuncDefOutside_MemberFuncToCpp()
...@@ -4277,7 +4277,7 @@ void CppEditorPlugin::test_quickfix_MoveFuncDefToDecl_macroUses() ...@@ -4277,7 +4277,7 @@ void CppEditorPlugin::test_quickfix_MoveFuncDefToDecl_macroUses()
MoveFuncDefToDecl factory; MoveFuncDefToDecl factory;
QuickFixOperationTest(singleDocument(original, expected), &factory, QuickFixOperationTest(singleDocument(original, expected), &factory,
ProjectPart::HeaderPaths(), 0, "QTCREATORBUG-12314"); ProjectPartHeaderPaths(), 0, "QTCREATORBUG-12314");
} }
void CppEditorPlugin::test_quickfix_MoveFuncDefToDecl_override() void CppEditorPlugin::test_quickfix_MoveFuncDefToDecl_override()
......
...@@ -81,8 +81,8 @@ public: ...@@ -81,8 +81,8 @@ public:
/// Exactly one QuickFixTestDocument must contain the cursor position marker '@' /// Exactly one QuickFixTestDocument must contain the cursor position marker '@'
/// or "@{start}" and "@{end}" /// or "@{start}" and "@{end}"
BaseQuickFixTestCase(const QList<QuickFixTestDocument::Ptr> &testDocuments, BaseQuickFixTestCase(const QList<QuickFixTestDocument::Ptr> &testDocuments,
const CppTools::ProjectPart::HeaderPaths &headerPaths const CppTools::ProjectPartHeaderPaths &headerPaths
= CppTools::ProjectPart::HeaderPaths()); = CppTools::ProjectPartHeaderPaths());
~BaseQuickFixTestCase(); ~BaseQuickFixTestCase();
...@@ -96,7 +96,7 @@ private: ...@@ -96,7 +96,7 @@ private:
CppTools::CppCodeStylePreferences *m_cppCodeStylePreferences; CppTools::CppCodeStylePreferences *m_cppCodeStylePreferences;
QByteArray m_cppCodeStylePreferencesOriginalDelegateId; QByteArray m_cppCodeStylePreferencesOriginalDelegateId;
CppTools::ProjectPart::HeaderPaths m_headerPathsToRestore; CppTools::ProjectPartHeaderPaths m_headerPathsToRestore;
bool m_restoreHeaderPaths; bool m_restoreHeaderPaths;
}; };
...@@ -106,8 +106,8 @@ class QuickFixOperationTest : public BaseQuickFixTestCase ...@@ -106,8 +106,8 @@ class QuickFixOperationTest : public BaseQuickFixTestCase
public: public:
QuickFixOperationTest(const QList<QuickFixTestDocument::Ptr> &testDocuments, QuickFixOperationTest(const QList<QuickFixTestDocument::Ptr> &testDocuments,
CppQuickFixFactory *factory, CppQuickFixFactory *factory,
const CppTools::ProjectPart::HeaderPaths &headerPaths const CppTools::ProjectPartHeaderPaths &headerPaths
= CppTools::ProjectPart::HeaderPaths(), = CppTools::ProjectPartHeaderPaths(),
int operationIndex = 0, int operationIndex = 0,
const QByteArray &expectedFailMessage = QByteArray()); const QByteArray &expectedFailMessage = QByteArray());
...@@ -123,8 +123,8 @@ class QuickFixOfferedOperationsTest : public BaseQuickFixTestCase ...@@ -123,8 +123,8 @@ class QuickFixOfferedOperationsTest : public BaseQuickFixTestCase
public: public:
QuickFixOfferedOperationsTest(const QList<QuickFixTestDocument::Ptr> &testDocuments, QuickFixOfferedOperationsTest(const QList<QuickFixTestDocument::Ptr> &testDocuments,
CppQuickFixFactory *factory, CppQuickFixFactory *factory,
const CppTools::ProjectPart::HeaderPaths &headerPaths const CppTools::ProjectPartHeaderPaths &headerPaths
= CppTools::ProjectPart::HeaderPaths(), = CppTools::ProjectPartHeaderPaths(),
const QStringList &expectedOperations = QStringList()); const QStringList &expectedOperations = QStringList());
}; };
......
...@@ -1751,7 +1751,7 @@ namespace { ...@@ -1751,7 +1751,7 @@ namespace {
QString findShortestInclude(const QString currentDocumentFilePath, QString findShortestInclude(const QString currentDocumentFilePath,
const QString candidateFilePath, const QString candidateFilePath,
const ProjectPart::HeaderPaths &headerPaths) const ProjectPartHeaderPaths &headerPaths)
{ {
QString result; QString result;
...@@ -1760,7 +1760,7 @@ QString findShortestInclude(const QString currentDocumentFilePath, ...@@ -1760,7 +1760,7 @@ QString findShortestInclude(const QString currentDocumentFilePath,
if (fileInfo.path() == QFileInfo(currentDocumentFilePath).path()) { if (fileInfo.path() == QFileInfo(currentDocumentFilePath).path()) {
result = QLatin1Char('"') + fileInfo.fileName() + QLatin1Char('"'); result = QLatin1Char('"') + fileInfo.fileName() + QLatin1Char('"');
} else { } else {
foreach (const ProjectPart::HeaderPath &headerPath, headerPaths) { foreach (const ProjectPartHeaderPath &headerPath, headerPaths) {
if (!candidateFilePath.startsWith(headerPath.path)) if (!candidateFilePath.startsWith(headerPath.path))
continue; continue;
QString relativePath = candidateFilePath.mid(headerPath.path.size()); QString relativePath = candidateFilePath.mid(headerPath.path.size());
...@@ -1775,12 +1775,12 @@ QString findShortestInclude(const QString currentDocumentFilePath, ...@@ -1775,12 +1775,12 @@ QString findShortestInclude(const QString currentDocumentFilePath,
} }
QString findQtIncludeWithSameName(const QString &className, QString findQtIncludeWithSameName(const QString &className,
const ProjectPart::HeaderPaths &headerPaths) const ProjectPartHeaderPaths &headerPaths)
{ {
QString result; QString result;
// Check for a header file with the same name in the Qt include paths // Check for a header file with the same name in the Qt include paths
foreach (const ProjectPart::HeaderPath &headerPath, headerPaths) { foreach (const ProjectPartHeaderPath &headerPath, headerPaths) {
if (!headerPath.path.contains(QLatin1String("/Qt"))) // "QtCore", "QtGui" etc... if (!headerPath.path.contains(QLatin1String("/Qt"))) // "QtCore", "QtGui" etc...
continue; continue;
...@@ -1795,9 +1795,9 @@ QString findQtIncludeWithSameName(const QString &className, ...@@ -1795,9 +1795,9 @@ QString findQtIncludeWithSameName(const QString &className,
return result; return result;
} }
ProjectPart::HeaderPaths relevantHeaderPaths(const QString &filePath) ProjectPartHeaderPaths relevantHeaderPaths(const QString &filePath)
{ {
ProjectPart::HeaderPaths headerPaths; ProjectPartHeaderPaths headerPaths;
CppModelManager *modelManager = CppModelManager::instance(); CppModelManager *modelManager = CppModelManager::instance();
const QList<ProjectPart::Ptr> projectParts = modelManager->projectPart(filePath); const QList<ProjectPart::Ptr> projectParts = modelManager->projectPart(filePath);
...@@ -1924,7 +1924,7 @@ void AddIncludeForUndefinedIdentifier::match(const CppQuickFixInterface &interfa ...@@ -1924,7 +1924,7 @@ void AddIncludeForUndefinedIdentifier::match(const CppQuickFixInterface &interfa
return; return;
const QString currentDocumentFilePath = interface.semanticInfo().doc->fileName(); const QString currentDocumentFilePath = interface.semanticInfo().doc->fileName();
const ProjectPart::HeaderPaths headerPaths = relevantHeaderPaths(currentDocumentFilePath); const ProjectPartHeaderPaths headerPaths = relevantHeaderPaths(currentDocumentFilePath);
bool qtHeaderFileIncludeOffered = false; bool qtHeaderFileIncludeOffered = false;
// Find an include file through the locator // Find an include file through the locator
......
...@@ -76,7 +76,7 @@ void BuiltinEditorDocumentParser::updateHelper(const WorkingCopy &theWorkingCopy ...@@ -76,7 +76,7 @@ void BuiltinEditorDocumentParser::updateHelper(const WorkingCopy &theWorkingCopy
CppModelManager *modelManager = CppModelManager::instance(); CppModelManager *modelManager = CppModelManager::instance();
QByteArray configFile = modelManager->codeModelConfiguration(); QByteArray configFile = modelManager->codeModelConfiguration();
ProjectPart::HeaderPaths headerPaths; ProjectPartHeaderPaths headerPaths;
QStringList precompiledHeaders; QStringList precompiledHeaders;
QString projectConfigFile; QString projectConfigFile;
LanguageFeatures features = LanguageFeatures::defaultFeatures(); LanguageFeatures features = LanguageFeatures::defaultFeatures();
...@@ -238,7 +238,7 @@ Snapshot BuiltinEditorDocumentParser::snapshot() const ...@@ -238,7 +238,7 @@ Snapshot BuiltinEditorDocumentParser::snapshot() const
return extraState().snapshot; return extraState().snapshot;
} }
ProjectPart::HeaderPaths BuiltinEditorDocumentParser::headerPaths() const ProjectPartHeaderPaths BuiltinEditorDocumentParser::headerPaths() const
{ {
return extraState().headerPaths; return extraState().headerPaths;
} }
......
...@@ -52,7 +52,7 @@ public: ...@@ -52,7 +52,7 @@ public:
CPlusPlus::Document::Ptr document() const; CPlusPlus::Document::Ptr document() const;
CPlusPlus::Snapshot snapshot() const; CPlusPlus::Snapshot snapshot() const;
ProjectPart::HeaderPaths headerPaths() const; ProjectPartHeaderPaths headerPaths() const;
void releaseResources(); void releaseResources();
...@@ -72,7 +72,7 @@ private: ...@@ -72,7 +72,7 @@ private:
struct ExtraState { struct ExtraState {
QByteArray configFile; QByteArray configFile;
ProjectPart::HeaderPaths headerPaths; ProjectPartHeaderPaths headerPaths;
QString projectConfigFile; QString projectConfigFile;
QStringList precompiledHeaders; QStringList precompiledHeaders;
......
...@@ -61,7 +61,7 @@ namespace { ...@@ -61,7 +61,7 @@ namespace {
class ParseParams class ParseParams
{ {
public: public:
ProjectPart::HeaderPaths headerPaths; ProjectPartHeaderPaths headerPaths;
WorkingCopy workingCopy; WorkingCopy workingCopy;
QSet<QString> sourceFiles; QSet<QString> sourceFiles;
}; };
...@@ -203,7 +203,7 @@ void index(QFutureInterface<void> &future, const ParseParams params) ...@@ -203,7 +203,7 @@ void index(QFutureInterface<void> &future, const ParseParams params)
bool processingHeaders = false; bool processingHeaders = false;
CppModelManager *cmm = CppModelManager::instance(); CppModelManager *cmm = CppModelManager::instance();
const ProjectPart::HeaderPaths fallbackHeaderPaths = cmm->headerPaths(); const ProjectPartHeaderPaths fallbackHeaderPaths = cmm->headerPaths();
const CPlusPlus::LanguageFeatures defaultFeatures = const CPlusPlus::LanguageFeatures defaultFeatures =
CPlusPlus::LanguageFeatures::defaultFeatures(); CPlusPlus::LanguageFeatures::defaultFeatures();
for (int i = 0; i < files.size(); ++i) { for (int i = 0; i < files.size(); ++i) {
...@@ -229,7 +229,7 @@ void index(QFutureInterface<void> &future, const ParseParams params) ...@@ -229,7 +229,7 @@ void index(QFutureInterface<void> &future, const ParseParams params)
processingHeaders = true; processingHeaders = true;
} }
ProjectPart::HeaderPaths headerPaths = parts.isEmpty() ProjectPartHeaderPaths headerPaths = parts.isEmpty()
? fallbackHeaderPaths ? fallbackHeaderPaths
: parts.first()->headerPaths; : parts.first()->headerPaths;
sourceProcessor->setHeaderPaths(headerPaths); sourceProcessor->setHeaderPaths(headerPaths);
......
...@@ -143,7 +143,7 @@ QString Utils::toString(ProjectPart::QtVersion qtVersion) ...@@ -143,7 +143,7 @@ QString Utils::toString(ProjectPart::QtVersion qtVersion)
return QString(); return QString();
} }
QString Utils::toString(const QList<ProjectFile> &projectFiles) QString Utils::toString(const QVector<ProjectFile> &projectFiles)
{ {
QStringList filesList; QStringList filesList;
foreach (const ProjectFile &projectFile, projectFiles) foreach (const ProjectFile &projectFile, projectFiles)
...@@ -411,10 +411,10 @@ QString Utils::pathListToString(const QStringList &pathList) ...@@ -411,10 +411,10 @@ QString Utils::pathListToString(const QStringList &pathList)
return result.join(QLatin1Char('\n')); return result.join(QLatin1Char('\n'));
} }
QString Utils::pathListToString(const ProjectPart::HeaderPaths &pathList) QString Utils::pathListToString(const ProjectPartHeaderPaths &pathList)
{ {
QStringList result; QStringList result;
foreach (const ProjectPart::HeaderPath &path, pathList) { foreach (const ProjectPartHeaderPath &path, pathList) {
result << QString(QLatin1String("%1 (%2 path)")).arg(