forked from qt-creator/qt-creator
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:
@@ -154,7 +154,6 @@ private:
|
||||
CMakeEditorWidget::CMakeEditorWidget()
|
||||
{
|
||||
setCodeFoldingSupported(true);
|
||||
setCompletionAssistProvider(ExtensionSystem::PluginManager::getObject<CMakeFileCompletionAssistProvider>());
|
||||
}
|
||||
|
||||
void CMakeEditorWidget::contextMenuEvent(QContextMenuEvent *e)
|
||||
@@ -271,7 +270,7 @@ QString CMakeDocument::suggestedFileName() const
|
||||
// CMakeEditorFactory
|
||||
//
|
||||
|
||||
CMakeEditorFactory::CMakeEditorFactory()
|
||||
CMakeEditorFactory::CMakeEditorFactory(CMakeSettingsPage *settingsPage)
|
||||
{
|
||||
setId(Constants::CMAKE_EDITOR_ID);
|
||||
setDisplayName(tr(Constants::CMAKE_EDITOR_DISPLAY_NAME));
|
||||
@@ -284,6 +283,8 @@ CMakeEditorFactory::CMakeEditorFactory()
|
||||
setGenericSyntaxHighlighter(QLatin1String(Constants::CMAKEMIMETYPE));
|
||||
setCommentStyle(Utils::CommentDefinition::HashStyle);
|
||||
|
||||
setCompletionAssistProvider(new CMakeFileCompletionAssistProvider(settingsPage));
|
||||
|
||||
setEditorActionHandlers(TextEditorActionHandler::UnCommentSelection
|
||||
| TextEditorActionHandler::JumpToFileUnderCursor);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user