summaryrefslogtreecommitdiff
path: root/src/plugins/qmljseditor
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@nokia.com>2012-02-14 16:43:51 +0100
committerEike Ziller <eike.ziller@nokia.com>2012-02-20 13:32:49 +0100
commitd66acb51d0c8b511df9f679806cbd3d84cce41ef (patch)
tree58289c9e7f7bc6107b4d620fad791a206d097555 /src/plugins/qmljseditor
parent266da3568d2db185f67227d38e29cd20d28fb2bd (diff)
downloadqt-creator-d66acb51d0c8b511df9f679806cbd3d84cce41ef.tar.gz
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>
Diffstat (limited to 'src/plugins/qmljseditor')
-rw-r--r--src/plugins/qmljseditor/qmljscompletionassist.cpp28
-rw-r--r--src/plugins/qmljseditor/qmljscompletionassist.h4
-rw-r--r--src/plugins/qmljseditor/qmljscomponentfromobjectdef.cpp2
-rw-r--r--src/plugins/qmljseditor/qmljseditor.cpp14
-rw-r--r--src/plugins/qmljseditor/qmljseditorfactory.cpp4
-rw-r--r--src/plugins/qmljseditor/qmljseditorfactory.h2
-rw-r--r--src/plugins/qmljseditor/qmljsoutline.cpp2
-rw-r--r--src/plugins/qmljseditor/qmljsquickfixassist.cpp2
-rw-r--r--src/plugins/qmljseditor/qmljswrapinloader.cpp2
-rw-r--r--src/plugins/qmljseditor/qmltaskmanager.cpp2
10 files changed, 31 insertions, 31 deletions
diff --git a/src/plugins/qmljseditor/qmljscompletionassist.cpp b/src/plugins/qmljseditor/qmljscompletionassist.cpp
index f90da289a4..61f9459f15 100644
--- a/src/plugins/qmljseditor/qmljscompletionassist.cpp
+++ b/src/plugins/qmljseditor/qmljscompletionassist.cpp
@@ -35,7 +35,7 @@
#include "qmljsreuse.h"
#include "qmlexpressionundercursor.h"
-#include <coreplugin/ifile.h>
+#include <coreplugin/idocument.h>
#include <texteditor/codeassist/iassistinterface.h>
#include <texteditor/codeassist/genericproposal.h>
@@ -530,10 +530,10 @@ IAssistProposal *QmlJSCompletionAssistProcessor::perform(const IAssistInterface
if (assistInterface->reason() == IdleEditor && !acceptsIdleEditor())
return 0;
- const QString &fileName = m_interface->file()->fileName();
+ const QString &fileName = m_interface->document()->fileName();
m_startPosition = assistInterface->position();
- while (isIdentifierChar(m_interface->document()->characterAt(m_startPosition - 1), false, false))
+ while (isIdentifierChar(m_interface->textDocument()->characterAt(m_startPosition - 1), false, false))
--m_startPosition;
const bool onIdentifier = m_startPosition != assistInterface->position();
@@ -563,9 +563,9 @@ IAssistProposal *QmlJSCompletionAssistProcessor::perform(const IAssistInterface
// a +b<complete> -> '+'
QChar completionOperator;
if (m_startPosition > 0)
- completionOperator = m_interface->document()->characterAt(m_startPosition - 1);
+ completionOperator = m_interface->textDocument()->characterAt(m_startPosition - 1);
- QTextCursor startPositionCursor(qmlInterface->document());
+ QTextCursor startPositionCursor(qmlInterface->textDocument());
startPositionCursor.setPosition(m_startPosition);
CompletionContextFinder contextFinder(startPositionCursor);
@@ -609,7 +609,7 @@ IAssistProposal *QmlJSCompletionAssistProcessor::perform(const IAssistInterface
if (contextFinder.isInStringLiteral()) {
// get the text of the literal up to the cursor position
//QTextCursor tc = textWidget->textCursor();
- QTextCursor tc(qmlInterface->document());
+ QTextCursor tc(qmlInterface->textDocument());
tc.setPosition(qmlInterface->position());
QmlExpressionUnderCursor expressionUnderCursor;
expressionUnderCursor(tc);
@@ -656,7 +656,7 @@ IAssistProposal *QmlJSCompletionAssistProcessor::perform(const IAssistInterface
|| (completionOperator == QLatin1Char('(') && !onIdentifier)) {
// Look at the expression under cursor.
//QTextCursor tc = textWidget->textCursor();
- QTextCursor tc(qmlInterface->document());
+ QTextCursor tc(qmlInterface->textDocument());
tc.setPosition(m_startPosition - 1);
QmlExpressionUnderCursor expressionUnderCursor;
@@ -822,11 +822,11 @@ bool QmlJSCompletionAssistProcessor::acceptsIdleEditor() const
const int cursorPos = m_interface->position();
bool maybeAccept = false;
- const QChar &charBeforeCursor = m_interface->document()->characterAt(cursorPos - 1);
+ const QChar &charBeforeCursor = m_interface->textDocument()->characterAt(cursorPos - 1);
if (isActivationChar(charBeforeCursor)) {
maybeAccept = true;
} else {
- const QChar &charUnderCursor = m_interface->document()->characterAt(cursorPos);
+ const QChar &charUnderCursor = m_interface->textDocument()->characterAt(cursorPos);
if (isIdentifierChar(charBeforeCursor)
&& ((charUnderCursor.isSpace()
|| charUnderCursor.isNull()
@@ -835,7 +835,7 @@ bool QmlJSCompletionAssistProcessor::acceptsIdleEditor() const
int startPos = cursorPos - 1;
for (; startPos != -1; --startPos) {
- if (!isIdentifierChar(m_interface->document()->characterAt(startPos)))
+ if (!isIdentifierChar(m_interface->textDocument()->characterAt(startPos)))
break;
}
++startPos;
@@ -852,7 +852,7 @@ bool QmlJSCompletionAssistProcessor::acceptsIdleEditor() const
}
if (maybeAccept) {
- QTextCursor tc(m_interface->document());
+ QTextCursor tc(m_interface->textDocument());
tc.setPosition(m_interface->position());
const QTextBlock &block = tc.block();
const QString &blockText = block.text();
@@ -933,12 +933,12 @@ bool QmlJSCompletionAssistProcessor::completeUrl(const QString &relativeBasePath
// ------------------------------
// QmlJSCompletionAssistInterface
// ------------------------------
-QmlJSCompletionAssistInterface::QmlJSCompletionAssistInterface(QTextDocument *document,
+QmlJSCompletionAssistInterface::QmlJSCompletionAssistInterface(QTextDocument *textDocument,
int position,
- Core::IFile *file,
+ Core::IDocument *document,
TextEditor::AssistReason reason,
const SemanticInfo &info)
- : DefaultAssistInterface(document, position, file, reason)
+ : DefaultAssistInterface(textDocument, position, document, reason)
, m_semanticInfo(info)
, m_darkBlueIcon(iconForColor(Qt::darkBlue))
, m_darkYellowIcon(iconForColor(Qt::darkYellow))
diff --git a/src/plugins/qmljseditor/qmljscompletionassist.h b/src/plugins/qmljseditor/qmljscompletionassist.h
index 684918add5..37d3e23f10 100644
--- a/src/plugins/qmljseditor/qmljscompletionassist.h
+++ b/src/plugins/qmljseditor/qmljscompletionassist.h
@@ -121,9 +121,9 @@ private:
class QmlJSCompletionAssistInterface : public TextEditor::DefaultAssistInterface
{
public:
- QmlJSCompletionAssistInterface(QTextDocument *document,
+ QmlJSCompletionAssistInterface(QTextDocument *textDocument,
int position,
- Core::IFile *file,
+ Core::IDocument *document,
TextEditor::AssistReason reason,
const SemanticInfo &info);
const SemanticInfo &semanticInfo() const;
diff --git a/src/plugins/qmljseditor/qmljscomponentfromobjectdef.cpp b/src/plugins/qmljseditor/qmljscomponentfromobjectdef.cpp
index 83bc4cf1c3..ccc240bbd9 100644
--- a/src/plugins/qmljseditor/qmljscomponentfromobjectdef.cpp
+++ b/src/plugins/qmljseditor/qmljscomponentfromobjectdef.cpp
@@ -34,7 +34,7 @@
#include "qmljscomponentnamedialog.h"
#include "qmljsquickfixassist.h"
-#include <coreplugin/ifile.h>
+#include <coreplugin/idocument.h>
#include <qmljs/parser/qmljsast_p.h>
#include <qmljs/qmljsdocument.h>
diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp
index 5be159ff91..78ea9cff7b 100644
--- a/src/plugins/qmljseditor/qmljseditor.cpp
+++ b/src/plugins/qmljseditor/qmljseditor.cpp
@@ -808,7 +808,7 @@ void QmlJSTextEditorWidget::reparseDocumentNow()
{
m_updateDocumentTimer->stop();
- const QString fileName = file()->fileName();
+ const QString fileName = editorDocument()->fileName();
m_modelManager->updateSourceFiles(QStringList() << fileName, false);
}
@@ -889,7 +889,7 @@ static void appendExtraSelectionsForMessages(
void QmlJSTextEditorWidget::onDocumentUpdated(QmlJS::Document::Ptr doc)
{
- if (file()->fileName() != doc->fileName())
+ if (editorDocument()->fileName() != doc->fileName())
return;
if (doc->editorRevision() != editorRevision()) {
@@ -918,7 +918,7 @@ void QmlJSTextEditorWidget::onDocumentUpdated(QmlJS::Document::Ptr doc)
void QmlJSTextEditorWidget::modificationChanged(bool changed)
{
if (!changed && m_modelManager)
- m_modelManager->fileChangedOnDisk(file()->fileName());
+ m_modelManager->fileChangedOnDisk(editorDocument()->fileName());
}
void QmlJSTextEditorWidget::jumpToOutlineElement(int /*index*/)
@@ -1301,7 +1301,7 @@ void QmlJSTextEditorWidget::createToolBar(QmlJSEditorEditable *editor)
connect(m_outlineCombo, SIGNAL(activated(int)), this, SLOT(jumpToOutlineElement(int)));
connect(this, SIGNAL(cursorPositionChanged()), m_updateOutlineIndexTimer, SLOT(start()));
- connect(file(), SIGNAL(changed()), this, SLOT(updateFileName()));
+ connect(editorDocument(), SIGNAL(changed()), this, SLOT(updateFileName()));
editor->insertExtraToolBarWidget(TextEditor::BaseTextEditor::Left, m_outlineCombo);
}
@@ -1394,12 +1394,12 @@ void QmlJSTextEditorWidget::followSymbolUnderCursor()
void QmlJSTextEditorWidget::findUsages()
{
- m_findReferences->findUsages(file()->fileName(), textCursor().position());
+ m_findReferences->findUsages(editorDocument()->fileName(), textCursor().position());
}
void QmlJSTextEditorWidget::renameUsages()
{
- m_findReferences->renameUsages(file()->fileName(), textCursor().position());
+ m_findReferences->renameUsages(editorDocument()->fileName(), textCursor().position());
}
void QmlJSTextEditorWidget::showContextPane()
@@ -1680,7 +1680,7 @@ TextEditor::IAssistInterface *QmlJSTextEditorWidget::createAssistInterface(
if (assistKind == TextEditor::Completion) {
return new QmlJSCompletionAssistInterface(document(),
position(),
- editor()->file(),
+ editor()->document(),
reason,
m_semanticInfo);
} else if (assistKind == TextEditor::QuickFix) {
diff --git a/src/plugins/qmljseditor/qmljseditorfactory.cpp b/src/plugins/qmljseditor/qmljseditorfactory.cpp
index e5b6d470ab..42dfcabab6 100644
--- a/src/plugins/qmljseditor/qmljseditorfactory.cpp
+++ b/src/plugins/qmljseditor/qmljseditorfactory.cpp
@@ -78,14 +78,14 @@ QString QmlJSEditorFactory::displayName() const
}
-Core::IFile *QmlJSEditorFactory::open(const QString &fileName)
+Core::IDocument *QmlJSEditorFactory::open(const QString &fileName)
{
Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, id());
if (!iface) {
qWarning() << "QmlEditorFactory::open: openEditor failed for " << fileName;
return 0;
}
- return iface->file();
+ return iface->document();
}
Core::IEditor *QmlJSEditorFactory::createEditor(QWidget *parent)
diff --git a/src/plugins/qmljseditor/qmljseditorfactory.h b/src/plugins/qmljseditor/qmljseditorfactory.h
index f5fa8e6c5f..92a5b60cee 100644
--- a/src/plugins/qmljseditor/qmljseditorfactory.h
+++ b/src/plugins/qmljseditor/qmljseditorfactory.h
@@ -51,7 +51,7 @@ public:
QStringList mimeTypes() const;
Core::Id id() const;
QString displayName() const;
- Core::IFile *open(const QString &fileName);
+ Core::IDocument *open(const QString &fileName);
Core::IEditor *createEditor(QWidget *parent);
private:
diff --git a/src/plugins/qmljseditor/qmljsoutline.cpp b/src/plugins/qmljseditor/qmljsoutline.cpp
index 8bd602dc2a..56208371b1 100644
--- a/src/plugins/qmljseditor/qmljsoutline.cpp
+++ b/src/plugins/qmljseditor/qmljsoutline.cpp
@@ -36,7 +36,7 @@
#include "qmljsoutlinetreeview.h"
#include <coreplugin/icore.h>
-#include <coreplugin/ifile.h>
+#include <coreplugin/idocument.h>
#include <coreplugin/editormanager/editormanager.h>
#include <QDebug>
diff --git a/src/plugins/qmljseditor/qmljsquickfixassist.cpp b/src/plugins/qmljseditor/qmljsquickfixassist.cpp
index 1627c01726..ae8ac21cc9 100644
--- a/src/plugins/qmljseditor/qmljsquickfixassist.cpp
+++ b/src/plugins/qmljseditor/qmljsquickfixassist.cpp
@@ -48,7 +48,7 @@ using namespace TextEditor;
// -----------------------
QmlJSQuickFixAssistInterface::QmlJSQuickFixAssistInterface(QmlJSTextEditorWidget *editor,
TextEditor::AssistReason reason)
- : DefaultAssistInterface(editor->document(), editor->position(), editor->file(), reason)
+ : DefaultAssistInterface(editor->document(), editor->position(), editor->editorDocument(), reason)
, m_editor(editor)
, m_semanticInfo(editor->semanticInfo())
, m_currentFile(QmlJSRefactoringChanges::file(m_editor, m_semanticInfo.document))
diff --git a/src/plugins/qmljseditor/qmljswrapinloader.cpp b/src/plugins/qmljseditor/qmljswrapinloader.cpp
index e1887bf2cd..2673429a20 100644
--- a/src/plugins/qmljseditor/qmljswrapinloader.cpp
+++ b/src/plugins/qmljseditor/qmljswrapinloader.cpp
@@ -33,7 +33,7 @@
#include "qmljswrapinloader.h"
#include "qmljsquickfixassist.h"
-#include <coreplugin/ifile.h>
+#include <coreplugin/idocument.h>
#include <qmljs/parser/qmljsast_p.h>
#include <qmljs/qmljsdocument.h>
diff --git a/src/plugins/qmljseditor/qmltaskmanager.cpp b/src/plugins/qmljseditor/qmltaskmanager.cpp
index ee168a0878..4a238d5b8d 100644
--- a/src/plugins/qmljseditor/qmltaskmanager.cpp
+++ b/src/plugins/qmljseditor/qmltaskmanager.cpp
@@ -33,7 +33,7 @@
#include "qmltaskmanager.h"
#include "qmljseditorconstants.h"
-#include <coreplugin/ifile.h>
+#include <coreplugin/idocument.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/taskhub.h>
#include <qmljs/qmljsmodelmanagerinterface.h>