diff options
author | hjk <qtc-committer@nokia.com> | 2011-02-21 16:02:26 +0100 |
---|---|---|
committer | hjk <qtc-committer@nokia.com> | 2011-02-22 11:23:53 +0100 |
commit | f576ad9f2c169bfa4d336ba2b3b1918f03df6916 (patch) | |
tree | f9e708ea1972b10d5465c915e7b9d0f7572f671f /src/plugins/designer | |
parent | e32cf192f7ba34dda96b61507b440c6a17b51a0c (diff) | |
download | qt-creator-f576ad9f2c169bfa4d336ba2b3b1918f03df6916.tar.gz |
texteditor: merge ITextEditable into ITextEditor
rename BastTextEditor->BaseTextEditorWidget, BaseTextEditorEditable->BaseTextEditor
rename BaseTextEditor{,Widget} subclasses
rename editableInterface->editorInterface
rename createEditableInterface->createEditor
minor cleanups after renamings
Diffstat (limited to 'src/plugins/designer')
-rw-r--r-- | src/plugins/designer/designerxmleditor.cpp | 4 | ||||
-rw-r--r-- | src/plugins/designer/designerxmleditor.h | 4 | ||||
-rw-r--r-- | src/plugins/designer/formeditorw.cpp | 2 | ||||
-rw-r--r-- | src/plugins/designer/formwindoweditor.cpp | 12 | ||||
-rw-r--r-- | src/plugins/designer/formwindoweditor.h | 4 | ||||
-rw-r--r-- | src/plugins/designer/qtcreatorintegration.cpp | 13 |
6 files changed, 19 insertions, 20 deletions
diff --git a/src/plugins/designer/designerxmleditor.cpp b/src/plugins/designer/designerxmleditor.cpp index 9208348692..3e048b43da 100644 --- a/src/plugins/designer/designerxmleditor.cpp +++ b/src/plugins/designer/designerxmleditor.cpp @@ -43,13 +43,13 @@ namespace Internal { DesignerXmlEditor::DesignerXmlEditor(QDesignerFormWindowInterface *form, QWidget *parent) : - TextEditor::PlainTextEditor(parent), + TextEditor::PlainTextEditorWidget(parent), m_designerEditor(new FormWindowEditor(this, form)) { setReadOnly(true); } -TextEditor::BaseTextEditorEditable *DesignerXmlEditor::createEditableInterface() +TextEditor::BaseTextEditor *DesignerXmlEditor::createEditor() { if (Designer::Constants::Internal::debug) qDebug() << "DesignerXmlEditor::createEditableInterface()"; diff --git a/src/plugins/designer/designerxmleditor.h b/src/plugins/designer/designerxmleditor.h index 92faf876a4..748ffea6ed 100644 --- a/src/plugins/designer/designerxmleditor.h +++ b/src/plugins/designer/designerxmleditor.h @@ -53,7 +53,7 @@ namespace Internal { * Internally manages a FormWindowEditor and uses the plain text * editable embedded in it. */ -class DesignerXmlEditor : public TextEditor::PlainTextEditor +class DesignerXmlEditor : public TextEditor::PlainTextEditorWidget { Q_OBJECT public: @@ -63,7 +63,7 @@ public: FormWindowEditor *designerEditor() const; protected: - virtual TextEditor::BaseTextEditorEditable *createEditableInterface(); + virtual TextEditor::BaseTextEditor *createEditor(); private: FormWindowEditor *m_designerEditor; diff --git a/src/plugins/designer/formeditorw.cpp b/src/plugins/designer/formeditorw.cpp index f90006c1fa..f67b26f170 100644 --- a/src/plugins/designer/formeditorw.cpp +++ b/src/plugins/designer/formeditorw.cpp @@ -723,7 +723,7 @@ EditorData FormEditorW::createEditor(QWidget *parent) resourceHandler, SLOT(updateResources())); m_editorWidget->add(data); - m_toolBar->addEditor(xmlEditor->editableInterface()); + m_toolBar->addEditor(xmlEditor->editor()); return data; } diff --git a/src/plugins/designer/formwindoweditor.cpp b/src/plugins/designer/formwindoweditor.cpp index 2d0ffca66a..af56d2083f 100644 --- a/src/plugins/designer/formwindoweditor.cpp +++ b/src/plugins/designer/formwindoweditor.cpp @@ -62,7 +62,7 @@ struct FormWindowEditorPrivate explicit FormWindowEditorPrivate(Internal::DesignerXmlEditor *editor, QDesignerFormWindowInterface *form); - TextEditor::PlainTextEditorEditable m_textEditable; + TextEditor::PlainTextEditor m_textEditable; Internal::FormWindowFile m_file; Core::Context m_context; }; @@ -185,8 +185,8 @@ void FormWindowEditor::syncXmlEditor() void FormWindowEditor::configureXmlEditor() const { - TextEditor::PlainTextEditor *editor = - qobject_cast<TextEditor::PlainTextEditor *>(d->m_textEditable.editor()); + TextEditor::PlainTextEditorWidget *editor = + qobject_cast<TextEditor::PlainTextEditorWidget *>(d->m_textEditable.editorWidget()); if (editor) editor->configure(Core::ICore::instance()->mimeDatabase()->findByFile( d->m_file.fileName())); @@ -194,8 +194,8 @@ void FormWindowEditor::configureXmlEditor() const void FormWindowEditor::syncXmlEditor(const QString &contents) { - d->m_textEditable.editor()->setPlainText(contents); - d->m_textEditable.editor()->setReadOnly(true); + d->m_textEditable.editorWidget()->setPlainText(contents); + d->m_textEditable.editorWidget()->setReadOnly(true); } Core::IFile *FormWindowEditor::file() @@ -271,7 +271,7 @@ TextEditor::BaseTextDocument *FormWindowEditor::textDocument() return qobject_cast<TextEditor::BaseTextDocument*>(d->m_textEditable.file()); } -TextEditor::PlainTextEditorEditable *FormWindowEditor::textEditable() +TextEditor::PlainTextEditor *FormWindowEditor::textEditable() { return &d->m_textEditable; } diff --git a/src/plugins/designer/formwindoweditor.h b/src/plugins/designer/formwindoweditor.h index 7dcc5e21da..585927a7e4 100644 --- a/src/plugins/designer/formwindoweditor.h +++ b/src/plugins/designer/formwindoweditor.h @@ -47,7 +47,7 @@ namespace Core { namespace TextEditor { class BaseTextDocument; - class PlainTextEditorEditable; + class PlainTextEditor; } namespace Designer { @@ -102,7 +102,7 @@ public: QString contents() const; TextEditor::BaseTextDocument *textDocument(); - TextEditor::PlainTextEditorEditable *textEditable(); + TextEditor::PlainTextEditor *textEditable(); public slots: void syncXmlEditor(); diff --git a/src/plugins/designer/qtcreatorintegration.cpp b/src/plugins/designer/qtcreatorintegration.cpp index 7c8d647c59..c932309393 100644 --- a/src/plugins/designer/qtcreatorintegration.cpp +++ b/src/plugins/designer/qtcreatorintegration.cpp @@ -58,7 +58,6 @@ #include <coreplugin/editormanager/editormanager.h> #include <extensionsystem/pluginmanager.h> #include <texteditor/basetexteditor.h> -#include <texteditor/itexteditable.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/session.h> #include <utils/qtcassert.h> @@ -267,9 +266,9 @@ static Document::Ptr findDefinition(Function *functionDeclaration, int *line) return Document::Ptr(); } -static inline ITextEditable *editableAt(const QString &fileName, int line, int column) +static inline ITextEditor *editableAt(const QString &fileName, int line, int column) { - return qobject_cast<ITextEditable *>(TextEditor::BaseTextEditor::openEditorAt(fileName, line, column)); + return qobject_cast<ITextEditor *>(TextEditor::BaseTextEditorWidget::openEditorAt(fileName, line, column)); } static void addDeclaration(const Snapshot &snapshot, @@ -290,8 +289,8 @@ static void addDeclaration(const Snapshot &snapshot, //! \todo change this to use the Refactoring changes. // - if (ITextEditable *editable = editableAt(fileName, loc.line(), loc.column() - 1)) { - BaseTextEditor *editor = qobject_cast<BaseTextEditor *>(editable->widget()); + if (ITextEditor *editable = editableAt(fileName, loc.line(), loc.column() - 1)) { + BaseTextEditorWidget *editor = qobject_cast<BaseTextEditorWidget *>(editable->widget()); if (editor) { QTextCursor tc = editor->textCursor(); int pos = tc.position(); @@ -333,7 +332,7 @@ static Document::Ptr addDefinition(const CPlusPlus::Snapshot &docTable, //! \todo change this to use the Refactoring changes. // - if (ITextEditable *editable = editableAt(doc->fileName(), 0, 0)) { + if (ITextEditor *editable = editableAt(doc->fileName(), 0, 0)) { // //! \todo use the InsertionPointLocator to insert at the correct place. @@ -616,7 +615,7 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName, } // jump to function definition, position within code - TextEditor::BaseTextEditor::openEditorAt(sourceDoc->fileName(), line + 2, indentation); + TextEditor::BaseTextEditorWidget::openEditorAt(sourceDoc->fileName(), line + 2, indentation); return true; } |