desktopappinfo: add Exec to searchable keys

Add the basename from the first component of the Exec line to the list of
strings to search for via g_desktop_app_info_search().

We treat Exec as a fairly strong match -- just below the visible name.

Add a testcase to make sure everything is working OK.

https://bugzilla.gnome.org/show_bug.cgi?id=725023
This commit is contained in:
Ryan Lortie
2014-03-02 09:38:51 -05:00
parent 9ecc859f95
commit 5d5ea495b5
3 changed files with 38 additions and 8 deletions

View File

@@ -654,6 +654,15 @@ test_search (void)
"gnome-clocks.desktop\n"
"yelp.desktop gnome-contacts.desktop\n", TRUE, TRUE, NULL, NULL);
/* eog has exec name 'false' in usr only */
assert_search ("false", "eog.desktop\n", TRUE, FALSE, NULL, NULL);
assert_search ("false", "", FALSE, TRUE, NULL, NULL);
assert_search ("false", "", TRUE, TRUE, NULL, NULL);
assert_search ("false", "", FALSE, FALSE, NULL, NULL);
/* make sure we only search the first component */
assert_search ("nonsearchable", "", TRUE, FALSE, NULL, NULL);
/* "gnome con" will match only gnome contacts; via the name for
* "contacts" and the comment for "gnome"
*/