diff options
| author | Oleksandr Bondar <[email protected]> | 2026-03-26 16:00:50 +0100 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2026-04-03 10:42:21 +0000 |
| commit | c3ef613f29dd256e1b6065f1c744241b6f69788a (patch) | |
| tree | 0816d5ec2636213b4ac5fe3bf2d5c07164b1bcf2 | |
| parent | 272de8b6dda47f98ae62e498c7a568c7606f3517 (diff) | |
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
| -rw-r--r-- | src/dolphinmainwindow.cpp | 7 | ||||
| -rw-r--r-- | src/tests/dolphinmainwindowtest.cpp | 2 |
2 files changed, 4 insertions, 5 deletions
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<KHamburgerMenu *>(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<QAction> DolphinMainWindow::preferredSearchTool() diff --git a/src/tests/dolphinmainwindowtest.cpp b/src/tests/dolphinmainwindowtest.cpp index a1727afdb..21e48f246 100644 --- a/src/tests/dolphinmainwindowtest.cpp +++ b/src/tests/dolphinmainwindowtest.cpp @@ -938,7 +938,7 @@ void DolphinMainWindowTest::testAccessibilityTree() // after going forwards which is probably not intended. } } - QCOMPARE_GE(testedObjectsSizeAfterTraversingForwards, 11); // The test did not reach many objects while using the Tab key to move through Dolphin. Did the + QCOMPARE_GE(testedObjectsSizeAfterTraversingForwards, 10); // The test did not reach many objects while using the Tab key to move through Dolphin. Did the // test run correctly? } |
