TextEditor: Move CompletionAssistProvider construction

... to the editor factories and pass it to the document, not the widget.
Saves some code, puts fewer objects into the object pool.

Change-Id: Iaaf250af74dc4e0c62700873accbb40ba88b7d9e
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
This commit is contained in:
hjk
2014-10-01 22:39:47 +02:00
parent 5bb8134ec1
commit 1f65111e55
25 changed files with 78 additions and 97 deletions

View File

@@ -134,7 +134,6 @@ private:
GlslEditorWidget::GlslEditorWidget()
{
setCompletionAssistProvider(ExtensionSystem::PluginManager::getObject<GlslCompletionAssistProvider>());
setAutoCompleter(new GlslCompleter);
m_outlineCombo = 0;
setParenthesesMatchingEnabled(true);
@@ -343,6 +342,7 @@ GlslEditorFactory::GlslEditorFactory()
setIndenterCreator([]() { return new GlslIndenter; });
setSyntaxHighlighterCreator([]() { return new GlslHighlighter; });
setCommentStyle(Utils::CommentDefinition::CppStyle);
setCompletionAssistProvider(new GlslCompletionAssistProvider);
setEditorActionHandlers(TextEditorActionHandler::Format
| TextEditorActionHandler::UnCommentSelection