summaryrefslogtreecommitdiff
path: root/tumbler/tumbler-cache.h
Commit message (Collapse)AuthorAgeFilesLines
* Use microsecond precision for last modification timeGaƫl Bonithon2021-12-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the file system allows it, this prevents Tumbler from believing that the original file has not been modified since the last time the thumbnail was created, when in fact modifications have taken place in the second that the thumbnail was created. The time of last modification is stored internally in a `gdouble`, and written to the PNG thumbnail in `%.6f` format. This complies well with the Freedesktop specification [1], as the stat command returns this format when invoked as `stat -c%.6Y file`, although it is likely that the specification was written with the idea that this value be an integer. The extraction of the thumbnail information is done via `g_ascii_strtod()`, so an integer or less precision is not a problem. As for a code expecting to find an integer, it is likely to simply ignore the decimal part, as Tumbler used to do by extracting the information via `atol()`. It is possible, however, that an error will be found if a more complete extractor is used, such as `strtol()`. The changes this causes to the exposed Tumbler APIs should also be inconsequential, as it is a conversion to a higher type. This should therefore result in implicit conversions, except perhaps for `tumbler_file_info_get_mtime()`, if its return value is explicitly stored in a `gint64`. [1] https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html#CREATION Fixes #15, see !20 for more details.
* Get rid of the inherently broken GStrv type in function signatures.Jannis Pohlmann2011-02-131-10/+10
| | | | This breaks the API but it is not finalized anyway yet.
* Make Cleanup() take an array of base URIs instead of just one.Jannis Pohlmann2011-02-131-3/+3
| | | | | | | | | | | The thumbnail management D-Bus specification was updated accordingly. This change makes sense due to the following reason: when trashing a directory we cannot simply call org.freedesktop.thumbnails.Cache1.Delete as this will only remove the thumbnail of the directory itself, not of its descendants. But we can use the Cleanup method for this. With Cleanup taking an array of base URIs instead of just one we can avoid hundreds of Cleanup calls when trashing a large number of files.
* Rename the delete member of TumblerCache to do_delete (for C++).Jannis Pohlmann2009-10-271-1/+1
|
* Massive refactoring to support flavors properly.Jannis Pohlmann2009-10-271-33/+40
| | | | | | | | | | | | | | | | | | | | | Refactor the entire code to use TumblerFileInfo instead of separate URI/MIME/flavor arrays. We now support flavors which means that applications can request "normal" and "large" thumbnails and thus have more control over what is created. This simplifies the code in a lot of places. We now use a real GObject class called TumblerThumbnailFlavor instead of a fixed-size enum. Cache backends can return as many flavors as they want, each consisting of a name, a width and a height. As a consequence, we can also get rid of the configure flags to enable/disable normal, large and cropped thumbnails. The default cache plugin shipped with Tumbler only supports "normal" (128x128px) and "large" (256x256px). Optimize the code a little bit. We now load the TunarFileInfo and ThunarThumbnail only *once* for each URI instead of loading them once in the scheduler and again in thumbnailer plugins. This needs careful testing. I might have introduced a few memory leaks here and there, plus new bugs... you never know.
* Switch to a plugin API that only allows one cache backend at a time.Jannis Pohlmann2009-10-261-16/+18
| | | | | | | | | | | | | Tumbler will now only check for the file $(libdir)/tumbler-1/plugins/cache/tumbler-cache-plugin.so which is supposed to link to the cache backend that is being used. If the XDG cache is built, tumbler-cache-plugin.so is set up to link to this plugin. The fact that we only have a singleton cache makes things much less ambiguous.
* No thumbnails for thumbnails. Allow Unqueue in the middle of requests.Jannis Pohlmann2009-06-121-27/+31
| | | | | | | | | | | There's a new method tumbler_cache_is_thumbnail() now which has to be implemented by plugins. It is used by TumblerFileInfo in tumbler_file_info_load() to check whether the file is a thumbnail itself. In that case, tumbler_file_info_load() will fail with a TUMBLER_ERROR_IS_THUMBNAIL error. Add another check in TumblerThresholdScheduler to make unqueuing requests in the middle of the process work.
* Implement Cleanup, Copy, Move and Delete in cache plugin and service.Jannis Pohlmann2009-06-091-0/+22
|
* Add plugin interface for cache and thumbnailer implementations.Jannis Pohlmann2009-06-081-0/+58
This is a major refactoring of the source code. Amongst others, the classes TumblerProviderFactory, TumblerThumbnailer, TumblerAbstractThumbnailer, TumblerThumbnailerProvider, TumblerCache, TumblerCacheProvider and TumblerFileInfo have been added. From now on tumbler supports different storage backends and thumbnailers as plugins. Storage backends have to implement TumblerCache, thumbnailers have to implement TumblerThumbnailer. Plugins have to implement three methods: tumbler_plugin_initialize(), tumbler_plugin_shutdown() and tumbler_plugin_get_types(). The latter is expected to return a list of provider types for cache or thumbnailer implementations. Two example plugins have been added, one for the XDG thumbnail cache and one for a GdkPixbuf based thumbnailer. The code of tumblerd was updated to reflect these changes in libtumbler.