summaryrefslogtreecommitdiffstats
path: root/logic
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-08-19 02:04:56 +0200
committerPetr Mrázek <peterix@gmail.com>2015-08-19 02:04:56 +0200
commit5bc29b06a9268a43fe13a627ac02f34a77c76895 (patch)
treeeef34c5d98f7f588d18a547b0c8aff6408e8e3a5 /logic
parent96fdaebb5c8c8902c98c1fb43e755cf90fc15198 (diff)
downloadMultiMC-5bc29b06a9268a43fe13a627ac02f34a77c76895.tar
MultiMC-5bc29b06a9268a43fe13a627ac02f34a77c76895.tar.gz
MultiMC-5bc29b06a9268a43fe13a627ac02f34a77c76895.tar.lz
MultiMC-5bc29b06a9268a43fe13a627ac02f34a77c76895.tar.xz
MultiMC-5bc29b06a9268a43fe13a627ac02f34a77c76895.zip
NOISSUE fix log-related legacy instance crash and show hidden log files
Diffstat (limited to 'logic')
-rw-r--r--logic/BaseInstance.h5
-rw-r--r--logic/NullInstance.h4
-rw-r--r--logic/RecursiveFileSystemWatcher.cpp4
-rw-r--r--logic/minecraft/MinecraftInstance.cpp7
-rw-r--r--logic/minecraft/MinecraftInstance.h2
5 files changed, 20 insertions, 2 deletions
diff --git a/logic/BaseInstance.h b/logic/BaseInstance.h
index bcd1e0da..070a9838 100644
--- a/logic/BaseInstance.h
+++ b/logic/BaseInstance.h
@@ -170,6 +170,11 @@ public:
virtual IPathMatcher::Ptr getLogFileMatcher() = 0;
/*!
+ * Returns the root folder to use for looking up log files
+ */
+ virtual QString getLogFileRoot() = 0;
+
+ /*!
* does any necessary cleanups after the instance finishes. also runs before\
* TODO: turn into a task that can run asynchronously
*/
diff --git a/logic/NullInstance.h b/logic/NullInstance.h
index 9ddbc2b2..ebfe4f56 100644
--- a/logic/NullInstance.h
+++ b/logic/NullInstance.h
@@ -74,4 +74,8 @@ public:
{
return nullptr;
}
+ virtual QString getLogFileRoot()
+ {
+ return instanceRoot();
+ }
};
diff --git a/logic/RecursiveFileSystemWatcher.cpp b/logic/RecursiveFileSystemWatcher.cpp
index 1253870b..59c3f0f0 100644
--- a/logic/RecursiveFileSystemWatcher.cpp
+++ b/logic/RecursiveFileSystemWatcher.cpp
@@ -86,11 +86,11 @@ QStringList RecursiveFileSystemWatcher::scanRecursive(const QDir &directory)
{
return {};
}
- for (const QString &dir : directory.entryList(QDir::Dirs | QDir::NoDotAndDotDot))
+ for (const QString &dir : directory.entryList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden))
{
ret.append(scanRecursive(directory.absoluteFilePath(dir)));
}
- for (const QString &file : directory.entryList(QDir::Files))
+ for (const QString &file : directory.entryList(QDir::Files | QDir::Hidden))
{
auto relPath = m_root.relativeFilePath(directory.absoluteFilePath(file));
if (m_matcher->matches(relPath))
diff --git a/logic/minecraft/MinecraftInstance.cpp b/logic/minecraft/MinecraftInstance.cpp
index 50962452..c3d73456 100644
--- a/logic/minecraft/MinecraftInstance.cpp
+++ b/logic/minecraft/MinecraftInstance.cpp
@@ -284,7 +284,14 @@ IPathMatcher::Ptr MinecraftInstance::getLogFileMatcher()
auto combined = std::make_shared<MultiMatcher>();
combined->add(std::make_shared<RegexpMatcher>(".*\\.log(\\.[0-9]*)?(\\.gz)?$"));
combined->add(std::make_shared<RegexpMatcher>("crash-.*\\.txt"));
+ combined->add(std::make_shared<RegexpMatcher>("IDMap dump.*\\.txt$"));
+ combined->add(std::make_shared<RegexpMatcher>("ModLoader\\.txt(\\..*)?$"));
return combined;
}
+QString MinecraftInstance::getLogFileRoot()
+{
+ return minecraftRoot();
+}
+
#include "MinecraftInstance.moc"
diff --git a/logic/minecraft/MinecraftInstance.h b/logic/minecraft/MinecraftInstance.h
index a09e44db..39a51b9a 100644
--- a/logic/minecraft/MinecraftInstance.h
+++ b/logic/minecraft/MinecraftInstance.h
@@ -46,6 +46,8 @@ public:
virtual IPathMatcher::Ptr getLogFileMatcher() override;
+ virtual QString getLogFileRoot() override;
+
protected:
QMap<QString, QString> createCensorFilterFromSession(AuthSessionPtr session);
};