Commit 897ce848 authored by Nate Graham's avatar Nate Graham 🔩
Browse files

Use more conventional "Add to Places" text for that action

Summary:
I originally implemented this to show "Add <current folder> to Places" to make the menu
item more clear when invoked from the file menu or the viewport context menu because I
thought it wasn't totally clear that the action would be referring to the folder for the
visible view.

However I think in retrospect that this was a mistake. No other items in the file menu
or the viewport context menu name the current folder like this, so clearly there wasn't
a problem. And then the item's text doesn't match the text for other items.

Thie patch removes that behavior and makes the name match the style of all the other menu
item text.

BUG: 416064
FIXED-IN: 20.04.0

Reviewers: #dolphin, #vdg, meven

Reviewed By: #dolphin, meven

Subscribers: elvisangelaccio, meven, kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D26590
parent 2fd2f621
......@@ -1317,6 +1317,7 @@ void DolphinMainWindow::setupActions()
QAction* addToPlaces = actionCollection()->addAction(QStringLiteral("add_to_places"));
addToPlaces->setIcon(QIcon::fromTheme(QStringLiteral("bookmark-new")));
addToPlaces->setText(i18nc("@action:inmenu Add current folder to places", "Add to Places"));
addToPlaces->setWhatsThis(xi18nc("@info:whatsthis", "This adds the selected folder "
"to the Places panel."));
connect(addToPlaces, &QAction::triggered, this, &DolphinMainWindow::addToPlaces);
......@@ -1895,7 +1896,6 @@ void DolphinMainWindow::updateFileAndEditActions()
stateChanged(QStringLiteral("has_no_selection"));
addToPlacesAction->setEnabled(true);
addToPlacesAction->setText(i18nc("@action:inmenu Add current folder to places", "Add '%1' to Places", m_activeViewContainer->placesText()));
} else {
stateChanged(QStringLiteral("has_selection"));
......@@ -1908,10 +1908,8 @@ void DolphinMainWindow::updateFileAndEditActions()
if (list.length() == 1 && list.first().isDir()) {
addToPlacesAction->setEnabled(true);
addToPlacesAction->setText(i18nc("@action:inmenu Add current folder to places", "Add '%1' to Places", list.first().name()));
} else {
addToPlacesAction->setEnabled(false);
addToPlacesAction->setText(i18nc("@action:inmenu Add current folder to places", "Add to Places"));
}
KFileItemListProperties capabilities(list);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment