forked from qt-creator/qt-creator
Rename IFile->IDocument and FileManager->DocumentManager
And adapt the other API respectively. Change-Id: I1e04e555409be09242db6890f9e013396f83aeed Reviewed-by: Bill King <bill.king@nokia.com> Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
@@ -544,7 +544,7 @@ void CPPEditorWidget::createToolBar(CPPEditor *editor)
|
||||
connect(m_outlineCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(updateOutlineToolTip()));
|
||||
connect(document(), SIGNAL(contentsChange(int,int,int)), this, SLOT(onContentsChanged(int,int,int)));
|
||||
|
||||
connect(file(), SIGNAL(changed()), this, SLOT(updateFileName()));
|
||||
connect(editorDocument(), SIGNAL(changed()), this, SLOT(updateFileName()));
|
||||
|
||||
// set up function declaration - definition link
|
||||
connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(updateFunctionDeclDefLink()));
|
||||
@@ -675,7 +675,7 @@ void CPPEditorWidget::abortRename()
|
||||
|
||||
void CPPEditorWidget::onDocumentUpdated(Document::Ptr doc)
|
||||
{
|
||||
if (doc->fileName() != file()->fileName())
|
||||
if (doc->fileName() != editorDocument()->fileName())
|
||||
return;
|
||||
|
||||
if (doc->editorRevision() != editorRevision())
|
||||
@@ -685,7 +685,7 @@ void CPPEditorWidget::onDocumentUpdated(Document::Ptr doc)
|
||||
(Core::EditorManager::instance()->currentEditor() == editor()
|
||||
&& (!m_lastSemanticInfo.doc
|
||||
|| !m_lastSemanticInfo.doc->translationUnit()->ast()
|
||||
|| m_lastSemanticInfo.doc->fileName() != file()->fileName()))) {
|
||||
|| m_lastSemanticInfo.doc->fileName() != editorDocument()->fileName()))) {
|
||||
m_initialized = true;
|
||||
semanticRehighlight(/* force = */ true);
|
||||
}
|
||||
@@ -901,7 +901,7 @@ bool CPPEditorWidget::sortedOutline() const
|
||||
void CPPEditorWidget::updateOutlineNow()
|
||||
{
|
||||
const Snapshot snapshot = m_modelManager->snapshot();
|
||||
Document::Ptr document = snapshot.document(file()->fileName());
|
||||
Document::Ptr document = snapshot.document(editorDocument()->fileName());
|
||||
|
||||
if (!document)
|
||||
return;
|
||||
@@ -1047,7 +1047,7 @@ void CPPEditorWidget::switchDeclarationDefinition()
|
||||
|
||||
const Snapshot snapshot = m_modelManager->snapshot();
|
||||
|
||||
if (Document::Ptr thisDocument = snapshot.document(file()->fileName())) {
|
||||
if (Document::Ptr thisDocument = snapshot.document(editorDocument()->fileName())) {
|
||||
int line = 0, positionInBlock = 0;
|
||||
convertPosition(position(), &line, &positionInBlock);
|
||||
|
||||
@@ -1281,7 +1281,7 @@ CPPEditorWidget::Link CPPEditorWidget::findLinkAt(const QTextCursor &cursor,
|
||||
}
|
||||
|
||||
// Now we prefer the doc from the snapshot with macros expanded.
|
||||
Document::Ptr doc = snapshot.document(file()->fileName());
|
||||
Document::Ptr doc = snapshot.document(editorDocument()->fileName());
|
||||
if (!doc) {
|
||||
doc = m_lastSemanticInfo.doc;
|
||||
if (!doc)
|
||||
@@ -1411,7 +1411,7 @@ CPPEditorWidget::Link CPPEditorWidget::findLinkAt(const QTextCursor &cursor,
|
||||
foreach (const LookupItem &r, resolvedSymbols) {
|
||||
if (Symbol *d = r.declaration()) {
|
||||
if (d->isDeclaration() || d->isFunction()) {
|
||||
if (file()->fileName() == QString::fromUtf8(d->fileName(), d->fileNameLength())) {
|
||||
if (editorDocument()->fileName() == QString::fromUtf8(d->fileName(), d->fileNameLength())) {
|
||||
if (unsigned(lineNumber) == d->line() && unsigned(positionInBlock) >= d->column()) { // ### TODO: check the end
|
||||
result = r; // take the symbol under cursor.
|
||||
break;
|
||||
@@ -1820,7 +1820,7 @@ void CPPEditorWidget::updateSemanticInfo(const SemanticInfo &semanticInfo)
|
||||
|
||||
// We can use the semanticInfo's snapshot (and avoid locking), but not its
|
||||
// document, since it doesn't contain expanded macros.
|
||||
LookupContext context(semanticInfo.snapshot.document(file()->fileName()),
|
||||
LookupContext context(semanticInfo.snapshot.document(editorDocument()->fileName()),
|
||||
semanticInfo.snapshot);
|
||||
|
||||
SemanticInfo::LocalUseIterator it(semanticInfo.localUses);
|
||||
@@ -1984,7 +1984,7 @@ SemanticHighlighter::Source CPPEditorWidget::currentSource(bool force)
|
||||
convertPosition(position(), &line, &column);
|
||||
|
||||
const Snapshot snapshot = m_modelManager->snapshot();
|
||||
const QString fileName = file()->fileName();
|
||||
const QString fileName = editorDocument()->fileName();
|
||||
|
||||
QString code;
|
||||
if (force || m_lastSemanticInfo.revision != editorRevision())
|
||||
|
||||
Reference in New Issue
Block a user