X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/dec7016c0d52129340a5b47f6de4df8af5115e21..5e8b892a519b8d1fef58a747fafb5846b7fa3492:/src/dolphinmainwindow.cpp diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index a93405f53..38537d92a 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -457,10 +457,6 @@ void DolphinMainWindow::updateNewMenu() m_newFileMenu->setViewShowsHiddenFiles(activeViewContainer()->view()->hiddenFilesShown()); m_newFileMenu->checkUpToDate(); m_newFileMenu->setPopupFiles(activeViewContainer()->url()); - - // If we're in the trash, also disable all the 'create new' items - // TODO: remove this once https://phabricator.kde.org/T8234 is implemented - slotWriteStateChanged(m_activeViewContainer->view()->url().scheme() != QLatin1String("trash")); } void DolphinMainWindow::createDirectory() @@ -808,10 +804,9 @@ void DolphinMainWindow::slotHandleUrlStatFinished(KJob* job) void DolphinMainWindow::slotWriteStateChanged(bool isFolderWritable) { - const auto actions = m_newFileMenu->menu()->actions(); - for (auto menuItem : actions) { - menuItem->setEnabled(isFolderWritable); - } + // trash:/ is writable but we don't want to create new items in it. + // TODO: remove the trash check once https://phabricator.kde.org/T8234 is implemented + newFileMenu()->setEnabled(isFolderWritable && m_activeViewContainer->url().scheme() != QLatin1String("trash")); } void DolphinMainWindow::openContextMenu(const QPoint& pos,