From 25cc162a2fd6fb65f3998028219b8030a1609484 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Thu, 21 Nov 2024 17:13:20 +0100 Subject: [PATCH] fix build with boost 1.87 --- libgnucash/app-utils/gnc-quotes.cpp | 2 +- libgnucash/core-utils/gnc-filepath-utils.cpp | 24 ++++---------------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/libgnucash/app-utils/gnc-quotes.cpp b/libgnucash/app-utils/gnc-quotes.cpp index 67258aaf5b8..1fdf64a385c 100644 --- a/libgnucash/app-utils/gnc-quotes.cpp +++ b/libgnucash/app-utils/gnc-quotes.cpp @@ -205,7 +205,7 @@ GncFQQuoteSource::run_cmd (const StrVec& args, const std::string& json_string) c try { std::future > out_buf, err_buf; - boost::asio::io_service svc; + boost::asio::io_context svc; auto input_buf = bp::buffer (json_string); bp::child process; diff --git a/libgnucash/core-utils/gnc-filepath-utils.cpp b/libgnucash/core-utils/gnc-filepath-utils.cpp index ede4b9d3d10..4fb6c97c466 100644 --- a/libgnucash/core-utils/gnc-filepath-utils.cpp +++ b/libgnucash/core-utils/gnc-filepath-utils.cpp @@ -64,6 +64,7 @@ #endif #include "gnc-locale-utils.hpp" +#include #include #include #include @@ -444,26 +445,11 @@ copy_recursive(const bfs::path& src, const bfs::path& dest) auto old_len = old_str.size(); try { - /* Note: the for(auto elem : iterator) construct fails - * on travis (g++ 4.8.x, boost 1.54) so I'm using - * a traditional for loop here */ - for(auto direntry = bfs::recursive_directory_iterator(src); - direntry != bfs::recursive_directory_iterator(); ++direntry) - { -#ifdef G_OS_WIN32 - string cur_str = direntry->path().wstring(); -#else - string cur_str = direntry->path().string(); -#endif - auto cur_len = cur_str.size(); - string rel_str(cur_str, old_len, cur_len - old_len); - bfs::path relpath(rel_str, cvt); - auto newpath = bfs::absolute (relpath.relative_path(), dest); - newpath.imbue(bfs_locale); - bfs::copy(direntry->path(), newpath); - } + std::filesystem::copy (std::filesystem::path(old_str), + std::filesystem::path(dest.string()), + std::filesystem::copy_options::recursive); } - catch(const bfs::filesystem_error& ex) + catch(const std::filesystem::filesystem_error& ex) { g_warning("An error occurred while trying to migrate the user configation from\n%s to\n%s" "(Error: %s)",