gdesktopappinfo: keep a list of files in the dirs
authorRyan Lortie <desrt@desrt.ca>
Sat, 27 Jul 2013 20:04:56 +0000 (16:04 -0400)
committerRyan Lortie <desrt@desrt.ca>
Wed, 6 Nov 2013 15:56:25 +0000 (10:56 -0500)
commit86ce3bf48e40756a360b13e18493a15d8d1bf5ae
treefe1aa72019d05fd063a6a3e660ffa4c041d6e369
parent27da0799b8a2762e6ae44d0721014eeed8c36489
gdesktopappinfo: keep a list of files in the dirs

In each DesktopFileDir, store a list of desktop files for that
directory.  This speeds up opening desktop files by name because we can
skip statting in directories that we know don't have the file and also
speeds up _get_all() because we can avoid enumeration.

This also improves our support for dealing with names like
'kde4/kate.desktop' (equivalent to kde4-kate.desktop) since we find out
about all of these files are the start and don't need to guess about
which '-' to change to a '/'.  It also means that we can easily deal
with more than one level of such prefixes.

We use a file monitor to watch for changes, invalidating our lists when
we notice them.

https://bugzilla.gnome.org/show_bug.cgi?id=711520
gio/gdesktopappinfo.c