diff options
author | Ava Chow <github@achow101.com> | 2023-12-14 16:36:32 -0500 |
---|---|---|
committer | Ava Chow <github@achow101.com> | 2023-12-14 16:46:54 -0500 |
commit | 1b2dedbf5c4520774df020d06d848f29e3439b52 (patch) | |
tree | aa85ab412166217440677efbd9bca33c3640f7ec /src/qt | |
parent | 08e6aaabef6c569ba634c86d396f0a840002a8d2 (diff) | |
parent | 66667130416b86208e01a0eb5541a15ea805ac26 (diff) |
Merge bitcoin/bitcoin#29040: refactor: Remove pre-C++20 code, fs::path cleanup
66667130416b86208e01a0eb5541a15ea805ac26 refactor: Rename fs::path::u8string() to fs::path::utf8string() (MarcoFalke)
856c88776f8486446602476a1c9e133ac0cff510 ArgsManager: return path by value from GetBlocksDirPath() (Vasil Dimov)
fa3d9304e80c214c8b073f12a7f4b08c5a94af04 refactor: Remove pre-C++20 fs code (MarcoFalke)
fa00098e1a493aa3cce20335d18e7f5f2fb7a4a8 Add tests for C++20 std::u8string (MarcoFalke)
fa2bac08c22182e738a8cabf1b24a9dbf3b092d2 refactor: Avoid copy/move in fs.h (MarcoFalke)
faea30227ba633da5ab257d0247853e0927244bb refactor: Use C++20 std::chrono::days (MarcoFalke)
Pull request description:
This:
* Removes dead code.
* Avoids unused copies in some places.
* Adds copies in other places for safety.
ACKs for top commit:
achow101:
ACK 66667130416b86208e01a0eb5541a15ea805ac26
ryanofsky:
Code review ACK 66667130416b86208e01a0eb5541a15ea805ac26. Just documentation change since last review.
stickies-v:
re-ACK 66667130416b86208e01a0eb5541a15ea805ac26
Tree-SHA512: 6176e44f30b310d51632ec2d3827c3819905d0ddc6a4b57acfcb6cfa1f9735176da75ee8ed4a4abd1296cb0b83bee9374cc6f91ffac87c19b63c435eeadf3f46
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/guiutil.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index eb9c65caf2..ebfd14cc25 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -669,7 +669,7 @@ fs::path QStringToPath(const QString &path) QString PathToQString(const fs::path &path) { - return QString::fromStdString(path.u8string()); + return QString::fromStdString(path.utf8string()); } QString NetworkToQString(Network net) @@ -723,8 +723,7 @@ QString ConnectionTypeToQString(ConnectionType conn_type, bool prepend_direction QString formatDurationStr(std::chrono::seconds dur) { - using days = std::chrono::duration<int, std::ratio<86400>>; // can remove this line after C++20 - const auto d{std::chrono::duration_cast<days>(dur)}; + const auto d{std::chrono::duration_cast<std::chrono::days>(dur)}; const auto h{std::chrono::duration_cast<std::chrono::hours>(dur - d)}; const auto m{std::chrono::duration_cast<std::chrono::minutes>(dur - d - h)}; const auto s{std::chrono::duration_cast<std::chrono::seconds>(dur - d - h - m)}; |