Bug 332463 - The "Create Folder" and "Create New" toolbar buttons are enabled in the Trash, but do not work
Summary: The "Create Folder" and "Create New" toolbar buttons are enabled in the Trash...
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 4.12.3
Platform: Mint (Ubuntu based) Linux
: NOR minor
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL: http://youtu.be/N7-fZJaJUv8
Keywords: usability
: 332464 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-03-22 23:40 UTC by Brock McNuggets
Modified: 2018-05-07 20:56 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 18.08.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brock McNuggets 2014-03-22 23:40:13 UTC
Trash should not have a "Create Folder" button - it does not work (and the system knows to have the menu item grayed out).


Reproducible: Always

Steps to Reproduce:
See video
Comment 1 Christoph Feck 2014-03-24 22:40:09 UTC
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.
Comment 2 Frank Reininghaus 2014-03-24 23:28:52 UTC
(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.
Comment 3 Brock McNuggets 2014-03-24 23:34:09 UTC
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
Comment 4 Christoph Feck 2014-03-25 00:02:44 UTC
Frank, KNewFileMenu uses KProtocolManager::supportsMakeDir() to check if "Folder" action is to be disabled.
Comment 5 Christoph Feck 2014-03-25 00:04:55 UTC
Oh, and looking at KProtocolManager API, it also has canRename() methods, and several others...
Comment 6 Elvis Angelaccio 2017-01-02 13:55:14 UTC
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
KFileItemListProperties::supportsWriting().
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.
REVIEW: 129712

M  +3    -1    src/views/dolphinviewactionhandler.cpp

https://commits.kde.org/dolphin/24ed38d77f4bc6db71ba2608452fa0cd401bddac
Comment 7 Elvis Angelaccio 2018-05-07 20:21:08 UTC
*** Bug 332464 has been marked as a duplicate of this bug. ***
Comment 8 Nate Graham 2018-05-07 20:56:38 UTC
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

Summary:
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.
FIXED-IN: 18.08.0

Test Plan:
- 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:
{F5837042}

In the trash:
{F5837043}

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

https://commits.kde.org/dolphin/e133c4557ecc37ed3f7e1b9418306aa8cc516865