gnome-shell/src/shell-app-cache-private.h
Christian Hergert f8db5aa106 app-cache: add ShellAppCache for GAppInfo caching
This caches GAppInfo so that the compositor thread does not have to perform
costly disk access to load them. Instead, they are loaded from a worker
thread and the ShellAppCache notifies of changes.

To simplify maintenance, ShellAppCache manages this directly and the
existing ShellAppSystem wraps the cache. We may want to graft these
together in the future, but now it provides the easiest way to backport
changes to older Shell releases.

Another source of compositor thread disk access was in determining the
name for an application directory. Translations are provided via GKeyFile
installed in "desktop-directories". Each time we would build the name
for a label (or update it) we would have to load all of these files.

Instead, the ShellAppCache caches that information and updates the cache
in bulk when those change. We can reduce this in the future to do less
work, but chances are these will come together anyway so that is probably
worth fixing if we ever come across it.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2282
2020-03-11 18:06:15 -07:00

20 lines
806 B
C

/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
#ifndef __SHELL_APP_CACHE_PRIVATE_H__
#define __SHELL_APP_CACHE_PRIVATE_H__
#include <gio/gio.h>
#include <gio/gdesktopappinfo.h>
#define SHELL_TYPE_APP_CACHE (shell_app_cache_get_type())
G_DECLARE_FINAL_TYPE (ShellAppCache, shell_app_cache, SHELL, APP_CACHE, GObject)
ShellAppCache *shell_app_cache_get_default (void);
GList *shell_app_cache_get_all (ShellAppCache *cache);
GDesktopAppInfo *shell_app_cache_get_info (ShellAppCache *cache,
const char *id);
char *shell_app_cache_translate_folder (ShellAppCache *cache,
const char *name);
#endif /* __SHELL_APP_CACHE_PRIVATE_H__ */