]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinviewactionhandler.cpp
If include is define in .h remove it if it's defined in .cpp too (scripted)
[dolphin.git] / src / views / dolphinviewactionhandler.cpp
index fa0d553b69e46fe0455127769a91e54516b31b6a..eb22baa00d99c3cc0bd4664b0b4c5299f3d49db5 100644 (file)
@@ -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>"
@@ -521,7 +521,7 @@ void DolphinViewActionHandler::slotVisibleRolesChanged(const QList<QByteArray>&
 {
     Q_UNUSED(previous)
 
-    const QSet<QByteArray> checkedRoles = current.toSet();
+    const auto checkedRoles = QSet<QByteArray>(current.constBegin(), current.constEnd());
     QHashIterator<QByteArray, KToggleAction*> it(m_visibleRoles);
     while (it.hasNext()) {
         it.next();
@@ -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)