From d66acb51d0c8b511df9f679806cbd3d84cce41ef Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 14 Feb 2012 16:43:51 +0100 Subject: Rename IFile->IDocument and FileManager->DocumentManager And adapt the other API respectively. Change-Id: I1e04e555409be09242db6890f9e013396f83aeed Reviewed-by: Bill King Reviewed-by: Eike Ziller --- src/plugins/glsleditor/glslcompletionassist.cpp | 12 ++++++------ src/plugins/glsleditor/glslcompletionassist.h | 5 ++--- src/plugins/glsleditor/glsleditor.cpp | 2 +- src/plugins/glsleditor/glsleditorfactory.cpp | 4 ++-- src/plugins/glsleditor/glsleditorfactory.h | 2 +- 5 files changed, 12 insertions(+), 13 deletions(-) (limited to 'src/plugins/glsleditor') diff --git a/src/plugins/glsleditor/glslcompletionassist.cpp b/src/plugins/glsleditor/glslcompletionassist.cpp index 01c35d0e5f..6bd3469759 100644 --- a/src/plugins/glsleditor/glslcompletionassist.cpp +++ b/src/plugins/glsleditor/glslcompletionassist.cpp @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include #include @@ -239,7 +239,7 @@ IAssistProposal *GLSLCompletionAssistProcessor::perform(const IAssistInterface * bool functionCall = (ch == QLatin1Char('(') && pos == m_interface->position() - 1); if (ch == QLatin1Char(',')) { - QTextCursor tc(m_interface->document()); + QTextCursor tc(m_interface->textDocument()); tc.setPosition(pos); const int start = expressionUnderCursor.startOfFunctionCall(tc); if (start == -1) @@ -254,7 +254,7 @@ IAssistProposal *GLSLCompletionAssistProcessor::perform(const IAssistInterface * if (ch == QLatin1Char('.') || functionCall) { const bool memberCompletion = ! functionCall; - QTextCursor tc(m_interface->document()); + QTextCursor tc(m_interface->textDocument()); tc.setPosition(pos); // get the expression under cursor @@ -465,13 +465,13 @@ void GLSLCompletionAssistProcessor::addCompletion(const QString &text, // ----------------------------- // GLSLCompletionAssistInterface // ----------------------------- -GLSLCompletionAssistInterface::GLSLCompletionAssistInterface(QTextDocument *document, +GLSLCompletionAssistInterface::GLSLCompletionAssistInterface(QTextDocument *textDocument, int position, - Core::IFile *file, + Core::IDocument *document, TextEditor::AssistReason reason, const QString &mimeType, const Document::Ptr &glslDoc) - : DefaultAssistInterface(document, position, file, reason) + : DefaultAssistInterface(textDocument, position, document, reason) , m_mimeType(mimeType) , m_glslDoc(glslDoc) { diff --git a/src/plugins/glsleditor/glslcompletionassist.h b/src/plugins/glsleditor/glslcompletionassist.h index d0c134360f..e644d2b1d1 100644 --- a/src/plugins/glsleditor/glslcompletionassist.h +++ b/src/plugins/glsleditor/glslcompletionassist.h @@ -98,9 +98,8 @@ private: class GLSLCompletionAssistInterface : public TextEditor::DefaultAssistInterface { public: - GLSLCompletionAssistInterface(QTextDocument *document, - int position, - Core::IFile *file, + GLSLCompletionAssistInterface(QTextDocument *textDocument, + int position, Core::IDocument *document, TextEditor::AssistReason reason, const QString &mimeType, const Document::Ptr &glslDoc); diff --git a/src/plugins/glsleditor/glsleditor.cpp b/src/plugins/glsleditor/glsleditor.cpp index 6a6f9a1f69..e9a7a1738c 100644 --- a/src/plugins/glsleditor/glsleditor.cpp +++ b/src/plugins/glsleditor/glsleditor.cpp @@ -420,7 +420,7 @@ TextEditor::IAssistInterface *GLSLTextEditorWidget::createAssistInterface( if (kind == TextEditor::Completion) return new GLSLCompletionAssistInterface(document(), position(), - editor()->file(), + editor()->document(), reason, mimeType(), glslDocument()); diff --git a/src/plugins/glsleditor/glsleditorfactory.cpp b/src/plugins/glsleditor/glsleditorfactory.cpp index deadc5ea34..397e392241 100644 --- a/src/plugins/glsleditor/glsleditorfactory.cpp +++ b/src/plugins/glsleditor/glsleditorfactory.cpp @@ -75,14 +75,14 @@ QString GLSLEditorFactory::displayName() const return tr(C_GLSLEDITOR_DISPLAY_NAME); } -Core::IFile *GLSLEditorFactory::open(const QString &fileName) +Core::IDocument *GLSLEditorFactory::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 *GLSLEditorFactory::createEditor(QWidget *parent) diff --git a/src/plugins/glsleditor/glsleditorfactory.h b/src/plugins/glsleditor/glsleditorfactory.h index e54128266b..3cfad99e31 100644 --- a/src/plugins/glsleditor/glsleditorfactory.h +++ b/src/plugins/glsleditor/glsleditorfactory.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 slots: -- cgit v1.2.1