diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-06-25 11:41:00 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-07-02 10:10:18 -0400 |
| commit | 139c33ccc4f529083b0288907caad2946a3f5a8f (patch) | |
| tree | ac4d1ed9311cdfe1e59b6e825cba228a431bf649 /src/modinfodialogtextfiles.cpp | |
| parent | 86e4f65eb6a2e52d0513a8c2fe1e94cd1af9967d (diff) | |
various optimizations and caching
fixed conflict list not sorting when changing parameters
switched from QDirIterator to std::filesystem, much faster
FilterWidget precompiles the list
Diffstat (limited to 'src/modinfodialogtextfiles.cpp')
| -rw-r--r-- | src/modinfodialogtextfiles.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/modinfodialogtextfiles.cpp b/src/modinfodialogtextfiles.cpp index 25d799b1..675a4c79 100644 --- a/src/modinfodialogtextfiles.cpp +++ b/src/modinfodialogtextfiles.cpp @@ -202,11 +202,9 @@ TextFilesTab::TextFilesTab( bool TextFilesTab::wantsFile(const QString& rootPath, const QString& fullPath) const { - static constexpr const char* extensions[] = { - ".txt" - }; + static const QString extensions[] = {".txt"}; - for (const auto* e : extensions) { + for (const auto& e : extensions) { if (fullPath.endsWith(e, Qt::CaseInsensitive)) { return true; } @@ -226,13 +224,12 @@ IniFilesTab::IniFilesTab( bool IniFilesTab::wantsFile(const QString& rootPath, const QString& fullPath) const { - static constexpr const char* extensions[] = { - ".ini", ".cfg" - }; + static const QString extensions[] = {".ini", ".cfg"}; + static const QString meta("meta.ini"); - for (const auto* e : extensions) { + for (const auto& e : extensions) { if (fullPath.endsWith(e, Qt::CaseInsensitive)) { - if (!fullPath.endsWith("meta.ini")) { + if (!fullPath.endsWith(meta)) { return true; } } |
