Skip to content

Bring back the "Create New" menu in the menu bar (kf6)

Fixes DolphinMainWindowTest::testNewFileMenuEnabled(). Tests are now passing again for my build.

This was broken by commit c64059bd which switched to the new, non-deprecated KNewFileMenu constructor (kio commit 89bc6bad) that doesn't add itself to the passed KActionCollection parameter. After the switch, hamburger menu and context menu was still working as intended but the menu bar was missing the "Create New" menu.

This commit adds the addAction() call to the File menu setup that would have previously been called by the deprecated KNewFileMenu constructor. The corresponding test can now find the QObject for the menu's named action again, verifying its existence and enabled-ness like it did before.


CC @nicolasfella who refactored KNewFileMenu and may want to review this MR.

I also included a patch to remove all the ifdefs for old KIO versions as this branch is now on KF6 where we can rely on the latest, non-deprecated API. This first commit helped me understand what's missing, leading to the fix described above.

Merge request reports