Commit 2de7f3e7 authored by Eike Ziller's avatar Eike Ziller

Revert "TextEditorFactory use rvalue refs for creators"

This reverts commit 2be30c27.
The above patch puts limitations on the use of the API, while
being a questionable optimization. There is no reason why it
should not be possible to use lvalues for setting the various
creators. And MSVC2013 even thinks that actual functions
are lvalues for std::function objects.

Change-Id: Ia4daa7c3367b51bd613e1ff840f0ee617d36f54b
Reviewed-by: default avatarTim Jenssen <tim.jenssen@theqtcompany.com>
parent 73bb92c5
......@@ -7709,29 +7709,29 @@ TextEditorFactory::~TextEditorFactory()
delete d;
}
void TextEditorFactory::setDocumentCreator(DocumentCreator &&creator)
void TextEditorFactory::setDocumentCreator(const DocumentCreator &creator)
{
d->m_documentCreator = std::move(creator);
d->m_documentCreator = creator;
}
void TextEditorFactory::setEditorWidgetCreator(EditorWidgetCreator &&creator)
void TextEditorFactory::setEditorWidgetCreator(const EditorWidgetCreator &creator)
{
d->m_widgetCreator = std::move(creator);
d->m_widgetCreator = creator;
}
void TextEditorFactory::setEditorCreator(EditorCreator &&creator)
void TextEditorFactory::setEditorCreator(const EditorCreator &creator)
{
d->m_editorCreator = std::move(creator);
d->m_editorCreator = creator;
}
void TextEditorFactory::setIndenterCreator(IndenterCreator &&creator)
void TextEditorFactory::setIndenterCreator(const IndenterCreator &creator)
{
d->m_indenterCreator = std::move(creator);
d->m_indenterCreator = creator;
}
void TextEditorFactory::setSyntaxHighlighterCreator(SyntaxHighLighterCreator &&creator)
void TextEditorFactory::setSyntaxHighlighterCreator(const SyntaxHighLighterCreator &creator)
{
d->m_syntaxHighlighterCreator = std::move(creator);
d->m_syntaxHighlighterCreator = creator;
}
void TextEditorFactory::setUseGenericHighlighter(bool enabled)
......@@ -7739,9 +7739,9 @@ void TextEditorFactory::setUseGenericHighlighter(bool enabled)
d->m_useGenericHighlighter = enabled;
}
void TextEditorFactory::setAutoCompleterCreator(AutoCompleterCreator &&creator)
void TextEditorFactory::setAutoCompleterCreator(const AutoCompleterCreator &creator)
{
d->m_autoCompleterCreator = std::move(creator);
d->m_autoCompleterCreator = creator;
}
void TextEditorFactory::setEditorActionHandlers(Id contextId, uint optionalActions)
......
......@@ -634,13 +634,13 @@ public:
typedef std::function<Indenter *()> IndenterCreator;
typedef std::function<AutoCompleter *()> AutoCompleterCreator;
void setDocumentCreator(DocumentCreator &&creator);
void setEditorWidgetCreator(EditorWidgetCreator &&creator);
void setEditorCreator(EditorCreator &&creator);
void setIndenterCreator(IndenterCreator &&creator);
void setSyntaxHighlighterCreator(SyntaxHighLighterCreator &&creator);
void setDocumentCreator(const DocumentCreator &creator);
void setEditorWidgetCreator(const EditorWidgetCreator &creator);
void setEditorCreator(const EditorCreator &creator);
void setIndenterCreator(const IndenterCreator &creator);
void setSyntaxHighlighterCreator(const SyntaxHighLighterCreator &creator);
void setUseGenericHighlighter(bool enabled);
void setAutoCompleterCreator(AutoCompleterCreator &&creator);
void setAutoCompleterCreator(const AutoCompleterCreator &creator);
void setEditorActionHandlers(Core::Id contextId, uint optionalActions);
void setEditorActionHandlers(uint optionalActions);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment