diff options
| author | Mikaƫl Capelle <capelle.mikael@gmail.com> | 2024-05-25 13:14:46 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-25 13:14:46 +0200 |
| commit | fa82d1cca1544c401bc06c341ce265a346a498b9 (patch) | |
| tree | e67f24433b315b71729d2e8bea12c72c32244d83 /src/shared | |
| parent | 9ee4c5afe18eb887acf4ea843b56da9a267d34b0 (diff) | |
Switch from fmtlib to std::format. (#2031)
* Switch from fmtlib to std::format.
* Remove libffi from dependencies in Github action.
Diffstat (limited to 'src/shared')
| -rw-r--r-- | src/shared/directoryentry.cpp | 6 | ||||
| -rw-r--r-- | src/shared/fileregister.cpp | 7 | ||||
| -rw-r--r-- | src/shared/originconnection.cpp | 4 |
3 files changed, 8 insertions, 9 deletions
diff --git a/src/shared/directoryentry.cpp b/src/shared/directoryentry.cpp index 84da66e2..5468beea 100644 --- a/src/shared/directoryentry.cpp +++ b/src/shared/directoryentry.cpp @@ -414,7 +414,7 @@ const FileEntryPtr DirectoryEntry::searchFile(const std::wstring& path, if (temp != nullptr) { if (len >= path.size()) { - log::error(QObject::tr("unexpected end of path").toStdString()); + log::error("{}", QObject::tr("unexpected end of path")); return FileEntryPtr(); } @@ -905,7 +905,7 @@ void DirectoryEntry::dump(const std::wstring& file) const auto e = _wfopen_s(&f, file.c_str(), L"wb"); if (e != 0 || !f) { - throw DumpFailed(fmt::format("failed to open, {} ({})", std::strerror(e), e)); + throw DumpFailed(std::format("failed to open, {} ({})", std::strerror(e), e)); } Guard g([&] { @@ -943,7 +943,7 @@ void DirectoryEntry::dump(std::FILE* f, const std::wstring& parentPath) const if (std::fwrite(lineu8.data(), lineu8.size(), 1, f) != 1) { const auto e = errno; - throw DumpFailed(fmt::format("failed to write, {} ({})", std::strerror(e), e)); + throw DumpFailed(std::format("failed to write, {} ({})", std::strerror(e), e)); } } } diff --git a/src/shared/fileregister.cpp b/src/shared/fileregister.cpp index ab94367f..f84d4982 100644 --- a/src/shared/fileregister.cpp +++ b/src/shared/fileregister.cpp @@ -74,7 +74,7 @@ bool FileRegister::removeFile(FileIndex index) } } - log::error(QObject::tr("invalid file index for remove: {}").toStdString(), index); + log::error("{}: {}", QObject::tr("invalid file index for remove"), index); return false; } @@ -95,9 +95,8 @@ void FileRegister::removeOrigin(FileIndex index, OriginID originID) } } - log::error( - QObject::tr("invalid file index for remove (for origin): {}").toStdString(), - index); + log::error("{}: {}", QObject::tr("invalid file index for remove (for origin)"), + index); } void FileRegister::removeOriginMulti(std::set<FileIndex> indices, OriginID originID) diff --git a/src/shared/originconnection.cpp b/src/shared/originconnection.cpp index e433891c..e6ec8ad2 100644 --- a/src/shared/originconnection.cpp +++ b/src/shared/originconnection.cpp @@ -98,8 +98,8 @@ void OriginConnection::changeNameLookup(const std::wstring& oldName, m_OriginsNameMap.erase(iter); m_OriginsNameMap[newName] = idx; } else { - log::error(QObject::tr("failed to change name lookup from {} to {}").toStdString(), - oldName, newName); + log::error(QObject::tr("failed to change name lookup from {0} to {1}"), oldName, + newName); } } |
