[glib: 1/2] gdesktopappinfo: Note that search results are not filtered



commit 5314a20389ddf68a81160bb95b6ae8564aef0860
Author: Philip Withnall <withnall endlessm com>
Date:   Tue Apr 21 14:08:38 2020 +0100

    gdesktopappinfo: Note that search results are not filtered
    
    Mention in the documentation that (presumably for performance reasons)
    the search results from `g_desktop_app_info_search()` are not filtered
    by executable presence or hidden attribute.
    
    Perhaps they should be in future, but for now we should at least
    document it.
    
    Spotted by Will Thompson.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 gio/gdesktopappinfo.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c
index ffd2ca317..ab3a2bb5e 100644
--- a/gio/gdesktopappinfo.c
+++ b/gio/gdesktopappinfo.c
@@ -4478,6 +4478,13 @@ g_desktop_app_info_get_implementations (const gchar *interface)
  * The algorithm for determining matches is undefined and may change at
  * any time.
  *
+ * None of the search results are subjected to the normal validation
+ * checks performed by g_desktop_app_info_new() (for example, checking that
+ * the executable referenced by a result exists), and so it is possible for
+ * g_desktop_app_info_new() to return %NULL when passed an app ID returned by
+ * this function. It is expected that calling code will do this when
+ * subsequently creating a #GDesktopAppInfo for each result.
+ *
  * Returns: (array zero-terminated=1) (element-type GStrv) (transfer full): a
  *   list of strvs.  Free each item with g_strfreev() and free the outer
  *   list with g_free().


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]