Skip to content

Commit

Permalink
Hide deprecated libdnf5::base::with_config_file_path into Impl
Browse files Browse the repository at this point in the history
  • Loading branch information
kontura committed Mar 6, 2024
1 parent 09d8881 commit 3ad65a0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
4 changes: 0 additions & 4 deletions include/libdnf5/base/base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<void(const std::string &)> func);

/// @return a reference to configuration
ConfigMain & get_config();
LogRouterWeakPtr get_logger();
Expand Down
2 changes: 1 addition & 1 deletion libdnf5/base/base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void Base::load_config() {
}
}

void Base::with_config_file_path(std::function<void(const std::string &)> func) {
void Base::Impl::with_config_file_path(std::function<void(const std::string &)> 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();
Expand Down
3 changes: 3 additions & 0 deletions libdnf5/base/base_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<void(const std::string &)> func);

private:
friend class Base;
Impl(const libdnf5::BaseWeakPtr & base, std::vector<std::unique_ptr<Logger>> && loggers);
Expand Down
2 changes: 1 addition & 1 deletion libdnf5/repo/repo_sack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<void(const std::string &)>{[this](const std::string & path) { create_repos_from_file(path); }});
}

Expand Down

0 comments on commit 3ad65a0

Please sign in to comment.