ALT Linux Bugzilla
– Attachment 14814 Details for
Bug 48040
Не находит desktop-файлы в подкаталогах
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
patch
glib-resolve-desktop-ids.patch (text/plain), 1.87 KB, created by
Олег Соловьев
on 2023-10-18 14:11:24 MSK
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Олег Соловьев
Created:
2023-10-18 14:11:24 MSK
Size:
1.87 KB
patch
obsolete
>commit 2b3bf1edcac75743db0bcc7ed0240371c59f4b50 >Author: Oleg Solovyov <mcpain@altlinux.org> >Date: Wed Oct 18 13:41:42 2023 +0300 > > Include unprefixed desktop-file id along with prefixed one > > If prefix is specified, nothing changes. > > If prefix is not specified and desktop-file does not exist in XDG_DATA_DIR, > use any matching desktop-file from a subdir. > > If desktop-file exists, nothing changes. > >diff --git a/glib/gio/gdesktopappinfo.c b/glib/gio/gdesktopappinfo.c >index 1f161328a..a39e0d2e3 100644 >--- a/glib/gio/gdesktopappinfo.c >+++ b/glib/gio/gdesktopappinfo.c >@@ -758,6 +758,18 @@ merge_directory_results (void) > static_search_results_size = 0; > } > >+static void >+apps_merge (gchar *key, >+ gchar *value, >+ GHashTable *user_data) >+{ >+ if (!g_hash_table_lookup(user_data, key)) >+ { >+ g_hash_table_insert (user_data, key, g_strdup (value)); >+ return; >+ } >+} >+ > /* Support for unindexed DesktopFileDirs {{{2 */ > static void > get_apps_from_dir (GHashTable **apps, >@@ -772,6 +784,8 @@ get_apps_from_dir (GHashTable **apps, > if (dir == NULL) > return; > >+ GHashTable *apps_fake = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); >+ > while ((basename = g_dir_read_name (dir)) != NULL) > { > gchar *filename; >@@ -788,6 +802,8 @@ get_apps_from_dir (GHashTable **apps, > *apps = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); > > g_hash_table_insert (*apps, app_name, g_strdup (filename)); >+ >+ g_hash_table_insert (apps_fake, g_strdup (basename), g_strdup (filename)); > } > else if (g_file_test (filename, G_FILE_TEST_IS_DIR)) > { >@@ -801,6 +817,9 @@ get_apps_from_dir (GHashTable **apps, > g_free (filename); > } > >+ g_hash_table_foreach (apps_fake, (GHFunc) apps_merge, *apps); >+ g_free (apps_fake); >+ > g_dir_close (dir); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 48040
: 14814