mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-18 14:55:46 -04:00
Refactor SystemBootParameters ownership
This commit is contained in:
@ -478,12 +478,12 @@ void MainWindow::onStartDiscActionTriggered()
|
||||
if (filename.isEmpty())
|
||||
return;
|
||||
|
||||
m_host_interface->bootSystem(std::make_shared<const SystemBootParameters>(filename.toStdString()));
|
||||
m_host_interface->bootSystem(std::make_shared<SystemBootParameters>(filename.toStdString()));
|
||||
}
|
||||
|
||||
void MainWindow::onStartBIOSActionTriggered()
|
||||
{
|
||||
m_host_interface->bootSystem(std::make_shared<const SystemBootParameters>());
|
||||
m_host_interface->bootSystem(std::make_shared<SystemBootParameters>());
|
||||
}
|
||||
|
||||
void MainWindow::onChangeDiscFromFileActionTriggered()
|
||||
@ -655,9 +655,8 @@ void MainWindow::onGameListContextMenuRequested(const QPoint& point, const GameL
|
||||
m_host_interface->populateGameListContextMenu(entry, this, &menu);
|
||||
menu.addSeparator();
|
||||
|
||||
connect(menu.addAction(tr("Default Boot")), &QAction::triggered, [this, entry]() {
|
||||
m_host_interface->bootSystem(std::make_shared<const SystemBootParameters>(entry->path));
|
||||
});
|
||||
connect(menu.addAction(tr("Default Boot")), &QAction::triggered,
|
||||
[this, entry]() { m_host_interface->bootSystem(std::make_shared<SystemBootParameters>(entry->path)); });
|
||||
|
||||
connect(menu.addAction(tr("Fast Boot")), &QAction::triggered, [this, entry]() {
|
||||
auto boot_params = std::make_shared<SystemBootParameters>(entry->path);
|
||||
@ -976,7 +975,7 @@ void MainWindow::startGameOrChangeDiscs(const std::string& path)
|
||||
if (m_host_interface->CanResumeSystemFromFile(path.c_str()))
|
||||
m_host_interface->resumeSystemFromState(QString::fromStdString(path), true);
|
||||
else
|
||||
m_host_interface->bootSystem(std::make_shared<const SystemBootParameters>(path));
|
||||
m_host_interface->bootSystem(std::make_shared<SystemBootParameters>(path));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -32,7 +32,7 @@ class INISettingsInterface;
|
||||
class MainWindow;
|
||||
class QtDisplayWidget;
|
||||
|
||||
Q_DECLARE_METATYPE(std::shared_ptr<const SystemBootParameters>);
|
||||
Q_DECLARE_METATYPE(std::shared_ptr<SystemBootParameters>);
|
||||
Q_DECLARE_METATYPE(const GameListEntry*);
|
||||
Q_DECLARE_METATYPE(GPURenderer);
|
||||
|
||||
@ -149,7 +149,7 @@ public Q_SLOTS:
|
||||
void applySettings(bool display_osd_messages = false);
|
||||
void updateInputMap();
|
||||
void applyInputProfile(const QString& profile_path);
|
||||
void bootSystem(std::shared_ptr<const SystemBootParameters> params);
|
||||
void bootSystem(std::shared_ptr<SystemBootParameters> params);
|
||||
void resumeSystemFromState(const QString& filename, bool boot_on_failure);
|
||||
void resumeSystemFromMostRecentState();
|
||||
void powerOffSystem();
|
||||
|
Reference in New Issue
Block a user