From d3b647ab2b19626b2f86b5c2af3946c1fcf22068 Mon Sep 17 00:00:00 2001 From: Twinki Date: Sat, 15 Jun 2024 12:51:47 -0400 Subject: Use new Skip File & Skip Directory in usvfs (#2033) * Use new Skip File & Skip Directory in usvfs. # Motivations https://github.com/ModOrganizer2/usvfs/pull/61 Highlights some reasons why the ability to skip files & directories would be beneficial # Modifications - Add two new settings, `skip_file_suffixes` and `skip_directories` - Wire the two new settings up to usvfs - Add two new buttons to the `Workarounds` dialog, one to adjust Skip File Suffixes and another for Skip Directories, both buttons act nearly identical to the Executable Blacklist button - Add a new grouping in the `Workarounds` dialog box that contains the usvfs buttons to keep the dialog a tad organized --- src/settings.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/settings.cpp') diff --git a/src/settings.cpp b/src/settings.cpp index 04a09467..8b95a1d0 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -316,6 +316,34 @@ void Settings::setExecutablesBlacklist(const QString& s) set(m_Settings, "Settings", "executable_blacklist", s); } +QStringList Settings::skipFileSuffixes() const +{ + static const QStringList def = QStringList() << ".mohidden"; + + auto setting = get(m_Settings, "Settings", "skip_file_suffixes", def); + + return setting; +} + +void Settings::setSkipFileSuffixes(const QStringList& s) +{ + set(m_Settings, "Settings", "skip_file_suffixes", s); +} + +QStringList Settings::skipDirectories() const +{ + static const QStringList def = QStringList() << ".git"; + + auto setting = get(m_Settings, "Settings", "skip_directories", def); + + return setting; +} + +void Settings::setSkipDirectories(const QStringList& s) +{ + set(m_Settings, "Settings", "skip_directories", s); +} + void Settings::setMotdHash(uint hash) { set(m_Settings, "General", "motd_hash", hash); -- cgit v1.3.1