From dd00ea4439590235a4f085695c81a7f2dd7cf9d2 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Tue, 24 Dec 2024 13:44:09 -0600 Subject: [PATCH] refactor --- repertory/librepertory/include/events/events.hpp | 6 ------ repertory/librepertory/include/file_manager/events.hpp | 6 ++++++ repertory/librepertory/src/file_manager/open_file.cpp | 3 +-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/repertory/librepertory/include/events/events.hpp b/repertory/librepertory/include/events/events.hpp index e8042a57..de5b5596 100644 --- a/repertory/librepertory/include/events/events.hpp +++ b/repertory/librepertory/include/events/events.hpp @@ -74,12 +74,6 @@ E_SIMPLE1(drive_unmounted, info, true, std::string, location, loc, E_FROM_STRING ); -E_SIMPLE3(download_type_selected, info, true, - std::string, api_path, ap, E_FROM_STRING, - std::string, source, src, E_FROM_STRING, - download_type, download_type, type, E_FROM_DOWNLOAD_TYPE -); - E_SIMPLE1(event_level_changed, info, true, std::string, new_event_level, level, E_FROM_STRING ); diff --git a/repertory/librepertory/include/file_manager/events.hpp b/repertory/librepertory/include/file_manager/events.hpp index 9d644b4c..2e02be2c 100644 --- a/repertory/librepertory/include/file_manager/events.hpp +++ b/repertory/librepertory/include/file_manager/events.hpp @@ -91,6 +91,12 @@ E_SIMPLE2(download_resume_removed, debug, true, E_SIMPLE1(item_timeout, trace, true, std::string, api_path, ap, E_FROM_STRING ); + +E_SIMPLE3(download_type_selected, info, true, + std::string, api_path, ap, E_FROM_STRING, + std::string, source, src, E_FROM_STRING, + download_type, download_type, type, E_FROM_DOWNLOAD_TYPE +); // clang-format on } // namespace repertory diff --git a/repertory/librepertory/src/file_manager/open_file.cpp b/repertory/librepertory/src/file_manager/open_file.cpp index df67b025..ab1b4160 100644 --- a/repertory/librepertory/src/file_manager/open_file.cpp +++ b/repertory/librepertory/src/file_manager/open_file.cpp @@ -171,9 +171,8 @@ auto open_file::close() -> bool { } auto file = utils::file::file{fsi_.source_path}; - auto file_size = file.size().value_or(0U); if (file.remove()) { - auto res = cache_size_mgr::instance().shrink(file_size); + auto res = cache_size_mgr::instance().shrink(fsi_.size); if (res != api_error::success) { utils::error::raise_api_path_error(function_name, fsi_.api_path, fsi_.source_path, res,