forked from qt-creator/qt-creator
DockFocusController: Avoid using sender()
It looks like we can be connected to only one DockAreaWidget, and it's always m_focusArea, so use m_focusArea instead of sender(). Change-Id: I3b226d98b05c857a20c126f76db195d4b79fc5c1 Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
@@ -215,14 +215,10 @@ namespace ADS
|
|||||||
|
|
||||||
void DockFocusController::onFocusedDockAreaViewToggled(bool open)
|
void DockFocusController::onFocusedDockAreaViewToggled(bool open)
|
||||||
{
|
{
|
||||||
if (d->m_dockManager->isRestoringState())
|
if (d->m_dockManager->isRestoringState() || !d->m_focusedArea || open)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DockAreaWidget* dockArea = qobject_cast<DockAreaWidget *>(sender());
|
auto container = d->m_focusedArea->dockContainer();
|
||||||
if (!dockArea || open)
|
|
||||||
return;
|
|
||||||
|
|
||||||
auto container = dockArea->dockContainer();
|
|
||||||
auto openedDockAreas = container->openedDockAreas();
|
auto openedDockAreas = container->openedDockAreas();
|
||||||
if (openedDockAreas.isEmpty())
|
if (openedDockAreas.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user