rpms/glib2/devel glib-2.17.4-gio-guess-content-sync.patch, NONE, 1.1 glib2.spec, 1.176, 1.177

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


Author: davidz

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

Modified Files:
	glib2.spec 
Added Files:
	glib-2.17.4-gio-guess-content-sync.patch 
Log Message:
* Thu Jul 24 2008 David Zeuthen <davidz at redhat.com> - 2.17.4-3
- Backport patch for g_mount_guess_content_type_sync



glib-2.17.4-gio-guess-content-sync.patch:

--- NEW FILE glib-2.17.4-gio-guess-content-sync.patch ---
--- trunk/docs/reference/gio/gio-sections.txt	2008/07/24 01:13:33	7251
+++ trunk/docs/reference/gio/gio-sections.txt	2008/07/24 21:21:22	7252
@@ -816,6 +816,7 @@
 g_mount_eject_finish
 g_mount_guess_content_type
 g_mount_guess_content_type_finish
+g_mount_guess_content_type_sync
 <SUBSECTION Standard>
 G_IS_MOUNT
 G_MOUNT
--- trunk/gio/gio.symbols	2008/07/24 01:13:33	7251
+++ trunk/gio/gio.symbols	2008/07/24 21:21:22	7252
@@ -718,6 +718,7 @@
 g_mount_remount_finish 
 g_mount_guess_content_type
 g_mount_guess_content_type_finish
+g_mount_guess_content_type_sync
 #endif
 #endif
 
--- trunk/gio/gmount.c	2008/07/24 01:13:33	7251
+++ trunk/gio/gmount.c	2008/07/24 21:21:22	7252
@@ -570,9 +570,10 @@
  * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
  * specification for more on x-content types.
  *
- * This is an asynchronous operation, and is finished by calling 
- * g_mount_guess_content_type_finish() with the @mount and #GAsyncResult 
- * data returned in the @callback. 
+ * This is an asynchronous operation (see
+ * g_mount_guess_content_type_sync() for the synchronous version), and
+ * is finished by calling g_mount_guess_content_type_finish() with the
+ * @mount and #GAsyncResult data returned in the @callback.
  *
  * Since: 2.18
  */
@@ -644,6 +645,55 @@
   return (* iface->guess_content_type_finish) (mount, result, error);
 }
 
+/**
+ * g_mount_guess_content_type_sync:
+ * @mount: a #GMount
+ * @force_rescan: Whether to force a rescan of the content.
+ *     Otherwise a cached result will be used if available
+ * @cancellable: optional #GCancellable object, %NULL to ignore
+ * @error: a #GError location to store the error occuring, or %NULL to
+ *     ignore
+ *
+ * Tries to guess the type of content stored on @mount. Returns one or
+ * more textual identifiers of well-known content types (typically
+ * prefixed with "x-content/"), e.g. x-content/image-dcf for camera 
+ * memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
+ * specification for more on x-content types.
+ *
+ * This is an synchronous operation and as such may block doing IO;
+ * see g_mount_guess_content_type() for the asynchronous version.
+ *
+ * Returns: a %NULL-terminated array of content types or %NULL on error.
+ *     Caller should free this array with g_strfreev() when done with it.
+ *
+ * Since: 2.18
+ */
+char **
+g_mount_guess_content_type_sync (GMount              *mount,
+                                 gboolean             force_rescan,
+                                 GCancellable        *cancellable,
+                                 GError             **error)
+{
+  GMountIface *iface;
+
+  g_return_val_if_fail (G_IS_MOUNT (mount), NULL);
+
+  iface = G_MOUNT_GET_IFACE (mount);
+
+  if (iface->guess_content_type_sync == NULL)
+    {
+      g_set_error_literal (error,
+                           G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
+                           /* Translators: This is an error
+                            * message for mount objects that
+                            * don't implement content type guessing. */
+                           _("mount doesn't implement synchronous content type guessing"));
+
+      return NULL;
+    }
+
+  return (* iface->guess_content_type_sync) (mount, force_rescan, cancellable, error);
+}
 
 #define __G_MOUNT_C__
 #include "gioaliasdef.c"
--- trunk/gio/gmount.h	2008/07/24 01:13:33	7251
+++ trunk/gio/gmount.h	2008/07/24 21:21:22	7252
@@ -119,6 +119,11 @@
   gchar **           (*guess_content_type_finish) (GMount              *mount,
                                                    GAsyncResult        *result,
                                                     GError             **error); 
+
+  gchar **           (*guess_content_type_sync) (GMount              *mount,
+                                                 gboolean             force_rescan,
+                                                 GCancellable        *cancellable,
+                                                 GError             **error);
 };
 
 GType g_mount_get_type (void) G_GNUC_CONST;
@@ -166,6 +171,11 @@
                                                  GAsyncResult        *result,
                                                  GError             **error);
 
+gchar **      g_mount_guess_content_type_sync (GMount              *mount,
+                                               gboolean             force_rescan,
+                                               GCancellable        *cancellable,
+                                               GError             **error);
+
 G_END_DECLS
 
 #endif /* __G_MOUNT_H__ */
--- trunk/configure.in	2008/07/21 17:56:17	7234
+++ trunk/configure.in	2008/07/21 18:07:55	7236
@@ -23,7 +23,7 @@
 #
 m4_define([glib_major_version], [2])
 m4_define([glib_minor_version], [17])
-m4_define([glib_micro_version], [4])
+m4_define([glib_micro_version], [5])
 m4_define([glib_interface_age], [0])
 m4_define([glib_binary_age],
           [m4_eval(100 * glib_minor_version + glib_micro_version)])


Index: glib2.spec
===================================================================
RCS file: /cvs/pkgs/rpms/glib2/devel/glib2.spec,v
retrieving revision 1.176
retrieving revision 1.177
diff -u -r1.176 -r1.177
--- glib2.spec	21 Jul 2008 22:34:37 -0000	1.176
+++ glib2.spec	24 Jul 2008 23:48:32 -0000	1.177
@@ -3,7 +3,7 @@
 Summary: A library of handy utility functions
 Name: glib2
 Version: 2.17.4
-Release: 2%{?dist}
+Release: 3%{?dist}
 License: LGPLv2+
 Group: System Environment/Libraries
 URL: http://www.gtk.org
@@ -28,6 +28,10 @@
 # fixed in svn
 Patch4: statfs-check.patch
 
+# http://bugzilla.gnome.org/show_bug.cgi?id=544599 (upstream) +
+# bump version to 2.17.5 since gvfs will require this version
+Patch5: glib-2.17.4-gio-guess-content-sync.patch
+
 %description 
 GLib is the low-level core library that forms the basis
 for projects such as GTK+ and GNOME. It provides data structure
@@ -62,6 +66,7 @@
 %patch2 -p1 -b .only-pass-uri-to-gio-apps
 %patch3 -p0 -b .selinux
 %patch4 -p1 -b .statfs-check
+%patch5 -p1 -b .guess-content-type-sync
 
 %build
 %configure --disable-gtk-doc --enable-static 
@@ -136,6 +141,9 @@
 %{_libdir}/lib*.a
 
 %changelog
+* Thu Jul 24 2008 David Zeuthen <davidz at redhat.com> - 2.17.4-3
+- Backport patch for g_mount_guess_content_type_sync
+
 * Mon Jul 21 2008 Matthias Clasen <mclasen at redhat.com> - 2.17.4-2
 - Fix statfs configure check
 




More information about the fedora-extras-commits mailing list