forked from qt-creator/qt-creator
First step towards dynamic ui completion. Add hooks in cppmodelmanager
This adds a way for plugins to tell the cppmodel that for certain files, the actual contents come from it, instead of reading from the disk. (For texteditors the cppmodel does that automatically.) Reviewed-By: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
@@ -648,6 +648,16 @@ QByteArray CppModelManager::internalDefinedMacros() const
|
||||
return macros;
|
||||
}
|
||||
|
||||
void CppModelManager::addEditorSupport(AbstractEditorSupport *editorSupport)
|
||||
{
|
||||
m_addtionalEditorSupport.insert(editorSupport);
|
||||
}
|
||||
|
||||
void CppModelManager::removeEditorSupport(AbstractEditorSupport *editorSupport)
|
||||
{
|
||||
m_addtionalEditorSupport.remove(editorSupport);
|
||||
}
|
||||
|
||||
QMap<QString, QByteArray> CppModelManager::buildWorkingCopyList()
|
||||
{
|
||||
QMap<QString, QByteArray> workingCopy;
|
||||
@@ -660,6 +670,12 @@ QMap<QString, QByteArray> CppModelManager::buildWorkingCopyList()
|
||||
workingCopy[fileName] = editorSupport->contents();
|
||||
}
|
||||
|
||||
QSetIterator<AbstractEditorSupport *> jt(m_addtionalEditorSupport);
|
||||
while (jt.hasNext()) {
|
||||
AbstractEditorSupport *es = jt.next();
|
||||
workingCopy[es->fileName()] = es->contents();
|
||||
}
|
||||
|
||||
// add the project configuration file
|
||||
QByteArray conf(pp_configuration);
|
||||
conf += definedMacros();
|
||||
|
Reference in New Issue
Block a user