mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Use fmt::localtime instead of thread-unsafe std::localtime
fmt::localtime is also less awkward to use compared to std::localtime.
This commit is contained in:
parent
2187f11b08
commit
fd7df2ccae
@ -210,7 +210,7 @@ void StartAudioDump()
|
||||
std::string path_prefix = File::GetUserPath(D_DUMPAUDIO_IDX) + SConfig::GetInstance().GetGameID();
|
||||
|
||||
std::string base_name =
|
||||
fmt::format("{}_{:%Y-%m-%d_%H-%M-%S}", path_prefix, *std::localtime(&start_time));
|
||||
fmt::format("{}_{:%Y-%m-%d_%H-%M-%S}", path_prefix, fmt::localtime(start_time));
|
||||
|
||||
const std::string audio_file_name_dtk = fmt::format("{}_dtkdump.wav", base_name);
|
||||
const std::string audio_file_name_dsp = fmt::format("{}_dspdump.wav", base_name);
|
||||
|
@ -140,6 +140,6 @@ std::string SettingsHandler::GenerateSerialNumber()
|
||||
// Must be 9 characters at most; otherwise the serial number will be rejected by SDK libraries,
|
||||
// as there is a check to ensure the string length is strictly lower than 10.
|
||||
// 3 for %j, 2 for %H, 2 for %M, 2 for %S.
|
||||
return fmt::format("{:%j%H%M%S}", *std::localtime(&t));
|
||||
return fmt::format("{:%j%H%M%S}", fmt::localtime(t));
|
||||
}
|
||||
} // namespace Common
|
||||
|
@ -739,7 +739,7 @@ static std::string GenerateScreenshotName()
|
||||
|
||||
const std::time_t cur_time = std::time(nullptr);
|
||||
const std::string base_name =
|
||||
fmt::format("{}_{:%Y-%m-%d_%H-%M-%S}", path_prefix, *std::localtime(&cur_time));
|
||||
fmt::format("{}_{:%Y-%m-%d_%H-%M-%S}", path_prefix, fmt::localtime(cur_time));
|
||||
|
||||
// First try a filename without any suffixes, if already exists then append increasing numbers
|
||||
std::string name = fmt::format("{}.png", base_name);
|
||||
|
@ -86,7 +86,7 @@ std::string GetDumpPath(const std::string& extension, std::time_t time, u32 inde
|
||||
File::GetUserPath(D_DUMPFRAMES_IDX) + SConfig::GetInstance().GetGameID();
|
||||
|
||||
const std::string base_name =
|
||||
fmt::format("{}_{:%Y-%m-%d_%H-%M-%S}_{}", path_prefix, *std::localtime(&time), index);
|
||||
fmt::format("{}_{:%Y-%m-%d_%H-%M-%S}_{}", path_prefix, fmt::localtime(time), index);
|
||||
|
||||
const std::string path = fmt::format("{}.{}", base_name, extension);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user