Fixed some codeql warnings
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
7317105e4d
commit
5afe75e821
@ -121,7 +121,7 @@ void JavaCommon::TestCheck::run()
|
||||
checker->start();
|
||||
}
|
||||
|
||||
void JavaCommon::TestCheck::checkFinished(JavaChecker::Result result)
|
||||
void JavaCommon::TestCheck::checkFinished(const JavaChecker::Result& result)
|
||||
{
|
||||
if (result.validity != JavaChecker::Result::Validity::Valid) {
|
||||
javaBinaryWasBad(m_parent, result);
|
||||
@ -133,7 +133,7 @@ void JavaCommon::TestCheck::checkFinished(JavaChecker::Result result)
|
||||
checker->start();
|
||||
}
|
||||
|
||||
void JavaCommon::TestCheck::checkFinishedWithArgs(JavaChecker::Result result)
|
||||
void JavaCommon::TestCheck::checkFinishedWithArgs(const JavaChecker::Result& result)
|
||||
{
|
||||
if (result.validity == JavaChecker::Result::Validity::Valid) {
|
||||
javaWasOk(m_parent, result);
|
||||
|
@ -32,8 +32,8 @@ class TestCheck : public QObject {
|
||||
void finished();
|
||||
|
||||
private slots:
|
||||
void checkFinished(JavaChecker::Result result);
|
||||
void checkFinishedWithArgs(JavaChecker::Result result);
|
||||
void checkFinished(const JavaChecker::Result& result);
|
||||
void checkFinishedWithArgs(const JavaChecker::Result& result);
|
||||
|
||||
private:
|
||||
JavaChecker::Ptr checker;
|
||||
|
@ -29,7 +29,7 @@ class JavaChecker : public Task {
|
||||
explicit JavaChecker(QString path, QString args, int minMem = 0, int maxMem = 0, int permGen = 0, int id = 0, QObject* parent = 0);
|
||||
|
||||
signals:
|
||||
void checkFinished(Result result);
|
||||
void checkFinished(const Result& result);
|
||||
|
||||
protected:
|
||||
virtual void executeTask() override;
|
||||
|
@ -170,7 +170,7 @@ void JavaListLoadTask::executeTask()
|
||||
int id = 0;
|
||||
for (QString candidate : candidate_paths) {
|
||||
auto checker = new JavaChecker(candidate, "", 0, 0, 0, id, this);
|
||||
connect(checker, &JavaChecker::checkFinished, [this](JavaChecker::Result result) { m_results << result; });
|
||||
connect(checker, &JavaChecker::checkFinished, [this](const JavaChecker::Result& result) { m_results << result; });
|
||||
job->addTask(Task::Ptr(checker));
|
||||
id++;
|
||||
}
|
||||
@ -181,7 +181,7 @@ void JavaListLoadTask::executeTask()
|
||||
void JavaListLoadTask::javaCheckerFinished()
|
||||
{
|
||||
QList<JavaInstallPtr> candidates;
|
||||
std::sort(m_results.begin(), m_results.end(), [](JavaChecker::Result a, JavaChecker::Result b) { return a.id < b.id; });
|
||||
std::sort(m_results.begin(), m_results.end(), [](const JavaChecker::Result& a, const JavaChecker::Result& b) { return a.id < b.id; });
|
||||
|
||||
qDebug() << "Found the following valid Java installations:";
|
||||
for (auto result : m_results) {
|
||||
|
@ -43,12 +43,12 @@ QString JavaVersion::toString() const
|
||||
return m_string;
|
||||
}
|
||||
|
||||
bool JavaVersion::requiresPermGen()
|
||||
bool JavaVersion::requiresPermGen() const
|
||||
{
|
||||
return !m_parseable || m_major < 8;
|
||||
}
|
||||
|
||||
bool JavaVersion::isModular()
|
||||
bool JavaVersion::isModular() const
|
||||
{
|
||||
return m_parseable && m_major >= 9;
|
||||
}
|
||||
|
@ -24,9 +24,9 @@ class JavaVersion {
|
||||
bool operator==(const JavaVersion& rhs);
|
||||
bool operator>(const JavaVersion& rhs);
|
||||
|
||||
bool requiresPermGen();
|
||||
bool requiresPermGen() const;
|
||||
|
||||
bool isModular();
|
||||
bool isModular() const;
|
||||
|
||||
QString toString() const;
|
||||
|
||||
|
@ -49,7 +49,6 @@ void ArchiveJavaDownloader::executeTask()
|
||||
auto fullPath = entry->getFullPath();
|
||||
|
||||
connect(download.get(), &NetJob::finished, [download, this] { disconnect(this, &Task::aborted, download.get(), &NetJob::abort); });
|
||||
// connect(download.get(), &NetJob::aborted, [path] { APPLICATION->instances()->destroyStagingPath(path); });
|
||||
connect(download.get(), &NetJob::progress, this, &ArchiveJavaDownloader::progress);
|
||||
connect(download.get(), &NetJob::failed, this, &ArchiveJavaDownloader::emitFailed);
|
||||
connect(this, &Task::aborted, download.get(), &NetJob::abort);
|
||||
|
@ -106,7 +106,7 @@ void CheckJava::executeTask()
|
||||
emitSucceeded();
|
||||
}
|
||||
|
||||
void CheckJava::checkJavaFinished(JavaChecker::Result result)
|
||||
void CheckJava::checkJavaFinished(const JavaChecker::Result& result)
|
||||
{
|
||||
switch (result.validity) {
|
||||
case JavaChecker::Result::Validity::Errored: {
|
||||
|
@ -28,7 +28,7 @@ class CheckJava : public LaunchStep {
|
||||
virtual void executeTask();
|
||||
virtual bool canAbort() const { return false; }
|
||||
private slots:
|
||||
void checkJavaFinished(JavaChecker::Result result);
|
||||
void checkJavaFinished(const JavaChecker::Result& result);
|
||||
|
||||
private:
|
||||
void printJavaInfo(const QString& version, const QString& architecture, const QString& realArchitecture, const QString& vendor);
|
||||
|
@ -377,7 +377,7 @@ void JavaSettingsWidget::checkJavaPath(const QString& path)
|
||||
m_checker->start();
|
||||
}
|
||||
|
||||
void JavaSettingsWidget::checkFinished(JavaChecker::Result result)
|
||||
void JavaSettingsWidget::checkFinished(const JavaChecker::Result& result)
|
||||
{
|
||||
m_result = result;
|
||||
switch (result.validity) {
|
||||
|
@ -51,7 +51,7 @@ class JavaSettingsWidget : public QWidget {
|
||||
void on_javaBrowseBtn_clicked();
|
||||
void on_javaStatusBtn_clicked();
|
||||
void on_javaDownloadBtn_clicked();
|
||||
void checkFinished(JavaChecker::Result result);
|
||||
void checkFinished(const JavaChecker::Result& result);
|
||||
|
||||
protected: /* methods */
|
||||
void checkJavaPathOnEdit(const QString& path);
|
||||
|
Loading…
Reference in New Issue
Block a user