summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorMai M <mathew1800@gmail.com>2021-05-30 05:34:40 +0200
committerGitHub <noreply@github.com>2021-05-30 05:34:40 +0200
commit2069430baa2c9ba9610fae988f92ad73d9f12643 (patch)
tree76dc8a060a3170e1fafd54bc02e1722c9daf6621 /src/core
parentMerge pull request #6364 from german77/stub-lp2p (diff)
parentapplets/swkbd: Make use of std::move where applicable (diff)
downloadyuzu-2069430baa2c9ba9610fae988f92ad73d9f12643.tar
yuzu-2069430baa2c9ba9610fae988f92ad73d9f12643.tar.gz
yuzu-2069430baa2c9ba9610fae988f92ad73d9f12643.tar.bz2
yuzu-2069430baa2c9ba9610fae988f92ad73d9f12643.tar.lz
yuzu-2069430baa2c9ba9610fae988f92ad73d9f12643.tar.xz
yuzu-2069430baa2c9ba9610fae988f92ad73d9f12643.tar.zst
yuzu-2069430baa2c9ba9610fae988f92ad73d9f12643.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/am/applets/software_keyboard.cpp25
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() {
std::memcpy(&swkbd_text_check, text_check_data.data(), sizeof(SwkbdTextCheck));
- std::u16string text_check_message = Common::UTF16StringFromFixedZeroTerminatedBuffer(
- swkbd_text_check.text_check_message.data(), swkbd_text_check.text_check_message.size());
+ std::u16string text_check_message =
+ swkbd_text_check.text_check_result == SwkbdTextCheckResult::Failure ||
+ swkbd_text_check.text_check_result == SwkbdTextCheckResult::Confirm
+ ? Common::UTF16StringFromFixedZeroTerminatedBuffer(
+ swkbd_text_check.text_check_message.data(),
+ swkbd_text_check.text_check_message.size())
+ : u"";
LOG_INFO(Service_AM, "\nTextCheckResult: {}\nTextCheckMessage: {}",
GetTextCheckResultName(swkbd_text_check.text_check_result),
@@ -285,10 +290,10 @@ void SoftwareKeyboard::ProcessTextCheck() {
SubmitNormalOutputAndExit(SwkbdResult::Ok, current_text);
break;
case SwkbdTextCheckResult::Failure:
- ShowTextCheckDialog(SwkbdTextCheckResult::Failure, text_check_message);
+ ShowTextCheckDialog(SwkbdTextCheckResult::Failure, std::move(text_check_message));
break;
case SwkbdTextCheckResult::Confirm:
- ShowTextCheckDialog(SwkbdTextCheckResult::Confirm, text_check_message);
+ ShowTextCheckDialog(SwkbdTextCheckResult::Confirm, std::move(text_check_message));
break;
case SwkbdTextCheckResult::Silent:
default:
@@ -482,7 +487,7 @@ void SoftwareKeyboard::InitializeFrontendKeyboard() {
max_text_length <= 32 ? SwkbdTextDrawType::Line : SwkbdTextDrawType::Box;
Core::Frontend::KeyboardInitializeParameters initialize_parameters{
- .ok_text{ok_text},
+ .ok_text{std::move(ok_text)},
.header_text{},
.sub_text{},
.guide_text{},
@@ -558,10 +563,10 @@ void SoftwareKeyboard::InitializeFrontendKeyboard() {
: false;
Core::Frontend::KeyboardInitializeParameters initialize_parameters{
- .ok_text{ok_text},
- .header_text{header_text},
- .sub_text{sub_text},
- .guide_text{guide_text},
+ .ok_text{std::move(ok_text)},
+ .header_text{std::move(header_text)},
+ .sub_text{std::move(sub_text)},
+ .guide_text{std::move(guide_text)},
.initial_text{initial_text},
.max_text_length{max_text_length},
.min_text_length{min_text_length},
@@ -590,7 +595,7 @@ void SoftwareKeyboard::ShowNormalKeyboard() {
void SoftwareKeyboard::ShowTextCheckDialog(SwkbdTextCheckResult text_check_result,
std::u16string text_check_message) {
- frontend.ShowTextCheckDialog(text_check_result, text_check_message);
+ frontend.ShowTextCheckDialog(text_check_result, std::move(text_check_message));
}
void SoftwareKeyboard::ShowInlineKeyboard() {