From 3cb3d58fbf0a5d3736579ad7a52a2a46ab9c1d29 Mon Sep 17 00:00:00 2001 From: Michael Heidelbach Date: Sun, 14 Jan 2018 10:53:11 -0700 Subject: 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 --- src/panels/folders/treeviewcontextmenu.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/panels/folders/treeviewcontextmenu.cpp') 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); -- cgit v1.3