From 897ce8480c9c281f0501d201e33b6b0e8e7dd9a6 Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Sat, 11 Jan 2020 12:52:46 -0700 Subject: [PATCH] Use more conventional "Add to Places" text for that action Summary: I originally implemented this to show "Add 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 --- src/dolphinmainwindow.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 2f11d7aabc..642c24e60d 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -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);