summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-01-02 00:35:54 +0100
committerPetr Mrázek <peterix@gmail.com>2016-01-02 00:35:54 +0100
commita008efd24e81441a23ff3e81320ac3522251327e (patch)
treef73886925814cc4cfb397be9f8342f7963d8f8d7 /application
parent5f57df81109d268c79b34aac799fc7694ec5882a (diff)
downloadMultiMC-a008efd24e81441a23ff3e81320ac3522251327e.tar
MultiMC-a008efd24e81441a23ff3e81320ac3522251327e.tar.gz
MultiMC-a008efd24e81441a23ff3e81320ac3522251327e.tar.lz
MultiMC-a008efd24e81441a23ff3e81320ac3522251327e.tar.xz
MultiMC-a008efd24e81441a23ff3e81320ac3522251327e.zip
GH-1365 rework java version parsing and sorting
Diffstat (limited to 'application')
-rw-r--r--application/JavaCommon.cpp4
-rw-r--r--application/MainWindow.cpp6
-rw-r--r--application/MultiMC.cpp4
-rw-r--r--application/MultiMC.h6
-rw-r--r--application/pages/InstanceSettingsPage.cpp6
-rw-r--r--application/pages/global/JavaPage.cpp6
6 files changed, 16 insertions, 16 deletions
diff --git a/application/JavaCommon.cpp b/application/JavaCommon.cpp
index 2bec046a..403883e7 100644
--- a/application/JavaCommon.cpp
+++ b/application/JavaCommon.cpp
@@ -26,7 +26,7 @@ void JavaCommon::TestCheck::javaWasOk(JavaCheckResult result)
{
QString text;
text += tr("Java test succeeded!<br />Platform reported: %1<br />Java version "
- "reported: %2<br />").arg(result.realPlatform, result.javaVersion);
+ "reported: %2<br />").arg(result.realPlatform, result.javaVersion.toString());
if (result.errorLog.size())
{
auto htmlError = result.errorLog;
@@ -87,7 +87,7 @@ void JavaCommon::TestCheck::checkFinished(JavaCheckResult result)
checker->m_args = m_args;
checker->m_minMem = m_minMem;
checker->m_maxMem = m_maxMem;
- if (Strings::naturalCompare(result.javaVersion, "1.8", Qt::CaseInsensitive) < 0)
+ if (result.javaVersion.requiresPermGen())
{
checker->m_permGen = m_permGen;
}
diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp
index 2fab40cb..82d923bb 100644
--- a/application/MainWindow.cpp
+++ b/application/MainWindow.cpp
@@ -55,7 +55,7 @@
#include <auth/flows/RefreshTask.h>
#include <icons/IconList.h>
#include <java/JavaUtils.h>
-#include <java/JavaVersionList.h>
+#include <java/JavaInstallList.h>
#include <launch/LaunchTask.h>
#include <minecraft/MinecraftVersionList.h>
#include <minecraft/LwjglVersionList.h>
@@ -1638,14 +1638,14 @@ void MainWindow::checkSetDefaultJava()
{
qDebug() << "Java path needs resetting, showing Java selection dialog...";
- JavaVersionPtr java;
+ JavaInstallPtr java;
VersionSelectDialog vselect(MMC->javalist().get(), tr("Select a Java version"), this, false);
vselect.setResizeOn(2);
vselect.exec();
if (vselect.selectedVersion())
- java = std::dynamic_pointer_cast<JavaVersion>(vselect.selectedVersion());
+ java = std::dynamic_pointer_cast<JavaInstall>(vselect.selectedVersion());
else
{
CustomMessageBox::selectable(this, tr("Invalid version selected"), tr("You didn't select a valid Java version, so MultiMC will "
diff --git a/application/MultiMC.cpp b/application/MultiMC.cpp
index cd5e145a..a2a14506 100644
--- a/application/MultiMC.cpp
+++ b/application/MultiMC.cpp
@@ -586,11 +586,11 @@ std::shared_ptr<MinecraftVersionList> MultiMC::minecraftlist()
return m_minecraftlist;
}
-std::shared_ptr<JavaVersionList> MultiMC::javalist()
+std::shared_ptr<JavaInstallList> MultiMC::javalist()
{
if (!m_javalist)
{
- m_javalist.reset(new JavaVersionList());
+ m_javalist.reset(new JavaInstallList());
ENV.registerVersionList("com.java", m_javalist);
}
return m_javalist;
diff --git a/application/MultiMC.h b/application/MultiMC.h
index 492544fc..5b19db19 100644
--- a/application/MultiMC.h
+++ b/application/MultiMC.h
@@ -20,7 +20,7 @@ class IconList;
class QNetworkAccessManager;
class ForgeVersionList;
class LiteLoaderVersionList;
-class JavaVersionList;
+class JavaInstallList;
class UpdateChecker;
class BaseProfilerFactory;
class BaseDetachedToolFactory;
@@ -79,7 +79,7 @@ public:
std::shared_ptr<LWJGLVersionList> lwjgllist();
std::shared_ptr<ForgeVersionList> forgelist();
std::shared_ptr<LiteLoaderVersionList> liteloaderlist();
- std::shared_ptr<JavaVersionList> javalist();
+ std::shared_ptr<JavaInstallList> javalist();
// APPLICATION ONLY
std::shared_ptr<InstanceList> instances()
@@ -160,7 +160,7 @@ private:
std::shared_ptr<ForgeVersionList> m_forgelist;
std::shared_ptr<LiteLoaderVersionList> m_liteloaderlist;
std::shared_ptr<MinecraftVersionList> m_minecraftlist;
- std::shared_ptr<JavaVersionList> m_javalist;
+ std::shared_ptr<JavaInstallList> m_javalist;
std::shared_ptr<TranslationDownloader> m_translationChecker;
std::shared_ptr<GenericPageProvider> m_globalSettingsProvider;
diff --git a/application/pages/InstanceSettingsPage.cpp b/application/pages/InstanceSettingsPage.cpp
index a23d7c22..2922e469 100644
--- a/application/pages/InstanceSettingsPage.cpp
+++ b/application/pages/InstanceSettingsPage.cpp
@@ -9,7 +9,7 @@
#include "JavaCommon.h"
#include "MultiMC.h"
-#include <java/JavaVersionList.h>
+#include <java/JavaInstallList.h>
#include <FileSystem.h>
InstanceSettingsPage::InstanceSettingsPage(BaseInstance *inst, QWidget *parent)
@@ -170,7 +170,7 @@ void InstanceSettingsPage::loadSettings()
void InstanceSettingsPage::on_javaDetectBtn_clicked()
{
- JavaVersionPtr java;
+ JavaInstallPtr java;
VersionSelectDialog vselect(MMC->javalist().get(), tr("Select a Java version"), this, true);
vselect.setResizeOn(2);
@@ -178,7 +178,7 @@ void InstanceSettingsPage::on_javaDetectBtn_clicked()
if (vselect.result() == QDialog::Accepted && vselect.selectedVersion())
{
- java = std::dynamic_pointer_cast<JavaVersion>(vselect.selectedVersion());
+ java = std::dynamic_pointer_cast<JavaInstall>(vselect.selectedVersion());
ui->javaPathTextBox->setText(java->path);
}
}
diff --git a/application/pages/global/JavaPage.cpp b/application/pages/global/JavaPage.cpp
index 1c33a9ff..82103e23 100644
--- a/application/pages/global/JavaPage.cpp
+++ b/application/pages/global/JavaPage.cpp
@@ -25,7 +25,7 @@
#include <ColumnResizer.h>
#include "java/JavaUtils.h"
-#include "java/JavaVersionList.h"
+#include "java/JavaInstallList.h"
#include "settings/SettingsObject.h"
#include <FileSystem.h>
@@ -93,14 +93,14 @@ void JavaPage::loadSettings()
void JavaPage::on_javaDetectBtn_clicked()
{
- JavaVersionPtr java;
+ JavaInstallPtr java;
VersionSelectDialog vselect(MMC->javalist().get(), tr("Select a Java version"), this, true);
vselect.exec();
if (vselect.result() == QDialog::Accepted && vselect.selectedVersion())
{
- java = std::dynamic_pointer_cast<JavaVersion>(vselect.selectedVersion());
+ java = std::dynamic_pointer_cast<JavaInstall>(vselect.selectedVersion());
ui->javaPathTextBox->setText(java->path);
}
}