diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/time/time_manager.cpp | 17 | ||||
| -rw-r--r-- | src/core/hle/service/time/time_manager.h | 2 | ||||
| -rw-r--r-- | src/core/hle/service/time/time_zone_content_manager.cpp | 17 |
3 files changed, 3 insertions, 33 deletions
diff --git a/src/core/hle/service/time/time_manager.cpp b/src/core/hle/service/time/time_manager.cpp index d5c9e6b5e..20012afd9 100644 --- a/src/core/hle/service/time/time_manager.cpp +++ b/src/core/hle/service/time/time_manager.cpp | |||
| @@ -119,14 +119,6 @@ struct TimeManager::Impl final { | |||
| 119 | time_zone_content_manager.GetTimeZoneManager().MarkAsInitialized(); | 119 | time_zone_content_manager.GetTimeZoneManager().MarkAsInitialized(); |
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | static s64 GetExternalTimeZoneOffset() { | ||
| 123 | // With "auto" timezone setting, we use the external system's timezone offset | ||
| 124 | if (Settings::GetTimeZoneString() == "auto") { | ||
| 125 | return Common::TimeZone::GetCurrentOffsetSeconds().count(); | ||
| 126 | } | ||
| 127 | return 0; | ||
| 128 | } | ||
| 129 | |||
| 130 | void SetupStandardSteadyClock(Core::System& system_, Common::UUID clock_source_id, | 122 | void SetupStandardSteadyClock(Core::System& system_, Common::UUID clock_source_id, |
| 131 | Clock::TimeSpanType setup_value, | 123 | Clock::TimeSpanType setup_value, |
| 132 | Clock::TimeSpanType internal_offset, bool is_rtc_reset_detected) { | 124 | Clock::TimeSpanType internal_offset, bool is_rtc_reset_detected) { |
| @@ -297,13 +289,4 @@ void TimeManager::SetupTimeZoneManager(std::string location_name, | |||
| 297 | impl->SetupTimeZoneManager(location_name, time_zone_updated_time_point, | 289 | impl->SetupTimeZoneManager(location_name, time_zone_updated_time_point, |
| 298 | total_location_name_count, time_zone_rule_version, vfs_file); | 290 | total_location_name_count, time_zone_rule_version, vfs_file); |
| 299 | } | 291 | } |
| 300 | |||
| 301 | /*static*/ s64 TimeManager::GetExternalTimeZoneOffset() { | ||
| 302 | // With "auto" timezone setting, we use the external system's timezone offset | ||
| 303 | if (Settings::GetTimeZoneString() == "auto") { | ||
| 304 | return Common::TimeZone::GetCurrentOffsetSeconds().count(); | ||
| 305 | } | ||
| 306 | return 0; | ||
| 307 | } | ||
| 308 | |||
| 309 | } // namespace Service::Time | 292 | } // namespace Service::Time |
diff --git a/src/core/hle/service/time/time_manager.h b/src/core/hle/service/time/time_manager.h index 4f046f266..3848da8bc 100644 --- a/src/core/hle/service/time/time_manager.h +++ b/src/core/hle/service/time/time_manager.h | |||
| @@ -64,8 +64,6 @@ public: | |||
| 64 | std::size_t total_location_name_count, u128 time_zone_rule_version, | 64 | std::size_t total_location_name_count, u128 time_zone_rule_version, |
| 65 | FileSys::VirtualFile& vfs_file); | 65 | FileSys::VirtualFile& vfs_file); |
| 66 | 66 | ||
| 67 | static s64 GetExternalTimeZoneOffset(); | ||
| 68 | |||
| 69 | private: | 67 | private: |
| 70 | Core::System& system; | 68 | Core::System& system; |
| 71 | 69 | ||
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 ae41116b6..5fab7fa7b 100644 --- a/src/core/hle/service/time/time_zone_content_manager.cpp +++ b/src/core/hle/service/time/time_zone_content_manager.cpp | |||
| @@ -76,25 +76,14 @@ 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 | std::string location_name; | ||
| 80 | const auto timezone_setting = Settings::GetTimeZoneString(); | 79 | const auto timezone_setting = Settings::GetTimeZoneString(); |
| 81 | if (timezone_setting == "auto") { | ||
| 82 | const struct std::chrono::tzdb& time_zone_data = std::chrono::get_tzdb(); | ||
| 83 | const std::chrono::time_zone* current_zone = time_zone_data.current_zone(); | ||
| 84 | std::string_view current_zone_name = current_zone->name(); | ||
| 85 | location_name = current_zone_name; | ||
| 86 | } else if (timezone_setting == "default") { | ||
| 87 | location_name = Common::TimeZone::GetDefaultTimeZone(); | ||
| 88 | } else { | ||
| 89 | location_name = timezone_setting; | ||
| 90 | } | ||
| 91 | 80 | ||
| 92 | if (FileSys::VirtualFile vfs_file; | 81 | if (FileSys::VirtualFile vfs_file; |
| 93 | GetTimeZoneInfoFile(location_name, vfs_file) == ResultSuccess) { | 82 | GetTimeZoneInfoFile(timezone_setting, vfs_file) == ResultSuccess) { |
| 94 | const auto time_point{ | 83 | const auto time_point{ |
| 95 | time_manager.GetStandardSteadyClockCore().GetCurrentTimePoint(system)}; | 84 | time_manager.GetStandardSteadyClockCore().GetCurrentTimePoint(system)}; |
| 96 | time_manager.SetupTimeZoneManager(location_name, time_point, location_name_cache.size(), {}, | 85 | time_manager.SetupTimeZoneManager(timezone_setting, time_point, location_name_cache.size(), |
| 97 | vfs_file); | 86 | {}, vfs_file); |
| 98 | } else { | 87 | } else { |
| 99 | time_zone_manager.MarkAsInitialized(); | 88 | time_zone_manager.MarkAsInitialized(); |
| 100 | } | 89 | } |