[Thunar] Add patch for glib2 open with ordering. Fixes bug #1175867

Kevin Fenzi kevin at fedoraproject.org
Sun Dec 21 21:50:00 UTC 2014


commit ae4c1a6928613c3f09c03b0fbea9bfbe8d58e437
Author: Kevin Fenzi <kevin at scrye.com>
Date:   Sun Dec 21 14:49:52 2014 -0700

    Add patch for glib2 open with ordering. Fixes bug #1175867

 Thunar-1.6.2-glib2-open-with-order.patch |   52 ++++++++++++++++++++++++++++++
 Thunar.spec                              |   10 +++++-
 2 files changed, 61 insertions(+), 1 deletions(-)
---
diff --git a/Thunar-1.6.2-glib2-open-with-order.patch b/Thunar-1.6.2-glib2-open-with-order.patch
new file mode 100644
index 0000000..5e1d85e
--- /dev/null
+++ b/Thunar-1.6.2-glib2-open-with-order.patch
@@ -0,0 +1,52 @@
+From 4b142af9dfe19f90ffe5529e2f099dc55298ecef Mon Sep 17 00:00:00 2001
+From: Guido Berhoerster <gber at opensuse.org>
+Date: Tue, 14 Oct 2014 18:20:47 +0300
+Subject: Default application not respected with glib >= 2.41 (Bug #11212)
+
+Ensure thunar_file_list_get_applications() has the default
+application as the first element of the returned list.
+
+Signed-off-by: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
+
+diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c
+index c45cf81..0bfe166 100644
+--- a/thunar/thunar-file.c
++++ b/thunar/thunar-file.c
+@@ -3999,6 +3999,7 @@ thunar_file_list_get_applications (GList *file_list)
+   GList       *next;
+   GList       *ap;
+   GList       *lp;
++  GAppInfo    *default_application;
+   const gchar *previous_type = NULL;
+   const gchar *current_type;
+ 
+@@ -4017,7 +4018,25 @@ thunar_file_list_get_applications (GList *file_list)
+ 
+       /* determine the list of applications that can open this file */
+       if (G_UNLIKELY (current_type != NULL))
+-        list = g_app_info_get_all_for_type (current_type);
++        {
++          list = g_app_info_get_all_for_type (current_type);
++
++          /* move any default application in front of the list */
++          default_application = g_app_info_get_default_for_type (current_type, FALSE);
++          if (G_LIKELY (default_application != NULL))
++            {
++              for (ap = list; ap != NULL; ap = ap->next)
++                {
++                  if (g_app_info_equal (ap->data, default_application))
++                    {
++                      g_object_unref (ap->data);
++                      list = g_list_delete_link (list, ap);
++                      break;
++                    }
++                }
++              list = g_list_prepend (list, default_application);
++            }
++        }
+       else
+         list = NULL;
+ 
+-- 
+cgit v0.10.1
+
diff --git a/Thunar.spec b/Thunar.spec
index 481b8ae..07779c3 100644
--- a/Thunar.spec
+++ b/Thunar.spec
@@ -2,7 +2,7 @@
 
 Name:           Thunar
 Version:        1.6.3
-Release:        5%{?dist}
+Release:        6%{?dist}
 Summary:        Thunar File Manager
 
 Group:          User Interface/Desktops
@@ -19,6 +19,10 @@ Source4:        thunar-sendto-blueman.desktop
 # http://git.xfce.org/xfce/thunar/commit/?id=9e3a5dc
 # http://git.xfce.org/xfce/thunar/commit/?id=7027f7a
 Source5:        thunar.appdata.xml
+#
+# http://bugzilla.xfce.org/show_bug.cgi?id=11212
+# https://bugzilla.redhat.com/show_bug.cgi?id=1175867
+Patch1:         Thunar-1.6.2-glib2-open-with-order.patch
 Buildroot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  pkgconfig(dbus-glib-1) >= 0.34
@@ -69,6 +73,7 @@ libraries and header files for the Thunar file manager.
 
 %prep
 %setup -q
+%patch1 -p1
 
 # fix icon in thunar-sendto-email.desktop
 sed -i 's!internet-mail!mail-message-new!' \
@@ -217,6 +222,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
 
 
 %changelog
+* Sun Dec 21 2014 Kevin Fenzi <kevin at scrye.com> 1.6.3-6
+- Add patch for glib2 open with ordering. Fixes bug #1175867
+
 * Tue Nov 11 2014 Kevin Fenzi <kevin at scrye.com> 1.6.3-5
 - Add appdata. Fixes bug #1161931
 


More information about the scm-commits mailing list