+ KToggleAction* showHiddenFiles = m_actionCollection->add<KToggleAction>(QStringLiteral("show_hidden_files"));
+ 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>"
+ "<para>Hidden items only differ from other ones in that their "
+ "name starts with a \".\". In general there is no need for "
+ "users to access them which is why they are hidden.</para>"));
+ m_actionCollection->setDefaultShortcuts(showHiddenFiles, KStandardShortcut::showHideHiddenFiles());
+ connect(showHiddenFiles, &KToggleAction::triggered, this, &DolphinViewActionHandler::toggleShowHiddenFiles);
+
+ QAction* adjustViewProps = m_actionCollection->addAction(QStringLiteral("view_properties"));
+ adjustViewProps->setText(i18nc("@action:inmenu View", "Adjust View Display Style..."));
+ adjustViewProps->setIcon(QIcon::fromTheme(QStringLiteral("view-choose")));
+ adjustViewProps->setWhatsThis(i18nc("@info:whatsthis", "This opens a window "
+ "in which all folder view properties can be adjusted."));
+ connect(adjustViewProps, &QAction::triggered, this, &DolphinViewActionHandler::slotAdjustViewProperties);
+}
+
+QActionGroup* DolphinViewActionHandler::createFileItemRolesActionGroup(const QString& groupPrefix)
+{
+ const bool isSortGroup = (groupPrefix == QLatin1String("sort_by_"));
+ Q_ASSERT(isSortGroup || groupPrefix == QLatin1String("show_"));
+
+ QActionGroup* rolesActionGroup = new QActionGroup(m_actionCollection);
+ rolesActionGroup->setExclusive(isSortGroup);
+ if (isSortGroup) {
+ connect(rolesActionGroup, &QActionGroup::triggered,
+ this, &DolphinViewActionHandler::slotSortTriggered);
+ } else {
+ connect(rolesActionGroup, &QActionGroup::triggered,
+ this, &DolphinViewActionHandler::toggleVisibleRole);
+ }