SUMMARY The "Create New..." button is never shown in Dolphin's toolbar STEPS TO REPRODUCE - configure toolbar to have a "Create New..." button OBSERVED RESULT - there is no button EXPECTED RESULT - button should be there SOFTWARE/OS VERSIONS Operating System: openSUSE Tumbleweed 20190320 KDE Plasma Version: 5.15.3 KDE Frameworks Version: 5.55.0 Qt Version: 5.12.0 Kernel Version: 5.0.2-1-default OS Type: 64-bit Processors: 4 × Intel® Core™ i5-2540M CPU @ 2.60GHz Memory: 15,5 GiB ADDITIONAL INFORMATION On another PC (also latest TW with Plasma 5.15.3 and Frameworks 5.55.0), there _is_ a "Create New..." button, despite not being configured in the toolbar's settings. Enabling it does nothing (still just one button), disabling it again also has no effect (button _still_ shown despite not being enabled).
Can confirm, I don't have the button either.
*** Bug 406635 has been marked as a duplicate of this bug. ***
We have a report that this worked in 17.12.3, so it seems to have regressed recently. I'll see if I can figure out how and why.
with git bisect, I found that this broke with https://cgit.kde.org/dolphin.git/commit/?id=dec7016c0d52129340a5b47f6de4df8af5115e21 Specifically, this bit: diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 3e3803d..a93405f 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -1066,6 +1066,7 @@ void DolphinMainWindow::setupActions() { // setup 'File' menu m_newFileMenu = new DolphinNewFileMenu(actionCollection(), this); + m_newFileMenu->setObjectName("newFileMenu"); QMenu* menu = m_newFileMenu->menu(); menu->setTitle(i18nc("@title:menu Create new folder, file, link, etc.", "Create New")); menu->setIcon(QIcon::fromTheme(QStringLiteral("document-new")));
Adding an action to KActionCollection sets its objectName to the given name. DolphinNewFileMenu calls KNewFileMenu with "new_menu". I think the line Nate identified as causing the issue can be removed and the unittest adjusted to just look findChild("new_menu") instead of "newFileMenu".
Thanks Kai, that makes perfect sense. Patch: https://phabricator.kde.org/D20664
Git commit 48c082767e3124b1ac6575f83bfcdcdc3e3e9b62 by Nate Graham. Committed on 18/04/2019 at 19:17. Pushed by ngraham into branch 'Applications/19.04'. Fix adding "Create New..." menu to toolbar Summary: Access the object by its existing name rather than renaming it. FIXED-IN: 19.04.1 Test Plan: - Add {nav Create New} item to toolbar; it now works - Verify that {nav Create New} menu and toolbar items are disabled when in the trash - All tests still pass Reviewers: elvisangelaccio, broulik, #dolphin, cfeck Reviewed By: cfeck Subscribers: cfeck, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D20664 M +0 -1 src/dolphinmainwindow.cpp M +1 -1 src/tests/dolphinmainwindowtest.cpp https://commits.kde.org/dolphin/48c082767e3124b1ac6575f83bfcdcdc3e3e9b62