mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
AppInfo: use XDG_CURRENT_DESKTOP for OnlyShowIn
Expand the functionality of g_desktop_app_info_set_desktop_env() to include the possibility of passing strings containing ':' characters (as some apps, such as gnome-session, are directly passing the value of XDG_CURRENT_DESKTOP). At the same time, deprecate it, since now we get the list from the environment variable for ourselves. Modify the checks in g_desktop_app_info_get_show_in() to deal with multiple items listed in XDG_CURRENT_DESKTOP. For example, if we find that we have XDG_CURRENT_DESKTOP=GNOME-Classic:GNOME and a desktop file contains: OnlyShowIn=GNOME then we will show this file because of the fallback to GNOME. If the file _also_ contains the line: NotShowIn=GNOME-Classic Then we will not show it, because GNOME-Classic comes before GNOME in XDG_CURRENT_DESKTOP. https://bugzilla.gnome.org/show_bug.cgi?id=729813
This commit is contained in:
@@ -71,7 +71,7 @@ GDesktopAppInfo *g_desktop_app_info_new (const char *desktop_
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
gboolean g_desktop_app_info_get_is_hidden (GDesktopAppInfo *info);
|
||||
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
GLIB_DEPRECATED_IN_2_42
|
||||
void g_desktop_app_info_set_desktop_env (const char *desktop_env);
|
||||
|
||||
GLIB_AVAILABLE_IN_2_36
|
||||
|
Reference in New Issue
Block a user