Shallow search and lazy loading for Other Logs page

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad
2025-04-18 19:52:30 +01:00
parent a39edb3b59
commit d5db974008
7 changed files with 78 additions and 54 deletions

View File

@@ -1055,19 +1055,9 @@ MessageLevel::Enum MinecraftInstance::guessLevel(const QString& line, MessageLev
return level;
}
IPathMatcher::Ptr MinecraftInstance::getLogFileMatcher()
QStringList MinecraftInstance::getLogFileSearchPaths()
{
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 gameRoot();
return { FS::PathCombine(gameRoot(), "logs"), FS::PathCombine(gameRoot(), "crash-reports"), gameRoot() };
}
QString MinecraftInstance::getStatusbarDescription()

View File

@@ -142,9 +142,7 @@ class MinecraftInstance : public BaseInstance {
/// guess log level from a line of minecraft log
MessageLevel::Enum guessLevel(const QString& line, MessageLevel::Enum level) override;
IPathMatcher::Ptr getLogFileMatcher() override;
QString getLogFileRoot() override;
QStringList getLogFileSearchPaths() override;
QString getStatusbarDescription() override;