Fix occurrences of wrong encoding handling with `std::filesystem`

This commit is contained in:
Martchus 2022-03-16 19:51:54 +01:00
parent 7ba63ad79f
commit 7f1e234f36
2 changed files with 2 additions and 2 deletions

View File

@ -874,7 +874,7 @@ void setTagInfo(const SetTagInfoArgs &args)
auto modifiedFilePath = std::filesystem::path();
fileInfo.setSaveFilePath(currentOutputFile != noMoreOutputFiles ? string(*currentOutputFile) : string());
if (args.preserveModificationTimeArg.isPresent()) {
modifiedFilePath = fileInfo.saveFilePath().empty() ? fileInfo.path() : fileInfo.saveFilePath();
modifiedFilePath = std::filesystem::u8path(fileInfo.saveFilePath().empty() ? fileInfo.path() : fileInfo.saveFilePath());
modificationDate = std::filesystem::last_write_time(modifiedFilePath, modificationDateError);
}
try {

View File

@ -1187,7 +1187,7 @@ bool TagEditorWidget::startSaving()
auto modificationDate = std::filesystem::file_time_type();
auto modifiedFilePath = std::filesystem::path();
if (preserveModificationTime) {
modifiedFilePath = m_fileInfo.saveFilePath().empty() ? m_fileInfo.path() : m_fileInfo.saveFilePath();
modifiedFilePath = std::filesystem::u8path(m_fileInfo.saveFilePath().empty() ? m_fileInfo.path() : m_fileInfo.saveFilePath());
modificationDate = std::filesystem::last_write_time(modifiedFilePath, modificationDateError);
}
try {