summaryrefslogtreecommitdiffstats
path: root/src/core/frontend
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-11-12 02:16:38 +0100
committerZach Hilman <zachhilman@gmail.com>2018-11-18 16:53:47 +0100
commit7cfb29de23836aa1873bbb108e3d25a0e9dcfa6d (patch)
tree6ed63f8c93a0d9b4e0cb6ac8d41e0a94aa149e99 /src/core/frontend
parentam: Implement ILibraryAppletAccessor IsCompleted and GetResult (diff)
downloadyuzu-7cfb29de23836aa1873bbb108e3d25a0e9dcfa6d.tar
yuzu-7cfb29de23836aa1873bbb108e3d25a0e9dcfa6d.tar.gz
yuzu-7cfb29de23836aa1873bbb108e3d25a0e9dcfa6d.tar.bz2
yuzu-7cfb29de23836aa1873bbb108e3d25a0e9dcfa6d.tar.lz
yuzu-7cfb29de23836aa1873bbb108e3d25a0e9dcfa6d.tar.xz
yuzu-7cfb29de23836aa1873bbb108e3d25a0e9dcfa6d.tar.zst
yuzu-7cfb29de23836aa1873bbb108e3d25a0e9dcfa6d.zip
Diffstat (limited to 'src/core/frontend')
-rw-r--r--src/core/frontend/applets/software_keyboard.cpp10
-rw-r--r--src/core/frontend/applets/software_keyboard.h5
2 files changed, 7 insertions, 8 deletions
diff --git a/src/core/frontend/applets/software_keyboard.cpp b/src/core/frontend/applets/software_keyboard.cpp
index cf5e2ea31..2445a980d 100644
--- a/src/core/frontend/applets/software_keyboard.cpp
+++ b/src/core/frontend/applets/software_keyboard.cpp
@@ -9,14 +9,12 @@
namespace Core::Frontend {
SoftwareKeyboardApplet::~SoftwareKeyboardApplet() = default;
-bool DefaultSoftwareKeyboardApplet::GetText(SoftwareKeyboardParameters parameters,
- std::u16string& text) const {
+std::optional<std::u16string> DefaultSoftwareKeyboardApplet::GetText(
+ SoftwareKeyboardParameters parameters) const {
if (parameters.initial_text.empty())
- text = u"yuzu";
- else
- text = parameters.initial_text;
+ return u"yuzu";
- return true;
+ return parameters.initial_text;
}
void DefaultSoftwareKeyboardApplet::SendTextCheckDialog(std::u16string error_message) const {
diff --git a/src/core/frontend/applets/software_keyboard.h b/src/core/frontend/applets/software_keyboard.h
index 0a82aac0d..7387ee8d7 100644
--- a/src/core/frontend/applets/software_keyboard.h
+++ b/src/core/frontend/applets/software_keyboard.h
@@ -4,6 +4,7 @@
#pragma once
+#include <optional>
#include <string>
#include "common/bit_field.h"
#include "common/common_types.h"
@@ -35,13 +36,13 @@ class SoftwareKeyboardApplet {
public:
virtual ~SoftwareKeyboardApplet();
- virtual bool GetText(SoftwareKeyboardParameters parameters, std::u16string& text) const = 0;
+ virtual std::optional<std::u16string> GetText(SoftwareKeyboardParameters parameters) const = 0;
virtual void SendTextCheckDialog(std::u16string error_message) const = 0;
};
class DefaultSoftwareKeyboardApplet final : public SoftwareKeyboardApplet {
public:
- bool GetText(SoftwareKeyboardParameters parameters, std::u16string& text) const override;
+ std::optional<std::u16string> GetText(SoftwareKeyboardParameters parameters) const override;
void SendTextCheckDialog(std::u16string error_message) const override;
};