[glib/glib-2-32] Fix default app lookup wrt parent types and defaults.list



commit 8d0f19de81aa125231507cc44597c41a73ab7dd2
Author: Alexander Larsson <alexl redhat com>
Date:   Thu Jun 28 14:50:37 2012 +0200

    Fix default app lookup wrt parent types and defaults.list
    
    There was an issue when looking up the default handler
    for a type where a supertype was listed in defaults.list.
    We would pick the default for the parent type even if
    there was a handler for the more specific type.
    
    In the case of the new-style defaults marking (
    "Default Applications" in mimeapps.list) we were already
    checking for a more specific handler befor using a default,
    but we also need to do a similar check for the defaults.list
    case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=678944

 gio/gdesktopappinfo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c
index 0f1b4ed..708b710 100644
--- a/gio/gdesktopappinfo.c
+++ b/gio/gdesktopappinfo.c
@@ -3310,7 +3310,7 @@ get_all_desktop_entries_for_mime_type (const char  *base_mime_type,
 	  default_entries = g_hash_table_lookup (dir->defaults_list_map, mime_type);
 	  for (j = 0; default_entries != NULL && default_entries[j] != NULL; j++)
             {
-              if (default_entry == NULL && old_default_entry == NULL)
+              if (default_entry == NULL && old_default_entry == NULL && desktop_entries == NULL)
                 old_default_entry = g_strdup (default_entries[j]);
 
               desktop_entries = append_desktop_entry (desktop_entries, default_entries[j], removed_entries);



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