forked from qt-creator/qt-creator
Merge BaseTextEditorWidget::editorDocument() and ::baseTextDocument()
Doesn't really make sense to have the additional IDocument *editorDocument() method. Change-Id: I0a7420eb1afaa76f63c3f7e9c4b373acf624ffb9 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -610,7 +610,7 @@ void QmlJSTextEditorWidget::reparseDocumentNow()
|
||||
{
|
||||
m_updateDocumentTimer->stop();
|
||||
|
||||
const QString fileName = editorDocument()->filePath();
|
||||
const QString fileName = baseTextDocument()->filePath();
|
||||
m_modelManager->updateSourceFiles(QStringList() << fileName, false);
|
||||
}
|
||||
|
||||
@@ -652,7 +652,7 @@ static void appendExtraSelectionsForMessages(
|
||||
|
||||
void QmlJSTextEditorWidget::onDocumentUpdated(QmlJS::Document::Ptr doc)
|
||||
{
|
||||
if (editorDocument()->filePath() != doc->fileName())
|
||||
if (baseTextDocument()->filePath() != doc->fileName())
|
||||
return;
|
||||
|
||||
if (doc->editorRevision() != editorRevision()) {
|
||||
@@ -684,7 +684,7 @@ void QmlJSTextEditorWidget::onDocumentUpdated(QmlJS::Document::Ptr doc)
|
||||
void QmlJSTextEditorWidget::modificationChanged(bool changed)
|
||||
{
|
||||
if (!changed && m_modelManager)
|
||||
m_modelManager->fileChangedOnDisk(editorDocument()->filePath());
|
||||
m_modelManager->fileChangedOnDisk(baseTextDocument()->filePath());
|
||||
}
|
||||
|
||||
void QmlJSTextEditorWidget::jumpToOutlineElement(int /*index*/)
|
||||
@@ -1060,7 +1060,7 @@ void QmlJSTextEditorWidget::createToolBar(QmlJSEditor *editor)
|
||||
connect(m_outlineCombo, SIGNAL(activated(int)), this, SLOT(jumpToOutlineElement(int)));
|
||||
connect(this, SIGNAL(cursorPositionChanged()), m_updateOutlineIndexTimer, SLOT(start()));
|
||||
|
||||
connect(editorDocument(), SIGNAL(changed()), this, SLOT(updateFileName()));
|
||||
connect(baseTextDocument(), SIGNAL(changed()), this, SLOT(updateFileName()));
|
||||
|
||||
editor->insertExtraToolBarWidget(TextEditor::BaseTextEditor::Left, m_outlineCombo);
|
||||
}
|
||||
@@ -1150,12 +1150,12 @@ TextEditor::BaseTextEditorWidget::Link QmlJSTextEditorWidget::findLinkAt(const Q
|
||||
|
||||
void QmlJSTextEditorWidget::findUsages()
|
||||
{
|
||||
m_findReferences->findUsages(editorDocument()->filePath(), textCursor().position());
|
||||
m_findReferences->findUsages(baseTextDocument()->filePath(), textCursor().position());
|
||||
}
|
||||
|
||||
void QmlJSTextEditorWidget::renameUsages()
|
||||
{
|
||||
m_findReferences->renameUsages(editorDocument()->filePath(), textCursor().position());
|
||||
m_findReferences->renameUsages(baseTextDocument()->filePath(), textCursor().position());
|
||||
}
|
||||
|
||||
void QmlJSTextEditorWidget::showContextPane()
|
||||
|
||||
@@ -48,7 +48,7 @@ using namespace Internal;
|
||||
QmlJSQuickFixAssistInterface::QmlJSQuickFixAssistInterface(QmlJSTextEditorWidget *editor,
|
||||
TextEditor::AssistReason reason)
|
||||
: DefaultAssistInterface(editor->document(), editor->position(),
|
||||
editor->editorDocument()->filePath(), reason)
|
||||
editor->baseTextDocument()->filePath(), reason)
|
||||
, m_editor(editor)
|
||||
, m_semanticInfo(editor->semanticInfo())
|
||||
, m_currentFile(QmlJSRefactoringChanges::file(m_editor, m_semanticInfo.document))
|
||||
|
||||
@@ -568,7 +568,7 @@ void SemanticHighlighter::applyResults(int from, int to)
|
||||
if (m_startRevision != m_editor->editorRevision())
|
||||
return;
|
||||
|
||||
TextEditor::BaseTextDocument *baseTextDocument = m_editor->baseTextDocument().data();
|
||||
TextEditor::BaseTextDocument *baseTextDocument = m_editor->baseTextDocument();
|
||||
QTC_ASSERT(baseTextDocument, return);
|
||||
TextEditor::SyntaxHighlighter *highlighter = qobject_cast<TextEditor::SyntaxHighlighter *>(baseTextDocument->syntaxHighlighter());
|
||||
QTC_ASSERT(highlighter, return);
|
||||
@@ -584,7 +584,7 @@ void SemanticHighlighter::finished()
|
||||
if (m_startRevision != m_editor->editorRevision())
|
||||
return;
|
||||
|
||||
TextEditor::BaseTextDocument *baseTextDocument = m_editor->baseTextDocument().data();
|
||||
TextEditor::BaseTextDocument *baseTextDocument = m_editor->baseTextDocument();
|
||||
QTC_ASSERT(baseTextDocument, return);
|
||||
TextEditor::SyntaxHighlighter *highlighter = qobject_cast<TextEditor::SyntaxHighlighter *>(baseTextDocument->syntaxHighlighter());
|
||||
QTC_ASSERT(highlighter, return);
|
||||
|
||||
Reference in New Issue
Block a user