diff options
| author | 2023-07-04 16:48:48 -0400 | |
|---|---|---|
| committer | 2023-07-21 10:56:55 -0400 | |
| commit | ff6a5031d5ea509375a5dc1ee7b9eeddda6d9ebc (patch) | |
| tree | 3112cd88285713a2b6a56e21c1502ae54f1ae847 | |
| parent | shared_translation: Add missing time zones (diff) | |
| download | yuzu-ff6a5031d5ea509375a5dc1ee7b9eeddda6d9ebc.tar.gz yuzu-ff6a5031d5ea509375a5dc1ee7b9eeddda6d9ebc.tar.xz yuzu-ff6a5031d5ea509375a5dc1ee7b9eeddda6d9ebc.zip | |
settings: Require time zone setting value for stirng
| -rw-r--r-- | src/common/settings.cpp | 4 | ||||
| -rw-r--r-- | src/common/settings.h | 2 | ||||
| -rw-r--r-- | src/core/hle/service/time/time_zone_content_manager.cpp | 3 | ||||
| -rw-r--r-- | src/yuzu/configuration/shared_translation.cpp | 3 |
4 files changed, 7 insertions, 5 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index d9948dde8..78fa99113 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -66,8 +66,8 @@ SWITCHABLE(u8, true); | |||
| 66 | 66 | ||
| 67 | Values values; | 67 | Values values; |
| 68 | 68 | ||
| 69 | std::string GetTimeZoneString() { | 69 | std::string GetTimeZoneString(TimeZone time_zone) { |
| 70 | const auto time_zone_index = static_cast<std::size_t>(values.time_zone_index.GetValue()); | 70 | const auto time_zone_index = static_cast<std::size_t>(time_zone); |
| 71 | ASSERT(time_zone_index < Common::TimeZone::GetTimeZoneStrings().size()); | 71 | ASSERT(time_zone_index < Common::TimeZone::GetTimeZoneStrings().size()); |
| 72 | 72 | ||
| 73 | std::string location_name; | 73 | std::string location_name; |
diff --git a/src/common/settings.h b/src/common/settings.h index c4339cb1f..928636c72 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -516,7 +516,7 @@ bool IsFastmemEnabled(); | |||
| 516 | 516 | ||
| 517 | float Volume(); | 517 | float Volume(); |
| 518 | 518 | ||
| 519 | std::string GetTimeZoneString(); | 519 | std::string GetTimeZoneString(TimeZone time_zone); |
| 520 | 520 | ||
| 521 | void LogSettings(); | 521 | void LogSettings(); |
| 522 | 522 | ||
diff --git a/src/core/hle/service/time/time_zone_content_manager.cpp b/src/core/hle/service/time/time_zone_content_manager.cpp index 5d60be67a..565f6b39b 100644 --- a/src/core/hle/service/time/time_zone_content_manager.cpp +++ b/src/core/hle/service/time/time_zone_content_manager.cpp | |||
| @@ -76,7 +76,8 @@ TimeZoneContentManager::TimeZoneContentManager(Core::System& system_) | |||
| 76 | : system{system_}, location_name_cache{BuildLocationNameCache(system)} {} | 76 | : system{system_}, location_name_cache{BuildLocationNameCache(system)} {} |
| 77 | 77 | ||
| 78 | void TimeZoneContentManager::Initialize(TimeManager& time_manager) { | 78 | void TimeZoneContentManager::Initialize(TimeManager& time_manager) { |
| 79 | const auto timezone_setting = Settings::GetTimeZoneString(); | 79 | const auto timezone_setting = |
| 80 | Settings::GetTimeZoneString(Settings::values.time_zone_index.GetValue()); | ||
| 80 | 81 | ||
| 81 | if (FileSys::VirtualFile vfs_file; | 82 | if (FileSys::VirtualFile vfs_file; |
| 82 | GetTimeZoneInfoFile(timezone_setting, vfs_file) == ResultSuccess) { | 83 | GetTimeZoneInfoFile(timezone_setting, vfs_file) == ResultSuccess) { |
diff --git a/src/yuzu/configuration/shared_translation.cpp b/src/yuzu/configuration/shared_translation.cpp index 05cc942de..fadc8034e 100644 --- a/src/yuzu/configuration/shared_translation.cpp +++ b/src/yuzu/configuration/shared_translation.cpp | |||
| @@ -318,7 +318,8 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QWidget* parent) { | |||
| 318 | { | 318 | { |
| 319 | {static_cast<u32>(Settings::TimeZone::Auto), | 319 | {static_cast<u32>(Settings::TimeZone::Auto), |
| 320 | tr("Auto (%1)", "Auto select time zone") | 320 | tr("Auto (%1)", "Auto select time zone") |
| 321 | .arg(QString::fromStdString(Settings::GetTimeZoneString()))}, | 321 | .arg(QString::fromStdString( |
| 322 | Settings::GetTimeZoneString(Settings::TimeZone::Auto)))}, | ||
| 322 | {static_cast<u32>(Settings::TimeZone::Default), | 323 | {static_cast<u32>(Settings::TimeZone::Default), |
| 323 | tr("Default (%1)", "Default time zone") | 324 | tr("Default (%1)", "Default time zone") |
| 324 | .arg(QString::fromStdString(Common::TimeZone::GetDefaultTimeZone()))}, | 325 | .arg(QString::fromStdString(Common::TimeZone::GetDefaultTimeZone()))}, |