files
files copied to clipboard
Refresh thumbnail after file change
Fixes #2327 Fixes #2455 (not intentional)
- Handle CHANGES_DONE_HINT events by updating icon
- Ignore duplicate events and events from transient files
- Avoid issues causes by caching of thumbnails internally by only caching remote thumbnails
- Improve performance by avoiding unnecessary icon lookups when scrolling
- Move some cache and thumbnail related code from AbstractDirectoryView to File
- Fix an issue (on OS8) where some standard icons were not displayed on startup.
The issue was fundamentally caused by CHANGES_DONE_HINT events from the directory monitor being ignored. However it was found that just fixing that did not reliably fix the problem - icons did not always update at all sizes. This was found to be due to the way Files caches icons internally. Trying to work round this proved intractable. It was found that dropping caching for local files and themeable icons combined with reducing the number of lookups being performed unnecessarily resulted in no discernible performance hit on modern hardware (i5 processor and SSD storage).
Caching was retained for remote files to maintain performance on slow connections. Remote locations cannot be monitored for changes by the directory monitor so the linked issue will always occur for remote files anyway.
Investigating regression.
@danirabbit Looks like FileAttribute.STANDARD_ICON only returns a standard folder icon for user folders so cannot substitute for that function I am afraid. However, while checking this, I noticed there are some new? attributes related to thumbnail status that might be useful. I guess they might not work for non-native/remote files though unless gvfs generates them locally.
@jeremypw is there any way to break this up into smaller chunks? I'm having trouble following all of the changes here. I'm not really familiar with this code but I know you've been waiting for review here for quite some time.
@danirabbit I'll try!