mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-20 04:38:17 -05:00
applets/error: Use aliases for callbacks
This commit is contained in:
@ -14,7 +14,7 @@ QtErrorDisplay::QtErrorDisplay(GMainWindow& parent) {
|
||||
|
||||
QtErrorDisplay::~QtErrorDisplay() = default;
|
||||
|
||||
void QtErrorDisplay::ShowError(Result error, std::function<void()> finished) const {
|
||||
void QtErrorDisplay::ShowError(Result error, FinishedCallback finished) const {
|
||||
callback = std::move(finished);
|
||||
emit MainWindowDisplayError(
|
||||
tr("Error Code: %1-%2 (0x%3)")
|
||||
@ -25,7 +25,7 @@ void QtErrorDisplay::ShowError(Result error, std::function<void()> finished) con
|
||||
}
|
||||
|
||||
void QtErrorDisplay::ShowErrorWithTimestamp(Result error, std::chrono::seconds time,
|
||||
std::function<void()> finished) const {
|
||||
FinishedCallback finished) const {
|
||||
callback = std::move(finished);
|
||||
|
||||
const QDateTime date_time = QDateTime::fromSecsSinceEpoch(time.count());
|
||||
@ -42,7 +42,7 @@ void QtErrorDisplay::ShowErrorWithTimestamp(Result error, std::chrono::seconds t
|
||||
|
||||
void QtErrorDisplay::ShowCustomErrorText(Result error, std::string dialog_text,
|
||||
std::string fullscreen_text,
|
||||
std::function<void()> finished) const {
|
||||
FinishedCallback finished) const {
|
||||
callback = std::move(finished);
|
||||
emit MainWindowDisplayError(
|
||||
tr("Error Code: %1-%2 (0x%3)")
|
||||
|
@ -16,11 +16,11 @@ public:
|
||||
explicit QtErrorDisplay(GMainWindow& parent);
|
||||
~QtErrorDisplay() override;
|
||||
|
||||
void ShowError(Result error, std::function<void()> finished) const override;
|
||||
void ShowError(Result error, FinishedCallback finished) const override;
|
||||
void ShowErrorWithTimestamp(Result error, std::chrono::seconds time,
|
||||
std::function<void()> finished) const override;
|
||||
FinishedCallback finished) const override;
|
||||
void ShowCustomErrorText(Result error, std::string dialog_text, std::string fullscreen_text,
|
||||
std::function<void()> finished) const override;
|
||||
FinishedCallback finished) const override;
|
||||
|
||||
signals:
|
||||
void MainWindowDisplayError(QString error_code, QString error_text) const;
|
||||
@ -28,5 +28,5 @@ signals:
|
||||
private:
|
||||
void MainWindowFinishedError();
|
||||
|
||||
mutable std::function<void()> callback;
|
||||
mutable FinishedCallback callback;
|
||||
};
|
||||
|
Reference in New Issue
Block a user