diff options
| author | Twinki <Twinki14@users.noreply.github.com> | 2024-06-15 12:51:47 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-15 18:51:47 +0200 |
| commit | d3b647ab2b19626b2f86b5c2af3946c1fcf22068 (patch) | |
| tree | 3dac9ed85783bdf1bb682cd4a436cfa9197ba382 /src/settings.cpp | |
| parent | 6d08d434a8a5a4471a620974a52550ada05ab663 (diff) | |
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
Diffstat (limited to 'src/settings.cpp')
| -rw-r--r-- | src/settings.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
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<QStringList>(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<QStringList>(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); |
