summaryrefslogtreecommitdiffstats
path: root/api/logic/java
diff options
context:
space:
mode:
Diffstat (limited to 'api/logic/java')
-rw-r--r--api/logic/java/JavaChecker.cpp4
-rw-r--r--api/logic/java/JavaChecker.h6
-rw-r--r--api/logic/java/JavaCheckerJob.h2
-rw-r--r--api/logic/java/JavaInstallList.cpp2
-rw-r--r--api/logic/java/JavaInstallList.h4
-rw-r--r--api/logic/java/launch/CheckJava.cpp2
6 files changed, 12 insertions, 8 deletions
diff --git a/api/logic/java/JavaChecker.cpp b/api/logic/java/JavaChecker.cpp
index 9ba3933f..ca0f4bde 100644
--- a/api/logic/java/JavaChecker.cpp
+++ b/api/logic/java/JavaChecker.cpp
@@ -75,8 +75,8 @@ void JavaChecker::stderrReady()
void JavaChecker::finished(int exitcode, QProcess::ExitStatus status)
{
killTimer.stop();
- QProcessPtr _process;
- _process.swap(process);
+ QProcessPtr _process = process;
+ process.reset();
JavaCheckResult result;
{
diff --git a/api/logic/java/JavaChecker.h b/api/logic/java/JavaChecker.h
index d5d4b0de..af0dcb90 100644
--- a/api/logic/java/JavaChecker.h
+++ b/api/logic/java/JavaChecker.h
@@ -3,6 +3,8 @@
#include <QTimer>
#include <memory>
+#include "QObjectPtr.h"
+
#include "multimc_logic_export.h"
#include "JavaVersion.h"
@@ -27,8 +29,8 @@ struct MULTIMC_LOGIC_EXPORT JavaCheckResult
} validity = Validity::Errored;
};
-typedef std::shared_ptr<QProcess> QProcessPtr;
-typedef std::shared_ptr<JavaChecker> JavaCheckerPtr;
+typedef shared_qobject_ptr<QProcess> QProcessPtr;
+typedef shared_qobject_ptr<JavaChecker> JavaCheckerPtr;
class MULTIMC_LOGIC_EXPORT JavaChecker : public QObject
{
Q_OBJECT
diff --git a/api/logic/java/JavaCheckerJob.h b/api/logic/java/JavaCheckerJob.h
index ab8a4bbc..24d0d1b8 100644
--- a/api/logic/java/JavaCheckerJob.h
+++ b/api/logic/java/JavaCheckerJob.h
@@ -20,7 +20,7 @@
#include "tasks/Task.h"
class JavaCheckerJob;
-typedef std::shared_ptr<JavaCheckerJob> JavaCheckerJobPtr;
+typedef shared_qobject_ptr<JavaCheckerJob> JavaCheckerJobPtr;
// FIXME: this just seems horribly redundant
class JavaCheckerJob : public Task
diff --git a/api/logic/java/JavaInstallList.cpp b/api/logic/java/JavaInstallList.cpp
index a80ee2da..a71a7dbe 100644
--- a/api/logic/java/JavaInstallList.cpp
+++ b/api/logic/java/JavaInstallList.cpp
@@ -149,7 +149,7 @@ void JavaListLoadTask::executeTask()
JavaUtils ju;
QList<QString> candidate_paths = ju.FindJavaPaths();
- m_job = std::shared_ptr<JavaCheckerJob>(new JavaCheckerJob("Java detection"));
+ m_job = 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/api/logic/java/JavaInstallList.h b/api/logic/java/JavaInstallList.h
index fc7e7a92..b98908f3 100644
--- a/api/logic/java/JavaInstallList.h
+++ b/api/logic/java/JavaInstallList.h
@@ -24,6 +24,8 @@
#include "JavaCheckerJob.h"
#include "JavaInstall.h"
+#include "QObjectPtr.h"
+
#include "multimc_logic_export.h"
class JavaListLoadTask;
@@ -75,7 +77,7 @@ public slots:
void javaCheckerFinished();
protected:
- std::shared_ptr<JavaCheckerJob> m_job;
+ shared_qobject_ptr<JavaCheckerJob> m_job;
JavaInstallList *m_list;
JavaInstall *m_currentRecommended;
};
diff --git a/api/logic/java/launch/CheckJava.cpp b/api/logic/java/launch/CheckJava.cpp
index f4c85245..b75c6dc6 100644
--- a/api/logic/java/launch/CheckJava.cpp
+++ b/api/logic/java/launch/CheckJava.cpp
@@ -60,7 +60,7 @@ void CheckJava::executeTask()
// if timestamps are not the same, or something is missing, check!
if (javaUnixTime != storedUnixTime || storedVersion.size() == 0 || storedArchitecture.size() == 0)
{
- m_JavaChecker = std::make_shared<JavaChecker>();
+ m_JavaChecker = new JavaChecker();
emit logLine(tr("Checking Java version..."), MessageLevel::MultiMC);
connect(m_JavaChecker.get(), &JavaChecker::checkFinished, this, &CheckJava::checkJavaFinished);
m_JavaChecker->m_path = realJavaPath;