From c3ef613f29dd256e1b6065f1c744241b6f69788a Mon Sep 17 00:00:00 2001 From: Oleksandr Bondar Date: Thu, 26 Mar 2026 16:00:50 +0100 Subject: dolphinmainwindow: use directly ShowMenubar action to change menuBar visibility The menubar check was defined by menubar isHidden var. The logic has been reverted. The toggleShowMenuBar func was simply inverting the isVisible var. Now it's being set the menubar isChecked value. This led to testedObjectsSizeAfterTraversingForwards=10 instead of 11 (apparently there was a phantom object), so adjust the comparation in dolphinmainwindowtest. BUG: 492298 --- src/dolphinmainwindow.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/dolphinmainwindow.cpp') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index c514c1f98..12ca26898 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -237,9 +237,8 @@ DolphinMainWindow::DolphinMainWindow() } } - const bool showMenu = !menuBar()->isHidden(); QAction *showMenuBarAction = actionCollection()->action(KStandardAction::name(KStandardAction::ShowMenubar)); - showMenuBarAction->setChecked(showMenu); // workaround for bug #171080 + menuBar()->setVisible(showMenuBarAction->isChecked()); auto hamburgerMenu = static_cast(actionCollection()->action(KStandardAction::name(KStandardAction::HamburgerMenu))); hamburgerMenu->setMenuBar(menuBar()); @@ -1348,8 +1347,8 @@ void DolphinMainWindow::compareFiles() void DolphinMainWindow::toggleShowMenuBar() { - const bool visible = menuBar()->isVisible(); - menuBar()->setVisible(!visible); + QAction *showMenuBarAction = actionCollection()->action(KStandardAction::name(KStandardAction::ShowMenubar)); + menuBar()->setVisible(showMenuBarAction->isChecked()); } QPointer DolphinMainWindow::preferredSearchTool() -- cgit v1.3