mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-06-12 13:17:41 +02:00
Started workin on stuff
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
@ -14,7 +14,9 @@
|
||||
#include "FileSystem.h"
|
||||
#include "JavaCommon.h"
|
||||
#include "JavaDownloader.h"
|
||||
#include "java/JavaChecker.h"
|
||||
#include "java/JavaInstall.h"
|
||||
#include "java/JavaInstallList.h"
|
||||
#include "java/JavaUtils.h"
|
||||
|
||||
#include "ui/dialogs/CustomMessageBox.h"
|
||||
@ -368,30 +370,25 @@ void JavaSettingsWidget::checkJavaPath(const QString& path)
|
||||
return;
|
||||
}
|
||||
setJavaStatus(JavaStatus::Pending);
|
||||
m_checker.reset(new JavaChecker());
|
||||
m_checker->m_path = path;
|
||||
m_checker->m_minMem = minHeapSize();
|
||||
m_checker->m_maxMem = maxHeapSize();
|
||||
if (m_permGenSpinBox->isVisible()) {
|
||||
m_checker->m_permGen = m_permGenSpinBox->value();
|
||||
}
|
||||
m_checker.reset(
|
||||
new JavaChecker(path, "", minHeapSize(), maxHeapSize(), m_permGenSpinBox->isVisible() ? m_permGenSpinBox->value() : 0, 0, this));
|
||||
connect(m_checker.get(), &JavaChecker::checkFinished, this, &JavaSettingsWidget::checkFinished);
|
||||
m_checker->performCheck();
|
||||
m_checker->start();
|
||||
}
|
||||
|
||||
void JavaSettingsWidget::checkFinished(JavaCheckResult result)
|
||||
void JavaSettingsWidget::checkFinished(JavaChecker::Result result)
|
||||
{
|
||||
m_result = result;
|
||||
switch (result.validity) {
|
||||
case JavaCheckResult::Validity::Valid: {
|
||||
case JavaChecker::Result::Validity::Valid: {
|
||||
setJavaStatus(JavaStatus::Good);
|
||||
break;
|
||||
}
|
||||
case JavaCheckResult::Validity::ReturnedInvalidData: {
|
||||
case JavaChecker::Result::Validity::ReturnedInvalidData: {
|
||||
setJavaStatus(JavaStatus::ReturnedInvalidData);
|
||||
break;
|
||||
}
|
||||
case JavaCheckResult::Validity::Errored: {
|
||||
case JavaChecker::Result::Validity::Errored: {
|
||||
setJavaStatus(JavaStatus::DoesNotStart);
|
||||
break;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ class JavaSettingsWidget : public QWidget {
|
||||
void on_javaBrowseBtn_clicked();
|
||||
void on_javaStatusBtn_clicked();
|
||||
void on_javaDownloadBtn_clicked();
|
||||
void checkFinished(JavaCheckResult result);
|
||||
void checkFinished(JavaChecker::Result result);
|
||||
|
||||
protected: /* methods */
|
||||
void checkJavaPathOnEdit(const QString& path);
|
||||
@ -89,5 +89,5 @@ class JavaSettingsWidget : public QWidget {
|
||||
QString queuedCheck;
|
||||
uint64_t m_availableMemory = 0ull;
|
||||
shared_qobject_ptr<JavaChecker> m_checker;
|
||||
JavaCheckResult m_result;
|
||||
JavaChecker::Result m_result;
|
||||
};
|
||||
|
Reference in New Issue
Block a user