Add g_desktop_app_info_search()
authorRyan Lortie <desrt@desrt.ca>
Wed, 6 Nov 2013 03:51:48 +0000 (22:51 -0500)
committerRyan Lortie <desrt@desrt.ca>
Thu, 7 Nov 2013 17:41:27 +0000 (12:41 -0500)
commit3d32d5359aefc0c287265c85278a31c7e2ea9b3d
tree445cd11b78ea77d2c5b32c9c174b94e91817d3b8
parentc45b26d61f6539dbf4e202aded08d9614b441f81
Add g_desktop_app_info_search()

The first time this function is called we load all of the keyfiles in
the directory, ignoring the 'Hidden' ones and build an index out of the
interesting fields using g_str_tokenize_and_fold().

We do prefix matching on the tokens to find relevent desktop files.

Right now this is implemented as a hashtable that we iterate over,
checking prefixes on each token.  This could possibly be sped up by
creating an array, but it's already pretty fast...

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