┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinmainwindow.cpp
diff options
context:
space:
mode:
authorElvis Angelaccio <[email protected]>2018-10-07 19:53:08 +0200
committerElvis Angelaccio <[email protected]>2018-10-07 19:53:08 +0200
commit7904ae417af2b7b59ee54a9f875191e9e4802492 (patch)
tree17d2aefe619ff58bafa8b54bbba049fbfe673886 /src/dolphinmainwindow.cpp
parent467df92fb9f2dc5f54162feb9149b4636bac43e7 (diff)
parente2f93a28294fd0575cf8427f31a2fba4f8d6b099 (diff)
Merge branch 'Applications/18.08'
Diffstat (limited to 'src/dolphinmainwindow.cpp')
-rw-r--r--src/dolphinmainwindow.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 8c76fe780..7f36e82db 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -455,10 +455,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()
@@ -807,10 +803,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,
@@ -1028,6 +1023,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")));