FolksAvatarCache

FolksAvatarCache — A singleton persistent cache for avatars in folks.

Types and Values

Description

Avatars may be added to the cache, and referred to by a persistent URI from that point onwards. The avatars will be stored on disk in the user's XDG cache directory.

The avatar cache is typically used by backends where retrieving avatars is an expensive operation (for example, they have to be downloaded from the network every time they're used).

All avatars from all users of the FolksAvatarCache are stored in the same namespace, so callers must ensure that the IDs they use for avatars are globally unique (e.g. by using the corresponding "uid").

Ongoing store operations (folks_avatar_cache_store_avatar()) are rate limited to try and prevent file descriptor exhaustion. Load operations (folks_avatar_cache_load_avatar()) must be rate limited by the client, as the file I/O occurs when calling g_loadable_icon_load() rather than when retrieving the GLoadableIcon from the cache.

Functions

Types and Values

FOLKS_TYPE_AVATAR_CACHE

#define FOLKS_TYPE_AVATAR_CACHE (folks_avatar_cache_get_type ())

The type for FolksAvatarCache.


struct FolksAvatarCache

struct FolksAvatarCache {
	GObject parent_instance;
	FolksAvatarCachePrivate * priv;
};

A singleton persistent cache for avatars in folks.

Avatars may be added to the cache, and referred to by a persistent URI from that point onwards. The avatars will be stored on disk in the user's XDG cache directory.

The avatar cache is typically used by backends where retrieving avatars is an expensive operation (for example, they have to be downloaded from the network every time they're used).

All avatars from all users of the FolksAvatarCache are stored in the same namespace, so callers must ensure that the IDs they use for avatars are globally unique (e.g. by using the corresponding "uid").

Ongoing store operations (folks_avatar_cache_store_avatar()) are rate limited to try and prevent file descriptor exhaustion. Load operations (folks_avatar_cache_load_avatar()) must be rate limited by the client, as the file I/O occurs when calling g_loadable_icon_load() rather than when retrieving the GLoadableIcon from the cache.

Since: 0.6.0


struct FolksAvatarCacheClass

struct FolksAvatarCacheClass {
	GObjectClass parent_class;
};

The class structure for FOLKS_TYPE_AVATAR_CACHE. All the fields in this structure are private and should never be accessed directly.

Members