MCPcopy Create free account
hub / github.com/78/tenbox / ComputeCacheStats

Function ComputeCacheStats

src/manager/ui/settings_dialog.cpp:54–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52};
53
54static CacheStats ComputeCacheStats(const std::string& images_dir) {
55 CacheStats stats;
56 if (images_dir.empty()) return stats;
57 std::error_code ec;
58 if (!fs::exists(images_dir, ec) || !fs::is_directory(images_dir, ec))
59 return stats;
60 for (const auto& entry : fs::directory_iterator(images_dir, ec)) {
61 if (!entry.is_directory(ec)) continue;
62 bool has_meta = fs::exists(entry.path() / "image.json", ec);
63 if (!has_meta) continue;
64 ++stats.image_count;
65 for (const auto& f : fs::recursive_directory_iterator(entry, ec)) {
66 if (f.is_regular_file(ec))
67 stats.total_bytes += f.file_size(ec);
68 }
69 }
70 return stats;
71}
72
73static std::string EffectiveImagesDir(ManagerService* mgr) {
74 return settings::EffectiveImageCacheDir(mgr->app_settings(), mgr->data_dir());

Callers 3

UpdateCacheSizeLabelFunction · 0.85
HandleOldCacheFunction · 0.85
SettingsDlgProcFunction · 0.85

Calls 1

pathMethod · 0.45

Tested by

no test coverage detected