Disable all the 'create new' items when in the Trash
ClosedPublic

Authored by ngraham on May 6 2018, 8:11 PM.

Details

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.

BUG: 332463
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:

In the trash:

Diff Detail

Repository
R318 Dolphin
Branch
disable-create-new-menu-in-trash (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
ngraham requested review of this revision.May 6 2018, 8:11 PM
ngraham created this revision.
ngraham edited the summary of this revision. (Show Details)May 6 2018, 8:12 PM
ngraham edited the test plan for this revision. (Show Details)
elvisangelaccio requested changes to this revision.May 6 2018, 9:00 PM
elvisangelaccio added a subscriber: elvisangelaccio.

Please mention T8234 in the commit message, so we'll remember this won't be needed anymore once we have support from KIO.

src/dolphinmainwindow.cpp
463

This will detach the actions() container. Please use

const auto actions = m_newFileMenu->menu()->actions();
for (auto menuItem : actions) { ... }
This revision now requires changes to proceed.May 6 2018, 9:00 PM
ngraham edited the summary of this revision. (Show Details)May 6 2018, 10:20 PM
ngraham updated this revision to Diff 33733.May 6 2018, 10:24 PM

Address review comments

ngraham marked an inline comment as done.May 6 2018, 10:24 PM
markg accepted this revision.May 7 2018, 10:53 AM
markg added a subscriber: markg.

Hahaha, that screenshot made me laugh (new actions in the trash, i never noticed that but it's a nice bug).
Ship it!

Thanks! Will wait for @elvisangelaccio's approval first. :)

elvisangelaccio requested changes to this revision.May 7 2018, 8:07 PM

I didn't notice this at first, but there is an additional problem: now we are disabling the newFileMenu in two different places and in two different ways (see DolphinMainWindow::slotWriteStateChanged()).

We should at least disable it consistenly: either always disable the menu, or always disable all its menu items.

This revision now requires changes to proceed.May 7 2018, 8:07 PM
elvisangelaccio edited the summary of this revision. (Show Details)May 7 2018, 8:21 PM
ngraham updated this revision to Diff 33794.May 7 2018, 8:50 PM

Always disable the submenu's items, rather than the submenu itself

ngraham updated this revision to Diff 33795.May 7 2018, 8:51 PM

Remove debug statement I forgot to remove before updating the diff

elvisangelaccio accepted this revision.May 7 2018, 8:55 PM
This revision is now accepted and ready to land.May 7 2018, 8:55 PM
ngraham closed this revision.May 7 2018, 8:56 PM