mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-26 13:26:30 -05:00
Merge pull request #4834 from lioncash/copy-fn
controller: Pass ControllerParameters by reference in ReconfigureControllers()
This commit is contained in:
commit
9f08cea2c4
4 changed files with 9 additions and 7 deletions
|
@ -19,7 +19,7 @@ DefaultControllerApplet::DefaultControllerApplet(Service::SM::ServiceManager& se
|
||||||
DefaultControllerApplet::~DefaultControllerApplet() = default;
|
DefaultControllerApplet::~DefaultControllerApplet() = default;
|
||||||
|
|
||||||
void DefaultControllerApplet::ReconfigureControllers(std::function<void()> callback,
|
void DefaultControllerApplet::ReconfigureControllers(std::function<void()> callback,
|
||||||
ControllerParameters parameters) const {
|
const ControllerParameters& parameters) const {
|
||||||
LOG_INFO(Service_HID, "called, deducing the best configuration based on the given parameters!");
|
LOG_INFO(Service_HID, "called, deducing the best configuration based on the given parameters!");
|
||||||
|
|
||||||
auto& npad =
|
auto& npad =
|
||||||
|
|
|
@ -38,7 +38,7 @@ public:
|
||||||
virtual ~ControllerApplet();
|
virtual ~ControllerApplet();
|
||||||
|
|
||||||
virtual void ReconfigureControllers(std::function<void()> callback,
|
virtual void ReconfigureControllers(std::function<void()> callback,
|
||||||
ControllerParameters parameters) const = 0;
|
const ControllerParameters& parameters) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DefaultControllerApplet final : public ControllerApplet {
|
class DefaultControllerApplet final : public ControllerApplet {
|
||||||
|
@ -47,7 +47,7 @@ public:
|
||||||
~DefaultControllerApplet() override;
|
~DefaultControllerApplet() override;
|
||||||
|
|
||||||
void ReconfigureControllers(std::function<void()> callback,
|
void ReconfigureControllers(std::function<void()> callback,
|
||||||
ControllerParameters parameters) const override;
|
const ControllerParameters& parameters) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Service::SM::ServiceManager& service_manager;
|
Service::SM::ServiceManager& service_manager;
|
||||||
|
|
|
@ -589,7 +589,7 @@ QtControllerSelector::QtControllerSelector(GMainWindow& parent) {
|
||||||
QtControllerSelector::~QtControllerSelector() = default;
|
QtControllerSelector::~QtControllerSelector() = default;
|
||||||
|
|
||||||
void QtControllerSelector::ReconfigureControllers(
|
void QtControllerSelector::ReconfigureControllers(
|
||||||
std::function<void()> callback, Core::Frontend::ControllerParameters parameters) const {
|
std::function<void()> callback, const Core::Frontend::ControllerParameters& parameters) const {
|
||||||
this->callback = std::move(callback);
|
this->callback = std::move(callback);
|
||||||
emit MainWindowReconfigureControllers(parameters);
|
emit MainWindowReconfigureControllers(parameters);
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,11 +120,13 @@ public:
|
||||||
explicit QtControllerSelector(GMainWindow& parent);
|
explicit QtControllerSelector(GMainWindow& parent);
|
||||||
~QtControllerSelector() override;
|
~QtControllerSelector() override;
|
||||||
|
|
||||||
void ReconfigureControllers(std::function<void()> callback,
|
void ReconfigureControllers(
|
||||||
Core::Frontend::ControllerParameters parameters) const override;
|
std::function<void()> callback,
|
||||||
|
const Core::Frontend::ControllerParameters& parameters) const override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void MainWindowReconfigureControllers(Core::Frontend::ControllerParameters parameters) const;
|
void MainWindowReconfigureControllers(
|
||||||
|
const Core::Frontend::ControllerParameters& parameters) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void MainWindowReconfigureFinished();
|
void MainWindowReconfigureFinished();
|
||||||
|
|
Loading…
Reference in a new issue