From 74eda13a4340e1b0ffc9ec32a512b11fc658f72f Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 1 Jul 2024 08:21:33 +0200 Subject: [PATCH] Mode: Fix comment regarding contexts Nowadays all IContext instances of the whole parent hierarchy of the current focus widget are collected. Nevertheless it makes sense to just add the current mode's context. Change-Id: Ia42a693d9b4cd58ac63bb99749b5dfa62f7801aa Reviewed-by: David Schulz --- src/plugins/coreplugin/modemanager.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugins/coreplugin/modemanager.cpp b/src/plugins/coreplugin/modemanager.cpp index c93ebe9a361..c03dd3250cf 100644 --- a/src/plugins/coreplugin/modemanager.cpp +++ b/src/plugins/coreplugin/modemanager.cpp @@ -311,9 +311,8 @@ void ModeManager::currentTabChanged(int index) if (!mode) return; - // FIXME: This hardcoded context update is required for the Debug and Edit modes, since - // they use the editor widget, which is already a context widget so the main window won't - // go further up the parent tree to find the mode context. + // Set the mode's context regardless of focus widget. + // Whenever a mode is active, it's Context is active. ICore::updateAdditionalContexts(d->m_addedContexts, mode->context()); d->m_addedContexts = mode->context();