aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/texteditoractionhandler.cpp
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2020-06-17 10:28:27 +0200
committerDavid Schulz <david.schulz@qt.io>2020-06-17 09:47:44 +0000
commitaaa1376576ec3a87fd2e9b94c5c0a543b0f8819a (patch)
tree9429f14a3b52e3614e9b40a7fe8a949388053509 /src/plugins/texteditor/texteditoractionhandler.cpp
parentc7db952648f6283d78d71f2602c530f79e9f4b15 (diff)
Editor: Allow setting the optional action mask per editor
Instead of just enable actions that were disabled from the beginning you can no disable optional actions. Change-Id: I986b8a72523a8aeec9f4ccf76cd4921018ffc003 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/texteditor/texteditoractionhandler.cpp')
-rw-r--r--src/plugins/texteditor/texteditoractionhandler.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp
index 23f0c640e9..e1c037fa1e 100644
--- a/src/plugins/texteditor/texteditoractionhandler.cpp
+++ b/src/plugins/texteditor/texteditoractionhandler.cpp
@@ -543,9 +543,8 @@ void TextEditorActionHandlerPrivate::updateActions()
void TextEditorActionHandlerPrivate::updateOptionalActions()
{
- uint optionalActions = m_optionalActions;
- if (m_currentEditorWidget)
- optionalActions |= m_currentEditorWidget->optionalActionMask();
+ const uint optionalActions = m_currentEditorWidget ? m_currentEditorWidget->optionalActions()
+ : m_optionalActions;
m_followSymbolAction->setEnabled(
optionalActions & TextEditorActionHandler::FollowSymbolUnderCursor);
m_followSymbolInNextSplitAction->setEnabled(
@@ -622,6 +621,11 @@ TextEditorActionHandler::TextEditorActionHandler(Core::Id editorId,
d->m_findTextWidget = TextEditorWidget::fromEditor;
}
+uint TextEditorActionHandler::optionalActions() const
+{
+ return d->m_optionalActions;
+}
+
TextEditorActionHandler::~TextEditorActionHandler()
{
delete d;