From 3ad65a0183124d765adca0756f9fcd59865fc067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= Date: Mon, 4 Mar 2024 13:32:03 +0100 Subject: [PATCH] Hide deprecated `libdnf5::base::with_config_file_path` into Impl --- include/libdnf5/base/base.hpp | 4 ---- libdnf5/base/base.cpp | 2 +- libdnf5/base/base_impl.hpp | 3 +++ libdnf5/repo/repo_sack.cpp | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/libdnf5/base/base.hpp b/include/libdnf5/base/base.hpp index 6f6789a0d..e39cf6292 100644 --- a/include/libdnf5/base/base.hpp +++ b/include/libdnf5/base/base.hpp @@ -80,10 +80,6 @@ class Base { /// The file defined in the current configuration and files in the drop-in directories are used. void load_config(); - /// @deprecated Don't use it! It will be removed in Fedora 40. It was intended for internal use only. - /// Call a function that loads the config file, catching errors appropriately - void with_config_file_path(std::function func); - /// @return a reference to configuration ConfigMain & get_config(); LogRouterWeakPtr get_logger(); diff --git a/libdnf5/base/base.cpp b/libdnf5/base/base.cpp index d952f5a50..af786fe4b 100644 --- a/libdnf5/base/base.cpp +++ b/libdnf5/base/base.cpp @@ -110,7 +110,7 @@ void Base::load_config() { } } -void Base::with_config_file_path(std::function func) { +void Base::Impl::with_config_file_path(std::function func) { std::filesystem::path conf_path{config.get_config_file_path_option().get_value()}; const auto & conf_path_priority = config.get_config_file_path_option().get_priority(); const auto & use_host_config = config.get_use_host_config_option().get_value(); diff --git a/libdnf5/base/base_impl.hpp b/libdnf5/base/base_impl.hpp index 94699ed6b..dcd7851f8 100644 --- a/libdnf5/base/base_impl.hpp +++ b/libdnf5/base/base_impl.hpp @@ -56,6 +56,9 @@ class Base::Impl { plugin::Plugins & get_plugins() { return plugins; } + /// Call a function that loads the config file, catching errors appropriately + void with_config_file_path(std::function func); + private: friend class Base; Impl(const libdnf5::BaseWeakPtr & base, std::vector> && loggers); diff --git a/libdnf5/repo/repo_sack.cpp b/libdnf5/repo/repo_sack.cpp index 3f1240936..209a52a12 100644 --- a/libdnf5/repo/repo_sack.cpp +++ b/libdnf5/repo/repo_sack.cpp @@ -588,7 +588,7 @@ void RepoSack::create_repos_from_file(const std::string & path) { } void RepoSack::create_repos_from_config_file() { - p_impl->base->with_config_file_path( + p_impl->base->p_impl->with_config_file_path( std::function{[this](const std::string & path) { create_repos_from_file(path); }}); }