diff options
| author | 2021-05-29 23:34:40 -0400 | |
|---|---|---|
| committer | 2021-05-29 23:34:40 -0400 | |
| commit | 2069430baa2c9ba9610fae988f92ad73d9f12643 (patch) | |
| tree | 76dc8a060a3170e1fafd54bc02e1722c9daf6621 /src/core/hle | |
| parent | Merge pull request #6364 from german77/stub-lp2p (diff) | |
| parent | applets/swkbd: Make use of std::move where applicable (diff) | |
| download | yuzu-2069430baa2c9ba9610fae988f92ad73d9f12643.tar.gz yuzu-2069430baa2c9ba9610fae988f92ad73d9f12643.tar.xz yuzu-2069430baa2c9ba9610fae988f92ad73d9f12643.zip | |
Merge pull request #6374 from Morph1984/swkbd-textcheck-encoding
applets/swkbd: Only read the text check message on Failure/Confirm
Diffstat (limited to 'src/core/hle')
| -rw-r--r-- | src/core/hle/service/am/applets/software_keyboard.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/core/hle/service/am/applets/software_keyboard.cpp b/src/core/hle/service/am/applets/software_keyboard.cpp index b05a5da04..b1a81810b 100644 --- a/src/core/hle/service/am/applets/software_keyboard.cpp +++ b/src/core/hle/service/am/applets/software_keyboard.cpp | |||
| @@ -273,8 +273,13 @@ void SoftwareKeyboard::ProcessTextCheck() { | |||
| 273 | 273 | ||
| 274 | std::memcpy(&swkbd_text_check, text_check_data.data(), sizeof(SwkbdTextCheck)); | 274 | std::memcpy(&swkbd_text_check, text_check_data.data(), sizeof(SwkbdTextCheck)); |
| 275 | 275 | ||
| 276 | std::u16string text_check_message = Common::UTF16StringFromFixedZeroTerminatedBuffer( | 276 | std::u16string text_check_message = |
| 277 | swkbd_text_check.text_check_message.data(), swkbd_text_check.text_check_message.size()); | 277 | swkbd_text_check.text_check_result == SwkbdTextCheckResult::Failure || |
| 278 | swkbd_text_check.text_check_result == SwkbdTextCheckResult::Confirm | ||
| 279 | ? Common::UTF16StringFromFixedZeroTerminatedBuffer( | ||
| 280 | swkbd_text_check.text_check_message.data(), | ||
| 281 | swkbd_text_check.text_check_message.size()) | ||
| 282 | : u""; | ||
| 278 | 283 | ||
| 279 | LOG_INFO(Service_AM, "\nTextCheckResult: {}\nTextCheckMessage: {}", | 284 | LOG_INFO(Service_AM, "\nTextCheckResult: {}\nTextCheckMessage: {}", |
| 280 | GetTextCheckResultName(swkbd_text_check.text_check_result), | 285 | GetTextCheckResultName(swkbd_text_check.text_check_result), |
| @@ -285,10 +290,10 @@ void SoftwareKeyboard::ProcessTextCheck() { | |||
| 285 | SubmitNormalOutputAndExit(SwkbdResult::Ok, current_text); | 290 | SubmitNormalOutputAndExit(SwkbdResult::Ok, current_text); |
| 286 | break; | 291 | break; |
| 287 | case SwkbdTextCheckResult::Failure: | 292 | case SwkbdTextCheckResult::Failure: |
| 288 | ShowTextCheckDialog(SwkbdTextCheckResult::Failure, text_check_message); | 293 | ShowTextCheckDialog(SwkbdTextCheckResult::Failure, std::move(text_check_message)); |
| 289 | break; | 294 | break; |
| 290 | case SwkbdTextCheckResult::Confirm: | 295 | case SwkbdTextCheckResult::Confirm: |
| 291 | ShowTextCheckDialog(SwkbdTextCheckResult::Confirm, text_check_message); | 296 | ShowTextCheckDialog(SwkbdTextCheckResult::Confirm, std::move(text_check_message)); |
| 292 | break; | 297 | break; |
| 293 | case SwkbdTextCheckResult::Silent: | 298 | case SwkbdTextCheckResult::Silent: |
| 294 | default: | 299 | default: |
| @@ -482,7 +487,7 @@ void SoftwareKeyboard::InitializeFrontendKeyboard() { | |||
| 482 | max_text_length <= 32 ? SwkbdTextDrawType::Line : SwkbdTextDrawType::Box; | 487 | max_text_length <= 32 ? SwkbdTextDrawType::Line : SwkbdTextDrawType::Box; |
| 483 | 488 | ||
| 484 | Core::Frontend::KeyboardInitializeParameters initialize_parameters{ | 489 | Core::Frontend::KeyboardInitializeParameters initialize_parameters{ |
| 485 | .ok_text{ok_text}, | 490 | .ok_text{std::move(ok_text)}, |
| 486 | .header_text{}, | 491 | .header_text{}, |
| 487 | .sub_text{}, | 492 | .sub_text{}, |
| 488 | .guide_text{}, | 493 | .guide_text{}, |
| @@ -558,10 +563,10 @@ void SoftwareKeyboard::InitializeFrontendKeyboard() { | |||
| 558 | : false; | 563 | : false; |
| 559 | 564 | ||
| 560 | Core::Frontend::KeyboardInitializeParameters initialize_parameters{ | 565 | Core::Frontend::KeyboardInitializeParameters initialize_parameters{ |
| 561 | .ok_text{ok_text}, | 566 | .ok_text{std::move(ok_text)}, |
| 562 | .header_text{header_text}, | 567 | .header_text{std::move(header_text)}, |
| 563 | .sub_text{sub_text}, | 568 | .sub_text{std::move(sub_text)}, |
| 564 | .guide_text{guide_text}, | 569 | .guide_text{std::move(guide_text)}, |
| 565 | .initial_text{initial_text}, | 570 | .initial_text{initial_text}, |
| 566 | .max_text_length{max_text_length}, | 571 | .max_text_length{max_text_length}, |
| 567 | .min_text_length{min_text_length}, | 572 | .min_text_length{min_text_length}, |
| @@ -590,7 +595,7 @@ void SoftwareKeyboard::ShowNormalKeyboard() { | |||
| 590 | 595 | ||
| 591 | void SoftwareKeyboard::ShowTextCheckDialog(SwkbdTextCheckResult text_check_result, | 596 | void SoftwareKeyboard::ShowTextCheckDialog(SwkbdTextCheckResult text_check_result, |
| 592 | std::u16string text_check_message) { | 597 | std::u16string text_check_message) { |
| 593 | frontend.ShowTextCheckDialog(text_check_result, text_check_message); | 598 | frontend.ShowTextCheckDialog(text_check_result, std::move(text_check_message)); |
| 594 | } | 599 | } |
| 595 | 600 | ||
| 596 | void SoftwareKeyboard::ShowInlineKeyboard() { | 601 | void SoftwareKeyboard::ShowInlineKeyboard() { |