From 64575c0e4e127ac04fb37e5e2e775fa544865327 Mon Sep 17 00:00:00 2001 From: Calvin Walton Date: Fri, 28 Apr 2023 15:34:06 -0400 Subject: housekeeping: clean up x-large and xx-large thumbnails Support for two new thumbnails directories named "x-large" and "xx-large" were added to the XDG thumbnail-spec in 2020 and to gnome-desktop in GNOME 40. They started to be used by nautilus in GNOME 43 to have larger/sharper thumbnails on HiDPI screens. But the housekeeper never got updated, so the thumbnail cache has unbounded growth. I realized this problem when I was trying to debug a low disk space condition, and realized that my thumbnail cache was 10GiB in size. Add the new directories. They're only added to the XDG cache path, since any application new enough to generate these thumbnail sizes would be using that path. --- plugins/housekeeping/gsd-housekeeping-manager.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/housekeeping/gsd-housekeeping-manager.c b/plugins/housekeeping/gsd-housekeeping-manager.c index b291667a..be2b3621 100644 --- a/plugins/housekeeping/gsd-housekeeping-manager.c +++ b/plugins/housekeeping/gsd-housekeeping-manager.c @@ -205,6 +205,18 @@ get_thumbnail_dirs (void) NULL); g_ptr_array_add (array, path); + path = g_build_filename (g_get_user_cache_dir (), + "thumbnails", + "x-large", + NULL); + g_ptr_array_add (array, path); + + path = g_build_filename (g_get_user_cache_dir (), + "thumbnails", + "xx-large", + NULL); + g_ptr_array_add (array, path); + path = g_build_filename (g_get_user_cache_dir (), "thumbnails", "fail", -- cgit v1.2.1