summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAL <26797547+Al12rs@users.noreply.github.com>2020-02-04 02:43:29 +0100
committerAL <26797547+Al12rs@users.noreply.github.com>2020-02-04 02:43:29 +0100
commitd6d613f071aeb9ff548873a38163c695e416c065 (patch)
tree6ee863ddf0223cbd6c21105e940f76cab05bf94c /src
parente9da5b4fad488a5e1ff61d68cc6a24b68f0d4440 (diff)
Add support for other text file types to Text Files modinfo tab
Diffstat (limited to 'src')
-rw-r--r--src/modinfodialogtextfiles.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/modinfodialogtextfiles.cpp b/src/modinfodialogtextfiles.cpp
index fdf12568..884a7d8b 100644
--- a/src/modinfodialogtextfiles.cpp
+++ b/src/modinfodialogtextfiles.cpp
@@ -154,15 +154,9 @@ bool GenericFilesTab::canClose()
bool GenericFilesTab::feedFile(const QString& rootPath, const QString& fullPath)
{
- static constexpr const char* extensions[] = {
- ".txt"
- };
-
- for (const auto* e : extensions) {
- if (wantsFile(rootPath, fullPath)) {
- m_model->add(rootPath, fullPath);
- return true;
- }
+ if (wantsFile(rootPath, fullPath)) {
+ m_model->add(rootPath, fullPath);
+ return true;
}
return false;
@@ -217,7 +211,12 @@ TextFilesTab::TextFilesTab(ModInfoDialogTabContext cx)
bool TextFilesTab::wantsFile(const QString& rootPath, const QString& fullPath) const
{
- static const QString extensions[] = {".txt"};
+ static const QString extensions[] = {
+ ".txt",
+ ".json",
+ ".cfg",
+ ".log"
+ };
for (const auto& e : extensions) {
if (fullPath.endsWith(e, Qt::CaseInsensitive)) {