TextEditor: Flip default to 'duplicatedSupported'

opt-out now, for all editors created by BaseTextEditorFactories.

Change-Id: I01d0a9ff26320fcd0b84ff90ff22c747cf84b84c
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
hjk
2014-09-03 11:24:38 +02:00
parent 7ec74147a8
commit 4d93bb8216
12 changed files with 10 additions and 55 deletions

View File

@@ -6553,7 +6553,6 @@ BaseTextEditor::BaseTextEditor()
: d(new BaseTextEditorPrivate)
{
addContext(TextEditor::Constants::C_TEXTEDITOR);
setDuplicateSupported(true);
}
BaseTextEditor::~BaseTextEditor()
@@ -7189,6 +7188,7 @@ BaseTextEditorFactory::BaseTextEditorFactory(QObject *parent)
m_editorCreator = []() { return new BaseTextEditor; };
m_widgetCreator = []() { return new BaseTextEditorWidget; };
m_commentStyle = CommentDefinition::NoStyle;
m_duplicatedSupported = true;
}
void BaseTextEditorFactory::setDocumentCreator(const DocumentCreator &creator)
@@ -7245,6 +7245,11 @@ void BaseTextEditorFactory::setCommentStyle(CommentDefinition::Style style)
m_commentStyle = style;
}
void BaseTextEditorFactory::setDuplicatedSupported(bool on)
{
m_duplicatedSupported = on;
}
BaseTextEditor *BaseTextEditorFactory::duplicateTextEditor(BaseTextEditor *other)
{
BaseTextEditor *editor = createEditorHelper(other->editorWidget()->textDocumentPtr());
@@ -7272,6 +7277,7 @@ BaseTextEditor *BaseTextEditorFactory::createEditorHelper(const BaseTextDocument
{
BaseTextEditorWidget *widget = m_widgetCreator();
BaseTextEditor *editor = m_editorCreator();
editor->setDuplicateSupported(m_duplicatedSupported);
editor->addContext(id());
editor->d->m_origin = this;