Editors: Automatically add editor/document id to context and use that

instead of manually adding a context everywhere.

Change-Id: I4336015a6d19349171a255e949da89b0013d6700
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
Eike Ziller
2014-09-02 12:25:20 +02:00
committed by hjk
parent cae737e629
commit 7224ccb2e7
39 changed files with 33 additions and 110 deletions

View File

@@ -65,7 +65,6 @@ namespace Internal {
CMakeEditor::CMakeEditor()
{
addContext(Constants::C_CMAKEEDITOR);
setDuplicateSupported(true);
setCompletionAssistProvider(ExtensionSystem::PluginManager::getObject<CMakeFileCompletionAssistProvider>());
}
@@ -289,13 +288,12 @@ CMakeEditorFactory::CMakeEditorFactory()
setGenericSyntaxHighlighter(QLatin1String(Constants::CMAKEMIMETYPE));
setCommentStyle(Utils::CommentDefinition::HashStyle);
setEditorActionHandlers(Constants::C_CMAKEEDITOR,
TextEditorActionHandler::UnCommentSelection
setEditorActionHandlers(TextEditorActionHandler::UnCommentSelection
| TextEditorActionHandler::JumpToFileUnderCursor);
ActionContainer *contextMenu = ActionManager::createMenu(Constants::M_CONTEXT);
contextMenu->addAction(ActionManager::command(TextEditor::Constants::JUMP_TO_FILE_UNDER_CURSOR));
contextMenu->addSeparator(Context(Constants::C_CMAKEEDITOR));
contextMenu->addSeparator(Context(Constants::CMAKE_EDITOR_ID));
contextMenu->addAction(ActionManager::command(TextEditor::Constants::UN_COMMENT_SELECTION));
}