Fix adding "Create New..." menu to toolbar

Summary:
Access the object by its existing name rather than renaming it.

BUG: 405780
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
This commit is contained in:
Nate Graham 2019-04-18 07:43:09 -06:00
parent 924c883edc
commit 48c082767e
2 changed files with 1 additions and 2 deletions

View file

@ -1103,7 +1103,6 @@ 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")));

View file

@ -243,7 +243,7 @@ void DolphinMainWindowTest::testNewFileMenuEnabled()
QVERIFY(QTest::qWaitForWindowExposed(m_mainWindow.data()));
QVERIFY(m_mainWindow->isVisible());
auto newFileMenu = m_mainWindow->findChild<DolphinNewFileMenu*>("newFileMenu");
auto newFileMenu = m_mainWindow->findChild<DolphinNewFileMenu*>("new_menu");
QVERIFY(newFileMenu);
QFETCH(bool, expectedEnabled);