rpms/gtk2/devel gtk-2.13.3-choosergio.patch, NONE, 1.1 gtk2.spec, 1.301, 1.302

Lubomir Rintel (lkundrak) fedora-extras-commits at redhat.com
Thu Jun 26 08:33:19 UTC 2008


Author: lkundrak

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

Modified Files:
	gtk2.spec 
Added Files:
	gtk-2.13.3-choosergio.patch 
Log Message:
* Thu Jun 26 2008 Lubomir Rintel <lkundrak at v3.sk> - 2.13.3-3
- Fix that makes gio-enabled file chooser return absolute paths


gtk-2.13.3-choosergio.patch:

--- NEW FILE gtk-2.13.3-choosergio.patch ---
The gtk_file_chooser_get_filename() returning relative path instead of
absolute broke inkscape (#452648)

2008-06-15  Carlos Garnacho  <carlos at imendio.com>

	* gtk/gtkfilechooser.c (gtk_file_chooser_get_filename): Return full 
	path here as expected, not just the basename.

	* gtk/gtkfilechooserdefault.c
	(gtk_file_chooser_default_update_current_folder): Ensure that we keep
	a reference to file, since it can be destroyed when switching back to
	browse mode.

	* gtk/gtkfilesystem.c (get_icon_for_special_directory): Removed, home
	and desktop directories are dealt by the filechooser as normal files,
	not volumes, so the icon for these is handled directly by GIO.
	(_gtk_file_system_volume_render_icon): Update caller.


Index: trunk/gtk/gtkfilechooserdefault.c
===================================================================
--- trunk/gtk/gtkfilechooserdefault.c	(revision 20392)
+++ trunk/gtk/gtkfilechooserdefault.c	(revision 20393)
@@ -6982,6 +6982,8 @@
 
   profile_start ("start", NULL);
 
+  g_object_ref (file);
+
   switch (impl->operation_mode)
     {
     case OPERATION_MODE_SEARCH:
@@ -7001,6 +7003,7 @@
 		   GTK_FILE_CHOOSER_ERROR_BAD_FILENAME,
 		   _("Cannot change to folder because it is not local"));
 
+      g_object_unref (file);
       profile_end ("end - not local", NULL);
       return FALSE;
     }
@@ -7024,6 +7027,7 @@
 			       data);
 
   set_busy_cursor (impl, TRUE);
+  g_object_unref (file);
 
   profile_end ("end", NULL);
   return TRUE;
Index: trunk/gtk/gtkfilesystem.c
===================================================================
--- trunk/gtk/gtkfilesystem.c	(revision 20392)
+++ trunk/gtk/gtkfilesystem.c	(revision 20393)
@@ -1662,50 +1662,6 @@
   return pixbuf;
 }
 
-static GIcon *
-get_icon_for_special_directory (GFile *file)
-{
-  const gchar *special_dir;
-  GFile *special_file;
-
-  special_dir = g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP);
-  special_file = g_file_new_for_path (special_dir);
-
-  if (g_file_equal (file, special_file))
-    {
-      const char *names[] = { 
-        "user-desktop", 
-        "gnome-fs-desktop", 
-        "folder", 
-        "gtk-directory",
-        NULL 
-      };
-      g_object_unref (special_file);
-      return g_themed_icon_new_from_names ((char **)names, -1);
-    }
-
-  g_object_unref (special_file);
-  special_dir = g_get_home_dir ();
-  special_file = g_file_new_for_path (special_dir);
-
-  if (g_file_equal (file, special_file))
-    {
-      const char *names[] = { 
-        "user-home", 
-        "gnome-fs-home", 
-        "folder", 
-        "gtk-directory",
-        NULL 
-      };
-      g_object_unref (special_file);
-      return g_themed_icon_new_from_names ((char **)names, -1);
-    }
-
-  g_object_unref (special_file);
-
-  return NULL;
-}
-
 GdkPixbuf *
 _gtk_file_system_volume_render_icon (GtkFileSystemVolume  *volume,
 				     GtkWidget            *widget,
@@ -1724,24 +1680,14 @@
   DEBUG ("volume_get_icon_name");
 
   if (IS_ROOT_VOLUME (volume))
-    icon = g_themed_icon_new_from_names ((char **)harddisk_icons, -1);
+    icon = g_themed_icon_new_from_names ((char **) harddisk_icons, -1);
   else if (G_IS_DRIVE (volume))
     icon = g_drive_get_icon (G_DRIVE (volume));
   else if (G_IS_VOLUME (volume))
     icon = g_volume_get_icon (G_VOLUME (volume));
   else if (G_IS_MOUNT (volume))
-    {
-      GMount *mount = G_MOUNT (volume);
-      GFile *file;
+    icon = g_mount_get_icon (G_MOUNT (volume));
 
-      file = g_mount_get_root (mount);
-      icon = get_icon_for_special_directory (file);
-      g_object_unref (file);
-
-      if (!icon)
-	icon = g_mount_get_icon (mount);
-    }
-
   if (!icon)
     return NULL;
 
Index: trunk/gtk/gtkfilechooser.c
===================================================================
--- trunk/gtk/gtkfilechooser.c	(revision 20392)
+++ trunk/gtk/gtkfilechooser.c	(revision 20393)
@@ -454,7 +454,7 @@
 
   if (file)
     {
-      result = g_file_get_basename (file);
+      result = g_file_get_path (file);
       g_object_unref (file);
     }
 


Index: gtk2.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gtk2/devel/gtk2.spec,v
retrieving revision 1.301
retrieving revision 1.302
diff -u -r1.301 -r1.302
--- gtk2.spec	20 Jun 2008 02:25:05 -0000	1.301
+++ gtk2.spec	26 Jun 2008 08:32:30 -0000	1.302
@@ -16,7 +16,7 @@
 Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X
 Name: gtk2
 Version: %{base_version}
-Release: 2%{?dist}
+Release: 3%{?dist}
 License: LGPLv2+
 Group: System Environment/Libraries
 Source: http://download.gnome.org/sources/gtk+/2.13/gtk+-%{version}.tar.bz2
@@ -30,6 +30,7 @@
 # a workaround for some brokenness in the flash plugin
 # see http://bugzilla.gnome.org/show_bug.cgi?id=463773
 Patch2: workaround.patch
+Patch3: gtk-2.13.3-choosergio.patch
 
 BuildRequires: atk-devel >= %{atk_version}
 BuildRequires: pango-devel >= %{pango_version}
@@ -115,6 +116,7 @@
 %patch0 -p1 -b .lib64
 %patch1 -p1 -b .set-invisible-char-to-bullet
 %patch2 -p1 -b .workaround
+%patch3 -p1 -b .choosergio
 
 for i in config.guess config.sub ; do
   test -f %{_datadir}/libtool/$i && cp %{_datadir}/libtool/$i .
@@ -298,6 +300,9 @@
 %{_datadir}/gtk-2.0
 
 %changelog
+* Thu Jun 26 2008 Lubomir Rintel <lkundrak at v3.sk> - 2.13.3-3
+- Fix that makes gio-enabled file chooser return absolute paths
+
 * Thu Jun 19 2008 Soren Sandmann <sandmann at redhat.com> - 2.13.3-2
 - Require glib 2.17.1 (for g_dgettext)
 




More information about the fedora-extras-commits mailing list