forked from qt-creator/qt-creator
Revert "TextEditorFactory use rvalue refs for creators"
This reverts commit 2be30c27ac.
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: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
@@ -7709,29 +7709,29 @@ TextEditorFactory::~TextEditorFactory()
|
|||||||
delete d;
|
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)
|
void TextEditorFactory::setUseGenericHighlighter(bool enabled)
|
||||||
@@ -7739,9 +7739,9 @@ void TextEditorFactory::setUseGenericHighlighter(bool enabled)
|
|||||||
d->m_useGenericHighlighter = 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)
|
void TextEditorFactory::setEditorActionHandlers(Id contextId, uint optionalActions)
|
||||||
|
|||||||
@@ -634,13 +634,13 @@ public:
|
|||||||
typedef std::function<Indenter *()> IndenterCreator;
|
typedef std::function<Indenter *()> IndenterCreator;
|
||||||
typedef std::function<AutoCompleter *()> AutoCompleterCreator;
|
typedef std::function<AutoCompleter *()> AutoCompleterCreator;
|
||||||
|
|
||||||
void setDocumentCreator(DocumentCreator &&creator);
|
void setDocumentCreator(const DocumentCreator &creator);
|
||||||
void setEditorWidgetCreator(EditorWidgetCreator &&creator);
|
void setEditorWidgetCreator(const EditorWidgetCreator &creator);
|
||||||
void setEditorCreator(EditorCreator &&creator);
|
void setEditorCreator(const EditorCreator &creator);
|
||||||
void setIndenterCreator(IndenterCreator &&creator);
|
void setIndenterCreator(const IndenterCreator &creator);
|
||||||
void setSyntaxHighlighterCreator(SyntaxHighLighterCreator &&creator);
|
void setSyntaxHighlighterCreator(const SyntaxHighLighterCreator &creator);
|
||||||
void setUseGenericHighlighter(bool enabled);
|
void setUseGenericHighlighter(bool enabled);
|
||||||
void setAutoCompleterCreator(AutoCompleterCreator &&creator);
|
void setAutoCompleterCreator(const AutoCompleterCreator &creator);
|
||||||
|
|
||||||
void setEditorActionHandlers(Core::Id contextId, uint optionalActions);
|
void setEditorActionHandlers(Core::Id contextId, uint optionalActions);
|
||||||
void setEditorActionHandlers(uint optionalActions);
|
void setEditorActionHandlers(uint optionalActions);
|
||||||
|
|||||||
Reference in New Issue
Block a user