diff --git a/src/gui/kstandardshortcut.h b/src/gui/kstandardshortcut.h --- a/src/gui/kstandardshortcut.h +++ b/src/gui/kstandardshortcut.h @@ -141,6 +141,7 @@ RenameFile, ///< Rename files or folders. @since 5.25 MoveToTrash, ///< Move files or folders to the trash. @since 5.25 Donate, ///< Open donation page on kde.org. @since 5.26 + ShowHideHiddenFiles, ///< Toggle showing or hiding hidden files @since 5.70 // Insert new items here! StandardShortcutCount // number of standard shortcuts @@ -526,6 +527,14 @@ * @since 5.64 */ KCONFIGGUI_EXPORT const QList &preferences(); + +/** + * Shows or hides hidden files. Defaults: Ctrl+H, Alt+. + * @return the shortcut of the standard accelerator + * @since 5.70 + */ +KCONFIGGUI_EXPORT const QList &showHideHiddenFiles(); + } #endif // KSTANDARDSHORTCUT_H diff --git a/src/gui/kstandardshortcut.cpp b/src/gui/kstandardshortcut.cpp --- a/src/gui/kstandardshortcut.cpp +++ b/src/gui/kstandardshortcut.cpp @@ -166,6 +166,7 @@ { RenameFile, "RenameFile", QT_TRANSLATE_NOOP3("KStandardShortcut", "Rename", "@action"), Qt::Key_F2, 0, QList(), false }, { MoveToTrash, "MoveToTrash", QT_TRANSLATE_NOOP3("KStandardShortcut", "Move to Trash", "@action"), Qt::Key_Delete, 0, QList(), false }, { Donate, "Donate", QT_TRANSLATE_NOOP3("KStandardShortcut", "Donate", "@action"), 0, 0, QList(), false }, + { ShowHideHiddenFiles, "ShowHideHiddenFiles", QT_TRANSLATE_NOOP3("KStandardShortcut", "Show/Hide Hidden Files", "@action"), CTRL(H), ALT(Period), QList(), false }, //dummy entry to catch simple off-by-one errors. Insert new entries before this line. { AccelNone, nullptr, {nullptr, nullptr}, 0, 0, QList(), false } @@ -557,4 +558,9 @@ return shortcut(Preferences); } +const QList &showHideHiddenFiles() +{ + return shortcut(ShowHideHiddenFiles); +} + }