forked from qt-creator/qt-creator
TextEditor: Merge the two sets of *EditorWidget constructors
Change-Id: I45d87d0be722ac36d64af222f03f8cb76242c9df Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
@@ -1423,9 +1423,10 @@ int PermissionsModel::rowCount(const QModelIndex &parent) const
|
||||
|
||||
|
||||
AndroidManifestTextEditorWidget::AndroidManifestTextEditorWidget(AndroidManifestEditorWidget *parent)
|
||||
: TextEditor::BaseTextEditorWidget(new AndroidManifestDocument(parent), parent),
|
||||
: TextEditor::BaseTextEditorWidget(parent),
|
||||
m_parent(parent)
|
||||
{
|
||||
setTextDocument(TextEditor::BaseTextDocumentPtr(new AndroidManifestDocument(parent)));
|
||||
setupAsPlainEditor();
|
||||
textDocument()->setMimeType(QLatin1String(Constants::ANDROID_MANIFEST_MIME_TYPE));
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@ JavaEditor::JavaEditor(JavaEditorWidget *editor)
|
||||
|
||||
Core::IEditor *JavaEditor::duplicate()
|
||||
{
|
||||
JavaEditorWidget *ret = new JavaEditorWidget(
|
||||
qobject_cast<JavaEditorWidget*>(editorWidget()));
|
||||
JavaEditorWidget *ret = new JavaEditorWidget;
|
||||
ret->setTextDocument(editorWidget()->textDocumentPtr());
|
||||
TextEditor::TextEditorSettings::initializeEditor(ret);
|
||||
return ret->editor();
|
||||
}
|
||||
@@ -72,13 +72,7 @@ Core::IEditor *JavaEditor::duplicate()
|
||||
// JavaEditorWidget
|
||||
//
|
||||
|
||||
JavaEditorWidget::JavaEditorWidget(QWidget *parent)
|
||||
: BaseTextEditorWidget(new JavaDocument(), parent)
|
||||
{
|
||||
}
|
||||
|
||||
JavaEditorWidget::JavaEditorWidget(JavaEditorWidget *other)
|
||||
: BaseTextEditorWidget(other)
|
||||
JavaEditorWidget::JavaEditorWidget()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -56,14 +56,10 @@ class JavaEditorWidget : public TextEditor::BaseTextEditorWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
JavaEditorWidget(QWidget *parent = 0);
|
||||
JavaEditorWidget(JavaEditorWidget *other);
|
||||
JavaEditorWidget();
|
||||
|
||||
protected:
|
||||
TextEditor::BaseTextEditor *createEditor();
|
||||
|
||||
private:
|
||||
JavaEditorWidget(BaseTextEditorWidget *); // avoid stupidity
|
||||
};
|
||||
|
||||
class JavaDocument : public TextEditor::BaseTextDocument
|
||||
|
||||
@@ -49,6 +49,7 @@ JavaEditorFactory::JavaEditorFactory()
|
||||
Core::IEditor *JavaEditorFactory::createEditor()
|
||||
{
|
||||
JavaEditorWidget *editor = new JavaEditorWidget;
|
||||
editor->setTextDocument(TextEditor::BaseTextDocumentPtr(new JavaDocument));
|
||||
TextEditor::TextEditorSettings::initializeEditor(editor);
|
||||
return editor->editor();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user