rpms/glib2/devel gio-2.16-only-pass-uri-to-gio-apps.patch, NONE, 1.1 glib2.spec, 1.165, 1.166

David Zeuthen (davidz) fedora-extras-commits at redhat.com
Thu Apr 17 23:49:51 UTC 2008


Author: davidz

Update of /cvs/pkgs/rpms/glib2/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31591

Modified Files:
	glib2.spec 
Added Files:
	gio-2.16-only-pass-uri-to-gio-apps.patch 
Log Message:
* Thu Apr 17 2008 David Zeuthen <davidz at redhat.com> - 2.16.3-4
- Only pass URI's for gio apps (#442835)



gio-2.16-only-pass-uri-to-gio-apps.patch:

--- NEW FILE gio-2.16-only-pass-uri-to-gio-apps.patch ---
Index: gio/gdesktopappinfo.c
===================================================================
--- gio/gdesktopappinfo.c	(revision 6851)
+++ gio/gdesktopappinfo.c	(working copy)
@@ -1,3 +1,5 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+
 /* GIO - GLib Input, Output and Streaming Library
  * 
  * Copyright (C) 2006-2007 Red Hat, Inc.
@@ -87,6 +89,7 @@
   char *exec;
   char *binary;
   char *path;
+  char *vfs_system;
 
   guint nodisplay       : 1;
   guint hidden          : 1;
@@ -149,6 +152,7 @@
   g_free (info->try_exec);
   g_free (info->exec);
   g_free (info->binary);
+  g_free (info->vfs_system);
   g_free (info->path);
   
   G_OBJECT_CLASS (g_desktop_app_info_parent_class)->finalize (object);
@@ -264,6 +268,7 @@
   info->terminal = g_key_file_get_boolean (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_TERMINAL, NULL) != FALSE;
   info->startup_notify = g_key_file_get_boolean (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY, NULL) != FALSE;
   info->hidden = g_key_file_get_boolean (key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_HIDDEN, NULL) != FALSE;
+  info->vfs_system = g_key_file_get_string (key_file, G_KEY_FILE_DESKTOP_GROUP, "X-Gnome-Vfs-System", NULL);
 
   g_key_file_free (key_file);
   
@@ -498,9 +503,35 @@
 {
   GList *uris = *uri_list;
   char *expanded;
-  
+  gboolean force_file_uri;
+  char force_file_uri_macro;
+
   g_return_if_fail (exec != NULL);
-  
+
+  /* On %u and %U, only pass gio URI's if the desktop file has the
+   * X-Gnome-Vfs-System key set to 'gio' or if FUSE is not available.
+   * Otherwise we pass in a POSIX file path pointing to the URI via
+   * the FUSE mount in ~/.gvfs.
+   */
+  force_file_uri = FALSE;
+  if (macro == 'u' || macro == 'U')
+    {
+      if (info->vfs_system == NULL || strcmp (info->vfs_system, "gio") != 0)
+        {
+          switch (macro)
+            {
+            case 'u':
+              force_file_uri_macro = 'f';
+              force_file_uri = TRUE;
+              break;
+            case 'U':
+              force_file_uri_macro = 'F';
+              force_file_uri = TRUE;
+              break;
+            }
+        }
+    }
+
   switch (macro)
     {
     case 'u':
@@ -509,7 +540,17 @@
     case 'n':
       if (uris)
 	{
-	  expanded = expand_macro_single (macro, uris->data);
+          if (!force_file_uri || g_str_has_prefix (uris->data, "http"))
+            {
+              expanded = expand_macro_single (macro, uris->data);
+            }
+          else
+            {
+              expanded = expand_macro_single (force_file_uri_macro, uris->data);
+              if (expanded == NULL)
+                expanded = expand_macro_single (macro, uris->data);
+            }
+
 	  if (expanded)
 	    {
 	      g_string_append (exec, expanded);
@@ -526,7 +567,17 @@
     case 'N':
       while (uris)
 	{
-	  expanded = expand_macro_single (macro, uris->data);
+          if (!force_file_uri || g_str_has_prefix (uris->data, "http"))
+            {
+              expanded = expand_macro_single (macro, uris->data);
+            }
+          else
+            {
+              expanded = expand_macro_single (force_file_uri_macro, uris->data);
+              if (expanded == NULL)
+                expanded = expand_macro_single (macro, uris->data);
+            }
+
 	  if (expanded)
 	    {
 	      g_string_append (exec, expanded);


Index: glib2.spec
===================================================================
RCS file: /cvs/pkgs/rpms/glib2/devel/glib2.spec,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -r1.165 -r1.166
--- glib2.spec	14 Apr 2008 00:34:22 -0000	1.165
+++ glib2.spec	17 Apr 2008 23:49:13 -0000	1.166
@@ -3,7 +3,7 @@
 Summary: A library of handy utility functions
 Name: glib2
 Version: 2.16.3
-Release: 3%{?dist}
+Release: 4%{?dist}
 License: LGPLv2+
 Group: System Environment/Libraries
 URL: http://www.gtk.org
@@ -26,6 +26,9 @@
 # committed on March 12, 2008
 Patch1: revert-316221.patch
 
+# https://bugzilla.redhat.com/show_bug.cgi?id=442835
+Patch2: gio-2.16-only-pass-uri-to-gio-apps.patch
+
 %description 
 GLib is the low-level core library that forms the basis
 for projects such as GTK+ and GNOME. It provides data structure
@@ -59,6 +62,7 @@
 %setup -q -n glib-%{version}
 %patch0 -p1 -b .appinfo
 %patch1 -R -p1 -b .revert-316221
+%patch2 -p0 -b .only-pass-uri-to-gio-apps
 
 %build
 %configure --disable-gtk-doc --enable-static 
@@ -131,6 +135,9 @@
 %{_libdir}/lib*.a
 
 %changelog
+* Thu Apr 17 2008 David Zeuthen <davidz at redhat.com> - 2.16.3-4
+- Only pass URI's for gio apps (#442835)
+
 * Sun Apr 13 2008 Dan Williams <dcbw at redhat.com> - 2.16.3-3
 - Revert upstream changes to g_static_mutex_get_mutex_impl_shortcut that broke
     users of GMutex and GStaticMutex (bgo#316221)




More information about the fedora-extras-commits mailing list