mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-04-29 22:24:26 +02:00
Fix log sorting
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
parent
111cdc240e
commit
20626e6606
@ -1057,7 +1057,7 @@ MessageLevel::Enum MinecraftInstance::guessLevel(const QString& line, MessageLev
|
|||||||
|
|
||||||
QStringList MinecraftInstance::getLogFileSearchPaths()
|
QStringList MinecraftInstance::getLogFileSearchPaths()
|
||||||
{
|
{
|
||||||
return { FS::PathCombine(gameRoot(), "logs"), FS::PathCombine(gameRoot(), "crash-reports"), gameRoot() };
|
return { FS::PathCombine(gameRoot(), "crash-reports"), FS::PathCombine(gameRoot(), "logs"), gameRoot() };
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MinecraftInstance::getStatusbarDescription()
|
QString MinecraftInstance::getStatusbarDescription()
|
||||||
|
@ -146,6 +146,7 @@ void OtherLogsPage::populateSelectLogBox()
|
|||||||
ui->selectLogBox->setCurrentIndex(index);
|
ui->selectLogBox->setCurrentIndex(index);
|
||||||
ui->selectLogBox->blockSignals(false);
|
ui->selectLogBox->blockSignals(false);
|
||||||
setControlsEnabled(true);
|
setControlsEnabled(true);
|
||||||
|
// don't refresh file
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
setControlsEnabled(false);
|
setControlsEnabled(false);
|
||||||
@ -405,20 +406,17 @@ QStringList OtherLogsPage::getPaths()
|
|||||||
QStringList result;
|
QStringList result;
|
||||||
|
|
||||||
for (QString searchPath : m_logSearchPaths) {
|
for (QString searchPath : m_logSearchPaths) {
|
||||||
QDirIterator iterator(searchPath, QDir::Files | QDir::Readable);
|
QDir searchDir(searchPath);
|
||||||
|
|
||||||
const bool isRoot = searchPath == m_basePath;
|
QStringList filters{ "*.log", "*.log.gz" };
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
if (searchPath != m_basePath)
|
||||||
const QString name = iterator.next();
|
filters.append("*.txt");
|
||||||
|
|
||||||
QString relativePath = baseDir.relativeFilePath(name);
|
QStringList entries = searchDir.entryList(filters, QDir::Files | QDir::Readable, QDir::SortFlag::Time);
|
||||||
|
|
||||||
if (!(name.endsWith(".log") || name.endsWith(".log.gz") || (!isRoot && name.endsWith(".txt"))))
|
for (const QString& name : entries)
|
||||||
continue;
|
result.append(baseDir.relativeFilePath(searchDir.filePath(name)));
|
||||||
|
|
||||||
result.append(relativePath);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user