Pass a SystemBootParameters pointer to QtHostInterface::bootSystem

This resolves ownership issues related to the SystemBootParameters
class, since it's meant to be non-copyable but it was copied as per
Qt meta type rules
This commit is contained in:
Silent
2020-09-12 22:01:08 +02:00
parent 95d5417017
commit c47dceffb5
4 changed files with 21 additions and 33 deletions

View File

@@ -30,7 +30,7 @@ class INISettingsInterface;
class MainWindow;
class QtDisplayWidget;
Q_DECLARE_METATYPE(SystemBootParameters);
Q_DECLARE_METATYPE(std::shared_ptr<const SystemBootParameters>);
class QtHostInterface final : public QObject, public CommonHostInterface
{
@@ -49,8 +49,6 @@ public:
void ReportMessage(const char* message) override;
bool ConfirmMessage(const char* message) override;
bool parseCommandLineParameters(int argc, char* argv[], std::unique_ptr<SystemBootParameters>* out_boot_params);
/// Thread-safe settings access.
std::string GetStringSettingValue(const char* section, const char* key, const char* default_value = "") override;
bool GetBoolSettingValue(const char* section, const char* key, bool default_value = false) override;
@@ -141,7 +139,7 @@ public Q_SLOTS:
void onDisplayWindowKeyEvent(int key, bool pressed);
void onDisplayWindowMouseMoveEvent(int x, int y);
void onDisplayWindowMouseButtonEvent(int button, bool pressed);
void bootSystem(const SystemBootParameters& params);
void bootSystem(std::shared_ptr<const SystemBootParameters> params);
void resumeSystemFromState(const QString& filename, bool boot_on_failure);
void resumeSystemFromMostRecentState();
void powerOffSystem();