Skip to content

Optimize resource utilization when looking for thumbnails. Look for GIMP thumbnails in Snap and Flatpack folders as well.

Sundeep Mediratta requested to merge lookup-thumbnails-without-factory into main

Uses only one GnomeDesktopIconFactory for large icons to look for and thumbnail icons in the large folder.

If none are found and they cannot be thumbnailed to large icons, then look in other folders-

It seems only GIMP icons cannot be thumbnailed for now, it seems to be the only one that stores in normal folder for now, so restrict to GIMP files.

Optimize for GIMP files, if not found in normal folder, look in snap and flatpack thumbnail folders of GIMP.

It is trivial now to look for icons in other folders, as there is new code to look for thumbnails, and we are not dependent on GnomeDesktopIconFactory.

From earlier email-

With this current implementation, we are looking in the normal subfolder of thumbnails folder for each icon on the desktop. We have to initialize a new DesktopIconFactory to do this.

This is inefficient use of resources, at least on my desktop, as from what I can see, only GIMP is storing thumbnails in that folder. Multiply that by the number of users and the number of icons each user has..

The more efficient way would be to look specifically in that folder for only gimp files, ie base our decision on attributeContentType.

We don't have to initialize another iconFactory, we can search efficiently by local methods using md5hash. We have only one iconFactory for regular use.

The benefit of doing this is that then it is trivial to look in snap/flatpack thumbnails folder for Gimp thumbnails.. and we only spend compute cycles if we have to...

Merge request reports