use IEditor::widget() instead of BaseTextEditor::editorWidget() when possible

This commit is contained in:
hjk
2011-02-22 16:48:08 +01:00
parent 3e7d9bdeff
commit b38ce276d4
2 changed files with 5 additions and 5 deletions

View File

@@ -64,7 +64,7 @@ Core::Context CMakeEditor::context() const
Core::IEditor *CMakeEditor::duplicate(QWidget *parent) Core::IEditor *CMakeEditor::duplicate(QWidget *parent)
{ {
CMakeEditorWidget *w = qobject_cast<CMakeEditorWidget*>(editorWidget()); CMakeEditorWidget *w = qobject_cast<CMakeEditorWidget*>(widget());
CMakeEditorWidget *ret = new CMakeEditorWidget(parent, w->factory(), w->actionHandler()); CMakeEditorWidget *ret = new CMakeEditorWidget(parent, w->factory(), w->actionHandler());
ret->duplicateFrom(w); ret->duplicateFrom(w);
TextEditor::TextEditorSettings::instance()->initializeEditor(ret); TextEditor::TextEditorSettings::instance()->initializeEditor(ret);

View File

@@ -185,10 +185,10 @@ void FormWindowEditor::syncXmlEditor()
void FormWindowEditor::configureXmlEditor() const void FormWindowEditor::configureXmlEditor() const
{ {
TextEditor::PlainTextEditorWidget *editor = TextEditor::PlainTextEditorWidget *widget =
qobject_cast<TextEditor::PlainTextEditorWidget *>(d->m_textEditor.editorWidget()); qobject_cast<TextEditor::PlainTextEditorWidget *>(d->m_textEditor.widget());
if (editor) if (widget)
editor->configure(Core::ICore::instance()->mimeDatabase()->findByFile( widget->configure(Core::ICore::instance()->mimeDatabase()->findByFile(
d->m_file.fileName())); d->m_file.fileName()));
} }