libfm
libfm copied to clipboard
Copy, move and delete thumbnails
When files are copied, moved or deleted, their thumbnails are re-generated from scratch (which can be CPU- or disk-intensive) and/or left behind without being useful anymore (taking up disk space). This PR applies the copy/move/delete operations to thumbnails as well (if they exist), solving these problems.
I applied the suggestion, except for allocating paths in get_thumbnail_paths(). The reason is that I also modified load_thumbnail_thread() to use get_thumbnail_paths() (for consistency and avoiding repetition). In load_thumbnail_thread(), paths are allocated only once and reused many times – presumably to avoid multiple allocations – so I did something similar with my code.
This may create issues due to multithreading. Let me think about this optimization for release 1.4.0.