summaryrefslogtreecommitdiff
path: root/src/modinfodialogtextfiles.cpp
diff options
context:
space:
mode:
authorAl <26797547+Al12rs@users.noreply.github.com>2020-02-05 16:28:01 +0100
committerGitHub <noreply@github.com>2020-02-05 16:28:01 +0100
commit6ab940892f625e51b8edc643549f5cb35f1cf245 (patch)
tree907588575d4cc3398fd858b8955424ab848e343b /src/modinfodialogtextfiles.cpp
parente9da5b4fad488a5e1ff61d68cc6a24b68f0d4440 (diff)
parentebd71dd053719b4a4714e058ee1108d805a3114f (diff)
Merge pull request #989 from Al12rs/more_text_types
Add support for other text file types to Text Files modinfo tab
Diffstat (limited to 'src/modinfodialogtextfiles.cpp')
-rw-r--r--src/modinfodialogtextfiles.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/modinfodialogtextfiles.cpp b/src/modinfodialogtextfiles.cpp
index fdf12568..28d872a3 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)) {
@@ -237,7 +236,7 @@ IniFilesTab::IniFilesTab(ModInfoDialogTabContext cx)
bool IniFilesTab::wantsFile(const QString& rootPath, const QString& fullPath) const
{
- static const QString extensions[] = {".ini", ".cfg"};
+ static const QString extensions[] = {".ini"};
static const QString meta("meta.ini");
for (const auto& e : extensions) {