java implementation and downloading
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#include "javalocator.h"
|
||||
|
||||
#include "javaruntime.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QDirIterator>
|
||||
#include <QFileInfo>
|
||||
@@ -72,6 +74,14 @@ QStringList JavaLocator::findAll(const QString &gameDir)
|
||||
{
|
||||
QStringList result;
|
||||
|
||||
// 0. Сборки, скачанные самим лаунчером. Идут первыми: пользователь выбирал
|
||||
// их осознанно, в отличие от того, что нашлось в системе.
|
||||
const QList<InstalledJavaRuntime> managed = JavaRuntimeStore::installed();
|
||||
for (const InstalledJavaRuntime &entry : managed) {
|
||||
if (!result.contains(entry.javaPath))
|
||||
result << entry.javaPath;
|
||||
}
|
||||
|
||||
// 1. Рантайм, скачанный самим Minecraft: .minecraft/runtime/<component>/<os>/<component>/bin
|
||||
const QString runtime = gameDir + QStringLiteral("/runtime");
|
||||
if (QDir(runtime).exists()) {
|
||||
|
||||
Reference in New Issue
Block a user