Trash should not have a "Create Folder" button - it does not work (and the system knows to have the menu item grayed out).
Steps to Reproduce:
The "Create New > Folder" action is indeed disabled, so the KIO system knows in advance that creating folders in trash:/ fails. Not sure if this is exported to the application.
(In reply to comment #1)
> The "Create New > Folder" action is indeed disabled, so the KIO system knows
> in advance that creating folders in trash:/ fails. Not sure if this is
> exported to the application.
To my knowledge, it's not. KFileItemListProperties has four methods
bool supportsDeleting () const
bool supportsMoving () const
bool supportsReading () const
bool supportsWriting () const
all of which return "true" for "trash:/". We enable the "Create Folder" and the "Create New..." toolbar buttons based on supportsWriting(), and the "Rename" action (see bug 332465) based on supportsMoving().
So it seems that either new methods supportsCreatingSubfolders() and supportsRenaming() have to be created, or we have to blacklist all URLs that use the "trash:" protocol for these actions.
It it helps, so you do not have to watch the whole video, this is where I show the error: http://youtu.be/N7-fZJaJUv8?t=6m35s
Frank, KNewFileMenu uses KProtocolManager::supportsMakeDir() to check if "Folder" action is to be disabled.
Oh, and looking at KProtocolManager API, it also has canRename() methods, and several others...
Git commit 24ed38d77f4bc6db71ba2608452fa0cd401bddac by Elvis Angelaccio.
Committed on 02/01/2017 at 13:54.
Pushed by elvisangelaccio into branch 'Applications/16.12'.
Properly disable create_dir action in Trash
`isFolderWritable` is set in DolphinView::updateWritableState() according to
However, `writing=true` does not imply `makedir=true`,
in an ioslave's .protocol file. An example is the trash protocol.
So we need to enable the `create_dir` action only if the protocol is
actually able to create folders.
M +3 -1 src/views/dolphinviewactionhandler.cpp
*** Bug 332464 has been marked as a duplicate of this bug. ***
Git commit e133c4557ecc37ed3f7e1b9418306aa8cc516865 by Nathaniel Graham.
Committed on 07/05/2018 at 20:55.
Pushed by ngraham into branch 'master'.
Disable all the 'create new' items when in the Trash
Disable all the items in the 'create new' menu when the active view is in the trash,
because they're not useful and don't even work. We don't disable the entire menu
because it's useful to be able to see what specific things are disabled.
This can be reverted once T8234 is implemented.
- Enter the trash with and without a split view; the 'create new' menu items are all disabled
- Be looking at something other than the trash with and without a split view; the 'create new' menu items are all enabled
- Toggle between split views (one in the trash, one elsewhere); menu is correct for both cases
Out of the trash:
In the trash:
Reviewers: #dolphin, broulik, elvisangelaccio, markg
Reviewed By: #dolphin, elvisangelaccio, markg
Subscribers: markg, elvisangelaccio
Differential Revision: https://phabricator.kde.org/D12731
M +8 -1 src/dolphinmainwindow.cpp