summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2019-04-07 23:59:04 +0200
committerPetr Mrázek <peterix@gmail.com>2019-04-07 23:59:04 +0200
commit70ed30f9e6b47fbfb3151078ca61a2bb419feccb (patch)
tree0849ab3776d3e716285f3186b4e8e21ee246ee21 /application
parent414946cad94affccddfa500056c6eeb967438643 (diff)
downloadMultiMC-70ed30f9e6b47fbfb3151078ca61a2bb419feccb.tar
MultiMC-70ed30f9e6b47fbfb3151078ca61a2bb419feccb.tar.gz
MultiMC-70ed30f9e6b47fbfb3151078ca61a2bb419feccb.tar.lz
MultiMC-70ed30f9e6b47fbfb3151078ca61a2bb419feccb.tar.xz
MultiMC-70ed30f9e6b47fbfb3151078ca61a2bb419feccb.zip
GH-2591 less std::shared_ptr and more shared_qobject_ptr
This eliminates some weird crashes.
Diffstat (limited to 'application')
-rw-r--r--application/InstanceWindow.cpp2
-rw-r--r--application/InstanceWindow.h4
-rw-r--r--application/LaunchController.cpp2
-rw-r--r--application/LaunchController.h2
-rw-r--r--application/pages/instance/LogPage.cpp4
-rw-r--r--application/pages/instance/LogPage.h6
6 files changed, 10 insertions, 10 deletions
diff --git a/application/InstanceWindow.cpp b/application/InstanceWindow.cpp
index 8a9c3bdf..cf445f12 100644
--- a/application/InstanceWindow.cpp
+++ b/application/InstanceWindow.cpp
@@ -144,7 +144,7 @@ void InstanceWindow::on_btnLaunchMinecraftOffline_clicked()
MMC->launch(m_instance, false, nullptr);
}
-void InstanceWindow::on_InstanceLaunchTask_changed(std::shared_ptr<LaunchTask> proc)
+void InstanceWindow::on_InstanceLaunchTask_changed(shared_qobject_ptr<LaunchTask> proc)
{
m_proc = proc;
}
diff --git a/application/InstanceWindow.h b/application/InstanceWindow.h
index 792624e2..e5bd4464 100644
--- a/application/InstanceWindow.h
+++ b/application/InstanceWindow.h
@@ -52,7 +52,7 @@ slots:
void on_btnKillMinecraft_clicked();
void on_btnLaunchMinecraftOffline_clicked();
- void on_InstanceLaunchTask_changed(std::shared_ptr<LaunchTask> proc);
+ void on_InstanceLaunchTask_changed(shared_qobject_ptr<LaunchTask> proc);
void on_RunningState_changed(bool running);
void on_instanceStatusChanged(BaseInstance::Status, BaseInstance::Status newStatus);
@@ -63,7 +63,7 @@ private:
void updateLaunchButtons();
private:
- std::shared_ptr<LaunchTask> m_proc;
+ shared_qobject_ptr<LaunchTask> m_proc;
InstancePtr m_instance;
bool m_doNotSave = false;
PageContainer *m_container = nullptr;
diff --git a/application/LaunchController.cpp b/application/LaunchController.cpp
index 0115bba4..8f3e6596 100644
--- a/application/LaunchController.cpp
+++ b/application/LaunchController.cpp
@@ -218,7 +218,7 @@ void LaunchController::launchInstance()
connect(m_launcher.get(), &LaunchTask::requestProgress, this, &LaunchController::onProgressRequested);
- m_launcher->prependStep(std::make_shared<TextPrint>(m_launcher.get(), "MultiMC version: " + BuildConfig.printableVersionString() + "\n\n", MessageLevel::MultiMC));
+ m_launcher->prependStep(new TextPrint(m_launcher.get(), "MultiMC version: " + BuildConfig.printableVersionString() + "\n\n", MessageLevel::MultiMC));
m_launcher->start();
}
diff --git a/application/LaunchController.h b/application/LaunchController.h
index 1434dec9..1d879028 100644
--- a/application/LaunchController.h
+++ b/application/LaunchController.h
@@ -57,5 +57,5 @@ private:
QWidget * m_parentWidget = nullptr;
InstanceWindow *m_console = nullptr;
AuthSessionPtr m_session;
- std::shared_ptr <LaunchTask> m_launcher;
+ shared_qobject_ptr<LaunchTask> m_launcher;
};
diff --git a/application/pages/instance/LogPage.cpp b/application/pages/instance/LogPage.cpp
index 0e480a3a..94ada424 100644
--- a/application/pages/instance/LogPage.cpp
+++ b/application/pages/instance/LogPage.cpp
@@ -192,7 +192,7 @@ void LogPage::UIToModelState()
m_model->suspend(ui->trackLogCheckbox->checkState() != Qt::Checked);
}
-void LogPage::setInstanceLaunchTaskChanged(std::shared_ptr<LaunchTask> proc, bool initial)
+void LogPage::setInstanceLaunchTaskChanged(shared_qobject_ptr<LaunchTask> proc, bool initial)
{
m_process = proc;
if(m_process)
@@ -215,7 +215,7 @@ void LogPage::setInstanceLaunchTaskChanged(std::shared_ptr<LaunchTask> proc, boo
}
}
-void LogPage::onInstanceLaunchTaskChanged(std::shared_ptr<LaunchTask> proc)
+void LogPage::onInstanceLaunchTaskChanged(shared_qobject_ptr<LaunchTask> proc)
{
setInstanceLaunchTaskChanged(proc, false);
}
diff --git a/application/pages/instance/LogPage.h b/application/pages/instance/LogPage.h
index 34ed210a..9c3b56a9 100644
--- a/application/pages/instance/LogPage.h
+++ b/application/pages/instance/LogPage.h
@@ -69,17 +69,17 @@ private slots:
void findNextActivated();
void findPreviousActivated();
- void onInstanceLaunchTaskChanged(std::shared_ptr<LaunchTask> proc);
+ void onInstanceLaunchTaskChanged(shared_qobject_ptr<LaunchTask> proc);
private:
void modelStateToUI();
void UIToModelState();
- void setInstanceLaunchTaskChanged(std::shared_ptr<LaunchTask> proc, bool initial);
+ void setInstanceLaunchTaskChanged(shared_qobject_ptr<LaunchTask> proc, bool initial);
private:
Ui::LogPage *ui;
InstancePtr m_instance;
- std::shared_ptr<LaunchTask> m_process;
+ shared_qobject_ptr<LaunchTask> m_process;
LogFormatProxyModel * m_proxy;
shared_qobject_ptr <LogModel> m_model;