From a545f67a211173ae0649e7dda59e1e0fecb2e160 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sat, 29 Jul 2023 11:00:33 +0200 Subject: [PATCH] fix: take JavaCheckResult by const reference Signed-off-by: Sefa Eyeoglu --- launcher/JavaCommon.cpp | 6 +++--- launcher/JavaCommon.h | 6 +++--- launcher/java/JavaVersion.cpp | 2 +- launcher/java/JavaVersion.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/launcher/JavaCommon.cpp b/launcher/JavaCommon.cpp index e29e22709..30a7dbacc 100644 --- a/launcher/JavaCommon.cpp +++ b/launcher/JavaCommon.cpp @@ -68,7 +68,7 @@ bool JavaCommon::checkJVMArgs(QString jvmargs, QWidget *parent) return true; } -void JavaCommon::javaWasOk(QWidget *parent, JavaCheckResult result) +void JavaCommon::javaWasOk(QWidget *parent, const JavaCheckResult &result) { QString text; text += QObject::tr("Java test succeeded!
Platform reported: %1
Java version " @@ -83,7 +83,7 @@ void JavaCommon::javaWasOk(QWidget *parent, JavaCheckResult result) CustomMessageBox::selectable(parent, QObject::tr("Java test success"), text, QMessageBox::Information)->show(); } -void JavaCommon::javaArgsWereBad(QWidget *parent, JavaCheckResult result) +void JavaCommon::javaArgsWereBad(QWidget *parent, const JavaCheckResult &result) { auto htmlError = result.errorLog; QString text; @@ -93,7 +93,7 @@ void JavaCommon::javaArgsWereBad(QWidget *parent, JavaCheckResult result) CustomMessageBox::selectable(parent, QObject::tr("Java test failure"), text, QMessageBox::Warning)->show(); } -void JavaCommon::javaBinaryWasBad(QWidget *parent, JavaCheckResult result) +void JavaCommon::javaBinaryWasBad(QWidget *parent, const JavaCheckResult &result) { QString text; text += QObject::tr( diff --git a/launcher/JavaCommon.h b/launcher/JavaCommon.h index 59cb7a67d..2ba64c0cd 100644 --- a/launcher/JavaCommon.h +++ b/launcher/JavaCommon.h @@ -11,11 +11,11 @@ namespace JavaCommon bool checkJVMArgs(QString args, QWidget *parent); // Show a dialog saying that the Java binary was usable - void javaWasOk(QWidget *parent, JavaCheckResult result); + void javaWasOk(QWidget *parent, const JavaCheckResult &result); // Show a dialog saying that the Java binary was not usable because of bad options - void javaArgsWereBad(QWidget *parent, JavaCheckResult result); + void javaArgsWereBad(QWidget *parent, const JavaCheckResult &result); // Show a dialog saying that the Java binary was not usable - void javaBinaryWasBad(QWidget *parent, JavaCheckResult result); + void javaBinaryWasBad(QWidget *parent, const JavaCheckResult &result); // Show a dialog if we couldn't find Java Checker void javaCheckNotFound(QWidget *parent); diff --git a/launcher/java/JavaVersion.cpp b/launcher/java/JavaVersion.cpp index 0e4fc1d3c..7124e22fb 100644 --- a/launcher/java/JavaVersion.cpp +++ b/launcher/java/JavaVersion.cpp @@ -43,7 +43,7 @@ JavaVersion::JavaVersion(const QString &rhs) operator=(rhs); } -QString JavaVersion::toString() +QString JavaVersion::toString() const { return m_string; } diff --git a/launcher/java/JavaVersion.h b/launcher/java/JavaVersion.h index 9bbf06425..c051a794a 100644 --- a/launcher/java/JavaVersion.h +++ b/launcher/java/JavaVersion.h @@ -25,7 +25,7 @@ public: bool requiresPermGen(); - QString toString(); + QString toString() const; int major() {