mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-11-02 05:17:52 +00:00
applets/controller: Use aliases for callbacks
This commit is contained in:
parent
d8da9a2afd
commit
fedd857054
4 changed files with 8 additions and 6 deletions
|
@ -16,7 +16,7 @@ DefaultControllerApplet::DefaultControllerApplet(HID::HIDCore& hid_core_) : hid_
|
||||||
|
|
||||||
DefaultControllerApplet::~DefaultControllerApplet() = default;
|
DefaultControllerApplet::~DefaultControllerApplet() = default;
|
||||||
|
|
||||||
void DefaultControllerApplet::ReconfigureControllers(std::function<void()> callback,
|
void DefaultControllerApplet::ReconfigureControllers(ReconfigureCallback callback,
|
||||||
const 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!");
|
||||||
|
|
||||||
|
|
|
@ -36,9 +36,11 @@ struct ControllerParameters {
|
||||||
|
|
||||||
class ControllerApplet {
|
class ControllerApplet {
|
||||||
public:
|
public:
|
||||||
|
using ReconfigureCallback = std::function<void()>;
|
||||||
|
|
||||||
virtual ~ControllerApplet();
|
virtual ~ControllerApplet();
|
||||||
|
|
||||||
virtual void ReconfigureControllers(std::function<void()> callback,
|
virtual void ReconfigureControllers(ReconfigureCallback callback,
|
||||||
const ControllerParameters& parameters) const = 0;
|
const ControllerParameters& parameters) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -47,7 +49,7 @@ public:
|
||||||
explicit DefaultControllerApplet(HID::HIDCore& hid_core_);
|
explicit DefaultControllerApplet(HID::HIDCore& hid_core_);
|
||||||
~DefaultControllerApplet() override;
|
~DefaultControllerApplet() override;
|
||||||
|
|
||||||
void ReconfigureControllers(std::function<void()> callback,
|
void ReconfigureControllers(ReconfigureCallback callback,
|
||||||
const ControllerParameters& parameters) const override;
|
const ControllerParameters& parameters) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -685,7 +685,7 @@ QtControllerSelector::QtControllerSelector(GMainWindow& parent) {
|
||||||
QtControllerSelector::~QtControllerSelector() = default;
|
QtControllerSelector::~QtControllerSelector() = default;
|
||||||
|
|
||||||
void QtControllerSelector::ReconfigureControllers(
|
void QtControllerSelector::ReconfigureControllers(
|
||||||
std::function<void()> callback_, const Core::Frontend::ControllerParameters& parameters) const {
|
ReconfigureCallback callback_, const Core::Frontend::ControllerParameters& parameters) const {
|
||||||
callback = std::move(callback_);
|
callback = std::move(callback_);
|
||||||
emit MainWindowReconfigureControllers(parameters);
|
emit MainWindowReconfigureControllers(parameters);
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,7 +157,7 @@ public:
|
||||||
~QtControllerSelector() override;
|
~QtControllerSelector() override;
|
||||||
|
|
||||||
void ReconfigureControllers(
|
void ReconfigureControllers(
|
||||||
std::function<void()> callback_,
|
ReconfigureCallback callback_,
|
||||||
const Core::Frontend::ControllerParameters& parameters) const override;
|
const Core::Frontend::ControllerParameters& parameters) const override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
@ -167,5 +167,5 @@ signals:
|
||||||
private:
|
private:
|
||||||
void MainWindowReconfigureFinished();
|
void MainWindowReconfigureFinished();
|
||||||
|
|
||||||
mutable std::function<void()> callback;
|
mutable ReconfigureCallback callback;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue