summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-05-25 02:56:58 +0200
committerLioncash <mathew1800@gmail.com>2019-05-25 03:27:12 +0200
commitcf9cc4147845810dd2af387e2ef3a8559f832722 (patch)
tree2c34f0ce2777451dd5f2ebaacf615b79a00db68a
parentyuzu/applets/error: Specify string conversions explicitly (diff)
downloadyuzu-cf9cc4147845810dd2af387e2ef3a8559f832722.tar
yuzu-cf9cc4147845810dd2af387e2ef3a8559f832722.tar.gz
yuzu-cf9cc4147845810dd2af387e2ef3a8559f832722.tar.bz2
yuzu-cf9cc4147845810dd2af387e2ef3a8559f832722.tar.lz
yuzu-cf9cc4147845810dd2af387e2ef3a8559f832722.tar.xz
yuzu-cf9cc4147845810dd2af387e2ef3a8559f832722.tar.zst
yuzu-cf9cc4147845810dd2af387e2ef3a8559f832722.zip
-rw-r--r--src/yuzu/applets/error.cpp7
-rw-r--r--src/yuzu/applets/software_keyboard.cpp21
2 files changed, 18 insertions, 10 deletions
diff --git a/src/yuzu/applets/error.cpp b/src/yuzu/applets/error.cpp
index 97435592e..08ed57355 100644
--- a/src/yuzu/applets/error.cpp
+++ b/src/yuzu/applets/error.cpp
@@ -29,12 +29,13 @@ void QtErrorDisplay::ShowError(ResultCode error, std::function<void()> finished)
void QtErrorDisplay::ShowErrorWithTimestamp(ResultCode error, std::chrono::seconds time,
std::function<void()> finished) const {
this->callback = std::move(finished);
+
+ const QDateTime date_time = QDateTime::fromSecsSinceEpoch(time.count());
emit MainWindowDisplayError(
tr("An error occured on %1 at %2.\nPlease try again or contact the "
"developer of the software.\n\nError Code: %3-%4 (0x%5)")
- .arg(QDateTime::fromSecsSinceEpoch(time.count())
- .toString(QStringLiteral("dddd, MMMM d, yyyy")))
- .arg(QDateTime::fromSecsSinceEpoch(time.count()).toString(QStringLiteral("h:mm:ss A")))
+ .arg(date_time.toString(QStringLiteral("dddd, MMMM d, yyyy")))
+ .arg(date_time.toString(QStringLiteral("h:mm:ss A")))
.arg(static_cast<u32>(error.module.Value()) + 2000, 4, 10, QChar::fromLatin1('0'))
.arg(error.description, 4, 10, QChar::fromLatin1('0'))
.arg(error.raw, 8, 16, QChar::fromLatin1('0')));
diff --git a/src/yuzu/applets/software_keyboard.cpp b/src/yuzu/applets/software_keyboard.cpp
index f3eb29b25..4f13e1d75 100644
--- a/src/yuzu/applets/software_keyboard.cpp
+++ b/src/yuzu/applets/software_keyboard.cpp
@@ -18,23 +18,30 @@ QtSoftwareKeyboardValidator::QtSoftwareKeyboardValidator(
: parameters(std::move(parameters)) {}
QValidator::State QtSoftwareKeyboardValidator::validate(QString& input, int& pos) const {
- if (input.size() > parameters.max_length)
+ if (input.size() > parameters.max_length) {
return Invalid;
- if (parameters.disable_space && input.contains(' '))
+ }
+ if (parameters.disable_space && input.contains(QLatin1Char{' '})) {
return Invalid;
- if (parameters.disable_address && input.contains('@'))
+ }
+ if (parameters.disable_address && input.contains(QLatin1Char{'@'})) {
return Invalid;
- if (parameters.disable_percent && input.contains('%'))
+ }
+ if (parameters.disable_percent && input.contains(QLatin1Char{'%'})) {
return Invalid;
- if (parameters.disable_slash && (input.contains('/') || input.contains('\\')))
+ }
+ if (parameters.disable_slash &&
+ (input.contains(QLatin1Char{'/'}) || input.contains(QLatin1Char{'\\'}))) {
return Invalid;
+ }
if (parameters.disable_number &&
std::any_of(input.begin(), input.end(), [](QChar c) { return c.isDigit(); })) {
return Invalid;
}
- if (parameters.disable_download_code &&
- std::any_of(input.begin(), input.end(), [](QChar c) { return c == 'O' || c == 'I'; })) {
+ if (parameters.disable_download_code && std::any_of(input.begin(), input.end(), [](QChar c) {
+ return c == QLatin1Char{'O'} || c == QLatin1Char{'I'};
+ })) {
return Invalid;
}