diff options
| author | Michael Heidelbach <[email protected]> | 2018-01-14 10:53:11 -0700 |
|---|---|---|
| committer | Nathaniel Graham <[email protected]> | 2018-01-14 10:54:46 -0700 |
| commit | 3cb3d58fbf0a5d3736579ad7a52a2a46ab9c1d29 (patch) | |
| tree | 4864823d98692d524390b8839b5e93f0391e1072 /src/panels/folders/treeviewcontextmenu.cpp | |
| parent | 65c0997164bd6f770c4286f7be83bcd2d3d145bd (diff) | |
folderspanel context-menu option "Limit to Home Directory" should be always visible
Summary:
Only by chance I discovered that this option is visible but only when inside home. Before that I always edited dolphinrc to reenable it.
I think it's less confusing to always show it but toggle its enabled state
Test Plan:
compile and run
show folderspanel context-menu in different places
Reviewers: #dolphin, emmanuelp, ngraham
Reviewed By: #dolphin, ngraham
Subscribers: elvisangelaccio
Tags: #dolphin, #kde_applications
Differential Revision: https://phabricator.kde.org/D9662
Diffstat (limited to 'src/panels/folders/treeviewcontextmenu.cpp')
| -rw-r--r-- | src/panels/folders/treeviewcontextmenu.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/panels/folders/treeviewcontextmenu.cpp b/src/panels/folders/treeviewcontextmenu.cpp index 6381a88ff..132637f15 100644 --- a/src/panels/folders/treeviewcontextmenu.cpp +++ b/src/panels/folders/treeviewcontextmenu.cpp @@ -127,14 +127,13 @@ void TreeViewContextMenu::open() // insert 'Limit to Home Directory' const QUrl url = m_fileItem.url(); - const bool showLimitToHomeDirectory = url.isLocalFile() && (Dolphin::homeUrl().isParentOf(url) || (Dolphin::homeUrl() == url)); - if (showLimitToHomeDirectory) { - QAction* limitFoldersPanelToHomeAction = new QAction(i18nc("@action:inmenu", "Limit to Home Directory"), this); - limitFoldersPanelToHomeAction->setCheckable(true); - limitFoldersPanelToHomeAction->setChecked(m_parent->limitFoldersPanelToHome()); - popup->addAction(limitFoldersPanelToHomeAction); - connect(limitFoldersPanelToHomeAction, &QAction::toggled, this, &TreeViewContextMenu::setLimitFoldersPanelToHome); - } + const bool enableLimitToHomeDirectory = url.isLocalFile(); + QAction* limitFoldersPanelToHomeAction = new QAction(i18nc("@action:inmenu", "Limit to Home Directory"), this); + limitFoldersPanelToHomeAction->setCheckable(true); + limitFoldersPanelToHomeAction->setEnabled(enableLimitToHomeDirectory); + limitFoldersPanelToHomeAction->setChecked(m_parent->limitFoldersPanelToHome()); + popup->addAction(limitFoldersPanelToHomeAction); + connect(limitFoldersPanelToHomeAction, &QAction::toggled, this, &TreeViewContextMenu::setLimitFoldersPanelToHome); // insert 'Automatic Scrolling' QAction* autoScrollingAction = new QAction(i18nc("@action:inmenu", "Automatic Scrolling"), this); |
