]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinviewactionhandler.cpp
Make "Show hidden files" action follow HIG
[dolphin.git] / src / views / dolphinviewactionhandler.cpp
index 87a8ada0a331a3b254fb0c0156e282590cd9d9ca..a63263bf5822dcbbebb65e8e0c0b3c07775b7b34 100644 (file)
@@ -143,7 +143,7 @@ void DolphinViewActionHandler::createActions()
     connect(propertiesAction, &QAction::triggered, this, &DolphinViewActionHandler::slotProperties);
 
     QAction *copyPathAction = m_actionCollection->addAction( QStringLiteral("copy_location") );
-    copyPathAction->setText(i18nc("@action:incontextmenu", "Copy location"));
+    copyPathAction->setText(i18nc("@action:incontextmenu", "Copy Location"));
     copyPathAction->setWhatsThis(i18nc("@info:whatsthis copy_location",
                                           "This will copy the path of the first selected item into the clipboard."
                                 ));
@@ -272,8 +272,8 @@ void DolphinViewActionHandler::createActions()
     connect(showInGroups, &KToggleAction::triggered, this, &DolphinViewActionHandler::toggleGroupedSorting);
 
     KToggleAction* showHiddenFiles = m_actionCollection->add<KToggleAction>(QStringLiteral("show_hidden_files"));
+    showHiddenFiles->setIcon(QIcon::fromTheme(QStringLiteral("view-visible")));
     showHiddenFiles->setText(i18nc("@action:inmenu View", "Show Hidden Files"));
-    showHiddenFiles->setToolTip(i18nc("@info", "Visibility of hidden files and folders"));
     showHiddenFiles->setWhatsThis(xi18nc("@info:whatsthis", "<para>When "
         "this is enabled <emphasis>hidden</emphasis> files and folders "
         "are visible. They will be displayed semi-transparent.</para>"
@@ -552,14 +552,6 @@ void DolphinViewActionHandler::slotHiddenFilesShownChanged(bool shown)
 {
     QAction* showHiddenFilesAction = m_actionCollection->action(QStringLiteral("show_hidden_files"));
     showHiddenFilesAction->setChecked(shown);
-
-    // #374508: don't overwrite custom icons.
-    const QString iconName = showHiddenFilesAction->icon().name();
-    if (!iconName.isEmpty() && iconName != QLatin1String("view-visible") && iconName != QLatin1String("view-hidden")) {
-        return;
-    }
-
-    showHiddenFilesAction->setIcon(QIcon::fromTheme(shown ? QStringLiteral("view-visible") : QStringLiteral("view-hidden")));
 }
 
 void DolphinViewActionHandler::slotWriteStateChanged(bool isFolderWritable)
@@ -620,14 +612,14 @@ void DolphinViewActionHandler::slotSortRoleChanged(const QByteArray& role)
         descending->setText(i18nc("Sort descending", "Z-A"));
         ascending->setText(i18nc("Sort ascending", "A-Z"));
     } else if (role == "size") {
-        descending->setText(i18nc("Sort descending", "Largest first"));
-        ascending->setText(i18nc("Sort ascending", "Smallest first"));
+        descending->setText(i18nc("Sort descending", "Largest First"));
+        ascending->setText(i18nc("Sort ascending", "Smallest First"));
     } else if (role == "modificationtime" || role == "creationtime" || role == "accesstime") {
-        descending->setText(i18nc("Sort descending", "Newest first"));
-        ascending->setText(i18nc("Sort ascending", "Oldest first"));
+        descending->setText(i18nc("Sort descending", "Newest First"));
+        ascending->setText(i18nc("Sort ascending", "Oldest First"));
     } else if (role == "rating") {
-        descending->setText(i18nc("Sort descending", "Highest first"));
-        ascending->setText(i18nc("Sort ascending", "Lowest first"));
+        descending->setText(i18nc("Sort descending", "Highest First"));
+        ascending->setText(i18nc("Sort ascending", "Lowest First"));
     } else {
         descending->setText(i18nc("Sort descending", "Descending"));
         ascending->setText(i18nc("Sort ascending", "Ascending"));