aboutsummaryrefslogtreecommitdiff
path: root/launcher/java
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/java')
-rw-r--r--launcher/java/JavaInstallList.cpp4
-rw-r--r--launcher/java/JavaUtils.cpp15
2 files changed, 4 insertions, 15 deletions
diff --git a/launcher/java/JavaInstallList.cpp b/launcher/java/JavaInstallList.cpp
index e2f0aa00..b29af857 100644
--- a/launcher/java/JavaInstallList.cpp
+++ b/launcher/java/JavaInstallList.cpp
@@ -67,7 +67,7 @@ void JavaInstallList::load()
if(m_status != Status::InProgress)
{
m_status = Status::InProgress;
- m_loadTask = new JavaListLoadTask(this);
+ m_loadTask.reset(new JavaListLoadTask(this));
m_loadTask->start();
}
}
@@ -167,7 +167,7 @@ void JavaListLoadTask::executeTask()
JavaUtils ju;
QList<QString> candidate_paths = ju.FindJavaPaths();
- m_job = new JavaCheckerJob("Java detection");
+ m_job.reset(new JavaCheckerJob("Java detection"));
connect(m_job.get(), &Task::finished, this, &JavaListLoadTask::javaCheckerFinished);
connect(m_job.get(), &Task::progress, this, &Task::setProgress);
diff --git a/launcher/java/JavaUtils.cpp b/launcher/java/JavaUtils.cpp
index 5efbc7a8..e55663aa 100644
--- a/launcher/java/JavaUtils.cpp
+++ b/launcher/java/JavaUtils.cpp
@@ -412,8 +412,6 @@ QList<QString> JavaUtils::FindJavaPaths()
#elif defined(Q_OS_LINUX)
QList<QString> JavaUtils::FindJavaPaths()
{
- qDebug() << "Linux Java detection incomplete - defaulting to \"java\"";
-
QList<QString> javas;
javas.append(this->GetDefaultJava()->path);
auto scanJavaDir = [&](const QString & dirPath)
@@ -421,20 +419,11 @@ QList<QString> JavaUtils::FindJavaPaths()
QDir dir(dirPath);
if(!dir.exists())
return;
- auto entries = dir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks);
+ auto entries = dir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
for(auto & entry: entries)
{
-
QString prefix;
- if(entry.isAbsolute())
- {
- prefix = entry.absoluteFilePath();
- }
- else
- {
- prefix = entry.filePath();
- }
-
+ prefix = entry.canonicalFilePath();
javas.append(FS::PathCombine(prefix, "jre/bin/java"));
javas.append(FS::PathCombine(prefix, "bin/java"));
}