diff --git a/glib2-fix-default-mime-handler.patch b/glib2-fix-default-mime-handler.patch new file mode 100644 index 0000000..222c38b --- /dev/null +++ b/glib2-fix-default-mime-handler.patch @@ -0,0 +1,45 @@ +commit 862c5a86d7ac24e1607749fe7c3ce772727c2691 +Author: Vincent Untz +Date: Sun Feb 20 10:41:17 2011 +0100 + + appinfo: Do not override system default handler with less specific one + + We were considering explicitly configured defaults for parent types + after we already got results for the specific type we're interested in. + + This resulted in the explicit default for text/plain to override all + system defaults for subtypes of text/plain, for example. The explicit + default should not apply to subtypes that have a system default. + + https://bugzilla.gnome.org/show_bug.cgi?id=642797 + +diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c +index 61ef54c..f81d3db 100644 +--- a/gio/gdesktopappinfo.c ++++ b/gio/gdesktopappinfo.c +@@ -3059,14 +3059,18 @@ get_all_desktop_entries_for_mime_type (const char *base_mime_type, + { + dir = dir_list->data; + +- /* Pick the explicit default application */ +- entry = g_hash_table_lookup (dir->mimeapps_list_defaults_map, mime_type); +- +- if (entry != NULL) ++ /* Pick the explicit default application if we got no result earlier ++ * (ie, for more specific mime types) */ ++ if (desktop_entries == NULL) + { +- /* Save the default entry if it's the first one we encounter */ +- if (default_entry == NULL) +- default_entry = g_strdup (entry); ++ entry = g_hash_table_lookup (dir->mimeapps_list_defaults_map, mime_type); ++ ++ if (entry != NULL) ++ { ++ /* Save the default entry if it's the first one we encounter */ ++ if (default_entry == NULL) ++ default_entry = g_strdup (entry); ++ } + } + + /* Then added associations from mimeapps.list */ diff --git a/glib2.changes b/glib2.changes index fa80502..ab9575f 100644 --- a/glib2.changes +++ b/glib2.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Sun Feb 20 10:38:00 CET 2011 - vuntz@opensuse.org + +- Add glib2-fix-default-mime-handler.patch: this fixes an issue + where a user has configured a handler for a relatively generic + mime type, that breaks the default mime handler for subtypes. For + example, if gvim is explicitly configured to open text/plain, + then LibreOffice documents will also open in gvim. + ------------------------------------------------------------------- Sun Feb 13 14:11:08 CET 2011 - vuntz@opensuse.org diff --git a/glib2.spec b/glib2.spec index a877faa..fcc0a98 100644 --- a/glib2.spec +++ b/glib2.spec @@ -50,6 +50,8 @@ Patch10: glib2-bgo569829-gettext-gkeyfile.patch Patch11: glib2-fate300461-gettext-gkeyfile-suse.patch # PATCH-FIX-UPSTREAM glib2-force-fam-for-remote-fs.patch bgo#592211 hpj@novell.com -- Try monitoring files on NFS mounts via FAM before falling back to inotify. Patch12: glib2-force-fam-for-remote-fs.patch +# PATCH-FIX-UPSTREAM glib2-fix-default-mime-handler.patch bgo#642797 vuntz@opensuse.org -- Fix default mime handler to not be the one of a user-configured less-specific mime type +Patch13: glib2-fix-default-mime-handler.patch BuildRequires: fam-devel BuildRequires: fdupes BuildRequires: gcc-c++ @@ -256,6 +258,7 @@ translation-update-upstream %patch10 -p1 %patch11 -p1 %patch12 -p1 +%patch13 -p1 cp -a %{S:1} %{S:2} %{S:3} . cp -a %{S:4} gnome_defaults.conf if ! test -f %{_datadir}/aclocal/gtk-doc.m4 ; then