Refactor SystemBootParameters ownership

This commit is contained in:
Silent
2021-06-08 18:38:12 +02:00
parent 4e282cd172
commit e21f2644d0
9 changed files with 32 additions and 41 deletions

View File

@ -52,7 +52,7 @@ Log_SetChannel(QtHostInterface);
QtHostInterface::QtHostInterface(QObject* parent) : QObject(parent), CommonHostInterface()
{
qRegisterMetaType<std::shared_ptr<const SystemBootParameters>>();
qRegisterMetaType<std::shared_ptr<SystemBootParameters>>();
qRegisterMetaType<const GameListEntry*>();
qRegisterMetaType<GPURenderer>();
}
@ -333,17 +333,17 @@ void QtHostInterface::setMainWindow(MainWindow* window)
m_main_window = window;
}
void QtHostInterface::bootSystem(std::shared_ptr<const SystemBootParameters> params)
void QtHostInterface::bootSystem(std::shared_ptr<SystemBootParameters> params)
{
if (!isOnWorkerThread())
{
QMetaObject::invokeMethod(this, "bootSystem", Qt::QueuedConnection,
Q_ARG(std::shared_ptr<const SystemBootParameters>, std::move(params)));
Q_ARG(std::shared_ptr<SystemBootParameters>, std::move(params)));
return;
}
emit emulationStarting();
if (!BootSystem(*params))
if (!BootSystem(std::move(params)))
return;
// force a frame to be drawn to repaint the window