aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/basetexteditor.cpp
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2014-09-03 11:24:38 +0200
committerhjk <hjk121@nokiamail.com>2014-09-03 14:10:47 +0200
commit4d93bb8216e80dac72d470354b23b6d69d804b3c (patch)
treefe4489f59ef7231744e05b2eb157ba6d46aeb733 /src/plugins/texteditor/basetexteditor.cpp
parent7ec74147a8f78ca2e376d238baa4449f59a1d552 (diff)
TextEditor: Flip default to 'duplicatedSupported'
opt-out now, for all editors created by BaseTextEditorFactories. Change-Id: I01d0a9ff26320fcd0b84ff90ff22c747cf84b84c Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/plugins/texteditor/basetexteditor.cpp')
-rw-r--r--src/plugins/texteditor/basetexteditor.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index 0a2925d468..e834eaf8d9 100644
--- a/src/plugins/texteditor/basetexteditor.cpp
+++ b/src/plugins/texteditor/basetexteditor.cpp
@@ -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;