packages: xfburn/xfburn.spec, xfburn/xfburn-gio.patch (NEW) - thunar-vfs re...

baggins baggins at pld-linux.org
Thu Feb 24 14:08:12 CET 2011


Author: baggins                      Date: Thu Feb 24 13:08:12 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- thunar-vfs replaced by gio, hal will be next

---- Files affected:
packages/xfburn:
   xfburn.spec (1.17 -> 1.18) , xfburn-gio.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/xfburn/xfburn.spec
diff -u packages/xfburn/xfburn.spec:1.17 packages/xfburn/xfburn.spec:1.18
--- packages/xfburn/xfburn.spec:1.17	Thu Feb 17 12:29:02 2011
+++ packages/xfburn/xfburn.spec	Thu Feb 24 14:08:07 2011
@@ -3,14 +3,17 @@
 Summary(pl.UTF-8):	Xfburn - proste narzędzie do wypalania CD/DVD
 Name:		xfburn
 Version:	0.4.3
-Release:	3
+Release:	3.1
 License:	GPL v2+
 Group:		X11/Applications
 Source0:	http://archive.xfce.org/src/apps/xfburn/0.4/%{name}-%{version}.tar.bz2
 # Source0-md5:	147cdc2d909e751125be16103b8dc81f
 Patch0:		%{name}-po.patch
+Patch1:		%{name}-gio.patch
 URL:		http://goodies.xfce.org/projects/applications/xfburn/
 BuildRequires:	Thunar-devel >= 0.9.3
+BuildRequires:	autoconf
+BuildRequires:	automake
 BuildRequires:	dbus-glib-devel >= 0.34
 BuildRequires:	exo-devel >= 0.3.0
 BuildRequires:	gettext-devel
@@ -21,10 +24,10 @@
 BuildRequires:	intltool
 BuildRequires:	libburn-devel >= 0.5.6
 BuildRequires:	libisofs-devel >= 0.6.2
+BuildRequires:	libtool
 BuildRequires:	libxfcegui4-devel >= 4.4.0
 BuildRequires:	pkgconfig
 BuildRequires:	rpmbuild(macros) >= 1.601
-BuildRequires:	thunar-vfs-devel
 Requires(post,postun):	desktop-file-utils
 Requires:	Thunar >= 0.9.3
 Requires:	gtk-update-icon-cache
@@ -50,12 +53,19 @@
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
-%build
 # unsupported Urdu Pakistan dialect
 %{__rm} po/ur_PK.po
 
+%build
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%{__automake}
 %configure
+
 %{__make}
 
 %install
@@ -94,6 +104,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.18  2011/02/24 13:08:07  baggins
+- thunar-vfs replaced by gio, hal will be next
+
 Revision 1.17  2011/02/17 11:29:02  megabajt
 - release 3
 

================================================================
Index: packages/xfburn/xfburn-gio.patch
diff -u /dev/null packages/xfburn/xfburn-gio.patch:1.1
--- /dev/null	Thu Feb 24 14:08:12 2011
+++ packages/xfburn/xfburn-gio.patch	Thu Feb 24 14:08:07 2011
@@ -0,0 +1,531 @@
+diff -ur xfburn-0.4.3/configure.in xfburn-0.4.3-gio/configure.in
+--- xfburn-0.4.3/configure.in	2011-02-24 14:04:52.532017948 +0100
++++ xfburn-0.4.3-gio/configure.in	2011-02-24 14:00:14.464307451 +0100
+@@ -40,10 +40,8 @@
+ XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.10.0])
+ XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.4.0])
+ XDT_CHECK_PACKAGE([EXO], [exo-0.3], [0.3.4], [], [XDT_CHECK_PACKAGE([EXO], [exo-1], [0.3.100])])
+-XDT_CHECK_OPTIONAL_PACKAGE([THUNAR_VFS], [thunar-vfs-1], [0.3.0], [thunar-vfs],
+-	AC_HELP_STRING([--disable-thunar-vfs],
+-			[Disable the use of Thunar's VFS layer to show mime type and icons in file browser]))
+-AM_CONDITIONAL([HAVE_THUNAR_VFS], [test "x$THUNAR_VFS_FOUND" = "xyes"])
++XDT_CHECK_PACKAGE([LIBGIO], [gio-2.0], [2.18.0])
++XDT_CHECK_PACKAGE([LIBGIOUNIX], [gio-unix-2.0], [2.16.0])
+ 
+ dnl **********************************
+ dnl *** Optional support for D-BUS ***
+diff -ur xfburn-0.4.3/xfburn/xfburn-audio-composition.c xfburn-0.4.3-gio/xfburn/xfburn-audio-composition.c
+--- xfburn-0.4.3/xfburn/xfburn-audio-composition.c	2009-12-04 08:47:20.000000000 +0100
++++ xfburn-0.4.3-gio/xfburn/xfburn-audio-composition.c	2011-02-24 13:57:29.188307447 +0100
+@@ -34,9 +34,7 @@
+ #include <libxfce4util/libxfce4util.h>
+ #include <libxfcegui4/libxfcegui4.h>
+ 
+-#ifdef HAVE_THUNAR_VFS
+-#include <thunar-vfs/thunar-vfs.h>
+-#endif
++#include <gio/gio.h>
+ 
+ #include <exo/exo.h>
+ 
+@@ -1711,37 +1709,30 @@
+     if (files)
+       for (i=0; files[i] != NULL && files[i][0] != '\0'; i++) {
+         gchar *full_path;
++        GFile *vfs_path;
+ 
+-#ifdef HAVE_THUNAR_VFS
+-        ThunarVfsPath *vfs_path;
+-        GError *vfs_error = NULL;
+-
+-        vfs_path = thunar_vfs_path_new (files[i], &vfs_error);
+-
+-        if (vfs_error) {
+-          g_warning ("Failed to create vfs path for '%s': %s", files[i], vfs_error->message);
+-          g_error_free (vfs_error);
++	vfs_path = g_file_new_for_path (files[i]);
++	if (vfs_path == NULL) {
++          g_warning ("Failed to create vfs path for '%s'", files[i]);
+           continue;
+         }
+ 
+-        if (thunar_vfs_path_get_scheme (vfs_path) != THUNAR_VFS_PATH_SCHEME_FILE)
+-          continue;
+-        full_path = thunar_vfs_path_dup_string (vfs_path);
++	/* unable to handle non-local files */
++	if (G_UNLIKELY (!g_file_has_uri_scheme (vfs_path, "file"))) {
++            g_object_unref (vfs_path);
++	    continue;
++        }
+ 
+-        thunar_vfs_path_unref (vfs_path);
++        full_path = g_file_get_path (vfs_path);
+ 
+-#else /* no thunar-vfs */
++        /* if there is no local path, use the URI (which always works) */
++        if (full_path == NULL)
++            full_path = g_file_get_uri (vfs_path);
+ 
+-        if (g_str_has_prefix (files[i], "file://"))
+-          full_path = g_build_filename (&files[i][7], NULL);
+-        else if (g_str_has_prefix (files[i], "file:"))
+-          full_path = g_build_filename (&files[i][5], NULL);
+-        else
+-          full_path = g_build_filename (files[i], NULL);
++        /* release the location */
++        g_object_unref (vfs_path);
+ 
+-        if (full_path[strlen (full_path) - 1] == '\r')
+-          full_path[strlen (full_path) - 1] = '\0';
+-#endif
++        DBG ("Adding path '%s'", full_path);
+ 
+         /* remember path to add it later in another thread */
+         priv->full_paths_to_add = g_list_append (priv->full_paths_to_add, full_path);
+@@ -1786,29 +1777,47 @@
+     }
+   } 
+   else if (sd->target == gdk_atom_intern ("text/uri-list", FALSE)) {
+-#ifdef HAVE_THUNAR_VFS
+     GList *vfs_paths = NULL;
+     GList *vfs_path;
+-    GError *error = NULL;
++    GList *lp;
+     gchar *full_path;
++    gchar **uris;
++    gsize   n;
+     gboolean ret = FALSE;
+ 
+-    vfs_paths = thunar_vfs_path_list_from_string ((gchar *) sd->data, &error);
++    uris = g_uri_list_extract_uris ((gchar *) sd->data);
++
++    for (n = 0; uris != NULL && uris[n] != NULL; ++n)
++      vfs_paths = g_list_append (vfs_paths, g_file_new_for_uri (uris[n]));
++
++    g_strfreev (uris);
+ 
+     if (G_LIKELY (vfs_paths != NULL)) {
+       ThreadAddFilesDragParams *params;
+       priv->full_paths_to_add = NULL;
+       for (vfs_path = vfs_paths; vfs_path != NULL; vfs_path = g_list_next (vfs_path)) {
+-        ThunarVfsPath *path = THUNAR_VFS_PATH (vfs_path->data);
+-        if (thunar_vfs_path_get_scheme (path) != THUNAR_VFS_PATH_SCHEME_FILE)
++	GFile *path = g_file_new_for_path (vfs_path->data);
++	if (path == NULL)
+           continue;
+-        full_path = thunar_vfs_path_dup_string (path);
++	/* unable to handle non-local files */
++	if (G_UNLIKELY (!g_file_has_uri_scheme (path, "file"))) {
++            g_object_unref (path);
++	    continue;
++        }
++        full_path = g_file_get_path (path);
++        /* if there is no local path, use the URI (which always works) */
++        if (full_path == NULL)
++            full_path = g_file_get_uri (path);
++        /* release the location */
+         g_debug ("adding uri path: %s", full_path);
+-
++        g_object_unref (path);
+         priv->full_paths_to_add = g_list_prepend (priv->full_paths_to_add, full_path);
+         ret = TRUE;
+       }
+-      thunar_vfs_path_list_free (vfs_paths);
++
++      for (lp = vfs_paths; lp != NULL; lp = lp->next)
++        g_object_unref (lp->data);
++      g_list_free (vfs_paths);
+ 
+       priv->full_paths_to_add = g_list_reverse (priv->full_paths_to_add);
+       priv->path_where_insert = path_where_insert;
+@@ -1831,18 +1840,10 @@
+         cb_adding_done (XFBURN_ADDING_PROGRESS (priv->progress), composition);
+       }
+     } else {
+-      if (G_UNLIKELY (error != NULL))
+-        g_warning ("text/uri-list drag failed because '%s'", error->message);
+-      else
+-        g_warning("There were no files in the uri list!");
++      g_warning("There were no files in the uri list!");
+       gtk_drag_finish (dc, FALSE, FALSE, t);
+       xfburn_default_cursor (priv->content);
+     }
+-#else
+-    g_warning ("Receiving this type of drag and drop requires thunar-vfs support, sorry!");
+-    gtk_drag_finish (dc, FALSE, FALSE, t);
+-    xfburn_default_cursor (priv->content);
+-#endif
+   } 
+   else {
+     g_warning ("Trying to receive an unsupported drag target, this should not happen.");
+diff -ur xfburn-0.4.3/xfburn/xfburn-data-composition.c xfburn-0.4.3-gio/xfburn/xfburn-data-composition.c
+--- xfburn-0.4.3/xfburn/xfburn-data-composition.c	2009-12-04 08:46:43.000000000 +0100
++++ xfburn-0.4.3-gio/xfburn/xfburn-data-composition.c	2011-02-24 13:57:48.743307448 +0100
+@@ -37,9 +37,7 @@
+ #include <libxfce4util/libxfce4util.h>
+ #include <libxfcegui4/libxfcegui4.h>
+ 
+-#ifdef HAVE_THUNAR_VFS
+-#include <thunar-vfs/thunar-vfs.h>
+-#endif
++#include <gio/gio.h>
+ 
+ #include <exo/exo.h>
+ 
+@@ -288,9 +286,7 @@
+ 
+   GtkTargetEntry gte_src[] =  { { "XFBURN_TREE_PATHS", GTK_TARGET_SAME_WIDGET, DATA_COMPOSITION_DND_TARGET_INSIDE } };
+   GtkTargetEntry gte_dest[] = { { "XFBURN_TREE_PATHS", GTK_TARGET_SAME_WIDGET, DATA_COMPOSITION_DND_TARGET_INSIDE },
+-#ifdef HAVE_THUNAR_VFS
+                                 { "text/uri-list", 0, DATA_COMPOSITION_DND_TARGET_TEXT_URI_LIST },
+-#endif
+                                 { "text/plain;charset=utf-8", 0, DATA_COMPOSITION_DND_TARGET_TEXT_PLAIN },
+                               };
+ 
+@@ -1188,14 +1184,14 @@
+     }
+     /* new file */
+     else if (S_ISREG (s.st_mode) || S_ISCHR(s.st_mode) || S_ISBLK(s.st_mode) || S_ISLNK (s.st_mode)) {
+-#ifdef HAVE_THUNAR_VFS
+       GdkScreen *screen;
+       GtkIconTheme *icon_theme;
+-      ThunarVfsMimeDatabase *mime_database = NULL;
+-      ThunarVfsMimeInfo *mime_info = NULL;
+-      const gchar *mime_icon_name = NULL;
+-      GdkPixbuf *mime_icon = NULL;
++      GdkPixbuf *mime_icon_pixbuf = NULL;
+       gint x,y;
++      GFile *file = NULL;
++      GFileInfo *info = NULL;
++      GIcon *mime_icon = NULL;
++      GtkIconInfo *icon_info = NULL;
+ 
+       if (s.st_size > MAXIMUM_ISO_FILE_SIZE) {
+         gdk_threads_enter ();
+@@ -1208,45 +1204,35 @@
+       gdk_threads_enter ();
+       screen = gtk_widget_get_screen (GTK_WIDGET (dc));
+       icon_theme = gtk_icon_theme_get_for_screen (screen);
+-      
+-      mime_database = thunar_vfs_mime_database_get_default ();
+-      mime_info = thunar_vfs_mime_database_get_info_for_file (mime_database, path, NULL);
+-          
+       gtk_icon_size_lookup (GTK_ICON_SIZE_SMALL_TOOLBAR, &x, &y);
+-      mime_icon_name = thunar_vfs_mime_info_lookup_icon_name (mime_info, icon_theme);
+-      mime_icon = gtk_icon_theme_load_icon (icon_theme, mime_icon_name, x, 0, NULL);
+-#endif
+-	
++
++      file = g_file_new_for_path(path);
++      info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, G_FILE_QUERY_INFO_NONE, NULL, NULL);
++      mime_icon = g_content_type_get_icon (g_file_info_get_content_type (info));
++      icon_info = gtk_icon_theme_lookup_by_gicon (icon_theme, mime_icon, x, GTK_ICON_LOOKUP_USE_BUILTIN);
++      mime_icon_pixbuf = gtk_icon_info_load_icon (icon_info, NULL);
++      gtk_icon_info_free (icon_info);
++
+       gtk_tree_store_append (GTK_TREE_STORE (model), iter, parent);
+ 
+       humansize = xfburn_humanreadable_filesize (s.st_size);
+ 
+-#ifdef HAVE_THUNAR_VFS
+       gtk_tree_store_set (GTK_TREE_STORE (model), iter,
+-                          DATA_COMPOSITION_COLUMN_ICON, (G_IS_OBJECT (mime_icon) ? mime_icon : icon_file),
++                          DATA_COMPOSITION_COLUMN_ICON, (G_IS_OBJECT (mime_icon_pixbuf) ? mime_icon_pixbuf : icon_file),
+                           DATA_COMPOSITION_COLUMN_CONTENT, name,
+                           DATA_COMPOSITION_COLUMN_HUMANSIZE, humansize,
+                           DATA_COMPOSITION_COLUMN_SIZE, (guint64) s.st_size, 
+                           DATA_COMPOSITION_COLUMN_PATH, path,
+                           DATA_COMPOSITION_COLUMN_TYPE, DATA_COMPOSITION_TYPE_FILE, -1);
+-#else
+-      gtk_tree_store_set (GTK_TREE_STORE (model), iter,
+-                          DATA_COMPOSITION_COLUMN_ICON, icon_file,
+-                          DATA_COMPOSITION_COLUMN_CONTENT, name,
+-                          DATA_COMPOSITION_COLUMN_HUMANSIZE, humansize,
+-                          DATA_COMPOSITION_COLUMN_SIZE, (guint64) s.st_size,
+-                          DATA_COMPOSITION_COLUMN_PATH, path,
+-                          DATA_COMPOSITION_COLUMN_TYPE, DATA_COMPOSITION_TYPE_FILE, -1);
+-#endif
+ 
+       xfburn_disc_usage_add_size (XFBURN_DISC_USAGE (priv->disc_usage), s.st_size);
+-#ifdef HAVE_THUNAR_VFS
++
++      g_object_unref (mime_icon);
+       if (G_LIKELY (G_IS_OBJECT (mime_icon)))
+         g_object_unref (mime_icon);
+-      thunar_vfs_mime_info_unref (mime_info);
+-      g_object_unref (mime_database);
++      if (G_LIKELY (G_IS_OBJECT (file)))
++        g_object_unref(file);
+       gdk_threads_leave ();
+-#endif
+     }
+     g_free (humansize);
+     g_free (parent);
+@@ -1672,37 +1658,28 @@
+ 
+       for (i=0; files[i] != NULL && files[i][0] != '\0'; i++) {
+         gchar *full_path;
++        GFile *vfs_path;
+ 
+-#ifdef HAVE_THUNAR_VFS
+-        ThunarVfsPath *vfs_path;
+-        GError *vfs_error = NULL;
+-
+-        vfs_path = thunar_vfs_path_new (files[i], &vfs_error);
+-
+-        if (vfs_error) {
+-          g_warning ("Failed to create vfs path for '%s': %s", files[i], vfs_error->message);
+-          g_error_free (vfs_error);
++	vfs_path = g_file_new_for_path (files[i]);
++	if (vfs_path == NULL) {
++          g_warning ("Failed to create vfs path for '%s'", files[i]);
+           continue;
+         }
+ 
+-        if (thunar_vfs_path_get_scheme (vfs_path) != THUNAR_VFS_PATH_SCHEME_FILE)
+-          continue;
+-        full_path = thunar_vfs_path_dup_string (vfs_path);
++	/* unable to handle non-local files */
++	if (G_UNLIKELY (!g_file_has_uri_scheme (vfs_path, "file"))) {
++            g_object_unref (vfs_path);
++	    continue;
++        }
+ 
+-        thunar_vfs_path_unref (vfs_path);
++        full_path = g_file_get_path (vfs_path);
+ 
+-#else /* no thunar-vfs */
++        /* if there is no local path, use the URI (which always works) */
++        if (full_path == NULL)
++            full_path = g_file_get_uri (vfs_path);
+ 
+-        if (g_str_has_prefix (files[i], "file://"))
+-          full_path = g_build_filename (&files[i][7], NULL);
+-        else if (g_str_has_prefix (files[i], "file:"))
+-          full_path = g_build_filename (&files[i][5], NULL);
+-        else
+-          full_path = g_build_filename (files[i], NULL);
+-
+-        if (full_path[strlen (full_path) - 1] == '\r')
+-          full_path[strlen (full_path) - 1] = '\0';
+-#endif
++        /* release the location */
++        g_object_unref (vfs_path);
+ 
+         DBG ("Adding path '%s'", full_path);
+ 
+@@ -1731,26 +1708,45 @@
+     gtk_drag_finish (dc, TRUE, FALSE, t);
+   } 
+   else if (sd->target == gdk_atom_intern ("text/uri-list", FALSE)) {
+-#ifdef HAVE_THUNAR_VFS
+     GList *vfs_paths = NULL;
+     GList *vfs_path;
+-    GError *error = NULL;
++    GList *lp;
+     gchar *full_path;
++    gchar **uris;
++    gsize   n;
++
++    uris = g_uri_list_extract_uris ((gchar *) sd->data);
++
++    for (n = 0; uris != NULL && uris[n] != NULL; ++n)
++      vfs_paths = g_list_append (vfs_paths, g_file_new_for_uri (uris[n]));
+ 
+-    vfs_paths = thunar_vfs_path_list_from_string ((gchar *) sd->data, &error);
++    g_strfreev (uris);
+ 
+     if (G_LIKELY (vfs_paths != NULL)) {
+       ThreadAddFilesDragParams *params;
+       priv->full_paths_to_add = NULL;
+       for (vfs_path = vfs_paths; vfs_path != NULL; vfs_path = g_list_next (vfs_path)) {
+-        ThunarVfsPath *path = THUNAR_VFS_PATH (vfs_path->data);
+-        if (thunar_vfs_path_get_scheme (path) != THUNAR_VFS_PATH_SCHEME_FILE)
++	GFile *path = g_file_new_for_path (vfs_path->data);
++	if (path == NULL)
+           continue;
+-        full_path = thunar_vfs_path_dup_string (path);
++	/* unable to handle non-local files */
++	if (G_UNLIKELY (!g_file_has_uri_scheme (path, "file"))) {
++            g_object_unref (path);
++	    continue;
++        }
++        full_path = g_file_get_path (path);
++        /* if there is no local path, use the URI (which always works) */
++        if (full_path == NULL)
++            full_path = g_file_get_uri (path);
++        /* release the location */
+         g_debug ("adding uri path: %s", full_path);
++        g_object_unref (path);
+         priv->full_paths_to_add = g_list_prepend (priv->full_paths_to_add, full_path);
+       }
+-      thunar_vfs_path_list_free (vfs_paths);
++
++      for (lp = vfs_paths; lp != NULL; lp = lp->next)
++        g_object_unref (lp->data);
++      g_list_free (vfs_paths);
+ 
+       priv->full_paths_to_add = g_list_reverse (priv->full_paths_to_add);
+       /* FIXME: path_where_insert is always NULL here */
+@@ -1769,18 +1765,10 @@
+ 
+       gtk_drag_finish (dc, TRUE, FALSE, t);
+     } else {
+-      if (G_UNLIKELY (error != NULL))
+-        g_warning ("text/uri-list drag failed because '%s'", error->message);
+-      else
+-        g_warning("There were no files in the uri list!");
++      g_warning("There were no files in the uri list!");
+       gtk_drag_finish (dc, FALSE, FALSE, t);
+       xfburn_default_cursor (priv->content);
+     }
+-#else
+-    g_warning ("Receiving this type of drag and drop requires thunar-vfs support, sorry!");
+-    gtk_drag_finish (dc, FALSE, FALSE, t);
+-    xfburn_default_cursor (priv->content);
+-#endif
+   } 
+   else {
+     g_warning ("Trying to receive an unsupported drag target, this should not happen.");
+diff -ur xfburn-0.4.3/xfburn/xfburn-device-box.c xfburn-0.4.3-gio/xfburn/xfburn-device-box.c
+--- xfburn-0.4.3/xfburn/xfburn-device-box.c	2009-10-30 01:48:01.000000000 +0100
++++ xfburn-0.4.3-gio/xfburn/xfburn-device-box.c	2011-02-23 19:38:47.129911724 +0100
+@@ -25,10 +25,6 @@
+ #include <libxfce4util/libxfce4util.h>
+ #include <libxfcegui4/libxfcegui4.h>
+ 
+-#ifdef HAVE_THUNAR_VFS
+-#include <thunar-vfs/thunar-vfs.h>
+-#endif
+-
+ #include "xfburn-device-list.h"
+ #include "xfburn-device-box.h"
+ #include "xfburn-settings.h"
+diff -ur xfburn-0.4.3/xfburn/xfburn-directory-browser.c xfburn-0.4.3-gio/xfburn/xfburn-directory-browser.c
+--- xfburn-0.4.3/xfburn/xfburn-directory-browser.c	2009-10-24 23:18:10.000000000 +0200
++++ xfburn-0.4.3-gio/xfburn/xfburn-directory-browser.c	2011-02-24 12:09:31.490336444 +0100
+@@ -28,9 +28,7 @@
+ #include <libxfce4util/libxfce4util.h>
+ #include <libxfcegui4/libxfcegui4.h>
+ 
+-#ifdef HAVE_THUNAR_VFS
+-#include <thunar-vfs/thunar-vfs.h>
+-#endif
++#include <gio/gio.h>
+ 
+ #include <exo/exo.h>
+ 
+@@ -315,44 +313,35 @@
+       }
+       else if ((s.st_mode & S_IFREG)) {
+         GtkTreeIter iter;
+-#ifdef HAVE_THUNAR_VFS
+-		ThunarVfsMimeDatabase *mime_database = NULL;
+-		ThunarVfsMimeInfo *mime_info = NULL;
+-		const gchar *mime_icon_name = NULL;
+-		GdkPixbuf *mime_icon = NULL;
+-		const gchar *mime_str = NULL;
+-#endif
+-		
++        GFileInfo *mime_info = NULL;
++        GIcon *mime_icon = NULL;
++        GdkPixbuf *mime_icon_pixbuf = NULL;
++        const gchar *mime_str = NULL;
++        GFile *file = NULL;
++        const gchar *content_type = NULL;
++
+         gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+-		
+-#ifdef HAVE_THUNAR_VFS
+-		mime_database = thunar_vfs_mime_database_get_default ();
+-		mime_info = thunar_vfs_mime_database_get_info_for_file (mime_database, path_utf8, NULL);
+-		
+-		mime_icon_name = thunar_vfs_mime_info_lookup_icon_name (mime_info, icon_theme);
+-		mime_icon = gtk_icon_theme_load_icon (icon_theme, mime_icon_name, x, 0, NULL);
+-		
+-		mime_str = thunar_vfs_mime_info_get_comment (mime_info);
+-		
++
++        file = g_file_new_for_path(path_utf8);
++        mime_info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, G_FILE_QUERY_INFO_NONE, NULL, NULL);
++        content_type = g_file_info_get_content_type (mime_info);
++        mime_icon = g_content_type_get_icon (content_type);
++        if (mime_icon != NULL) {
++            GtkIconInfo *icon_info = gtk_icon_theme_lookup_by_gicon (icon_theme, mime_icon, x, GTK_ICON_LOOKUP_USE_BUILTIN);
++            if (icon_info != NULL) {
++                mime_icon_pixbuf = gtk_icon_info_load_icon (icon_info, NULL);
++                gtk_icon_info_free (icon_info);
++		mime_str = g_content_type_get_description (content_type);
+ 		gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+-                            DIRECTORY_BROWSER_COLUMN_ICON, (G_IS_OBJECT (mime_icon) ? mime_icon : icon_file),
++                            DIRECTORY_BROWSER_COLUMN_ICON, (G_IS_OBJECT (mime_icon_pixbuf) ? mime_icon_pixbuf : icon_file),
+                             DIRECTORY_BROWSER_COLUMN_FILE, dir_entry,
+                             DIRECTORY_BROWSER_COLUMN_HUMANSIZE, humansize,
+                             DIRECTORY_BROWSER_COLUMN_SIZE, (guint64) s.st_size,
+                             DIRECTORY_BROWSER_COLUMN_TYPE, mime_str, DIRECTORY_BROWSER_COLUMN_PATH, path_utf8, -1);
+-		
+-		if (G_LIKELY (G_IS_OBJECT (mime_icon)))
+-		  g_object_unref (mime_icon);
+-		thunar_vfs_mime_info_unref (mime_info);
+-		g_object_unref (mime_database);
+-#else
+-        gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+-                            DIRECTORY_BROWSER_COLUMN_ICON, icon_file,
+-                            DIRECTORY_BROWSER_COLUMN_FILE, dir_entry,
+-                            DIRECTORY_BROWSER_COLUMN_HUMANSIZE, humansize,
+-                            DIRECTORY_BROWSER_COLUMN_SIZE, (guint64) s.st_size,
+-                            DIRECTORY_BROWSER_COLUMN_TYPE, _("File"), DIRECTORY_BROWSER_COLUMN_PATH, path_utf8, -1);
+-#endif
++            }
++            g_object_unref (mime_icon);
++        }
++        g_object_unref(file);
+       }
+       g_free (humansize);
+       g_free (path_utf8);
+diff -ur xfburn-0.4.3/xfburn/xfburn-main.c xfburn-0.4.3-gio/xfburn/xfburn-main.c
+--- xfburn-0.4.3/xfburn/xfburn-main.c	2009-10-31 23:15:01.000000000 +0100
++++ xfburn-0.4.3-gio/xfburn/xfburn-main.c	2011-02-23 19:41:09.739911724 +0100
+@@ -31,10 +31,6 @@
+ #include <libxfce4util/libxfce4util.h>
+ #include <libxfcegui4/libxfcegui4.h>
+ 
+-#ifdef HAVE_THUNAR_VFS
+-#include <thunar-vfs/thunar-vfs.h>
+-#endif
+-
+ #ifdef HAVE_GST
+ #include <gst/gst.h>
+ #endif
+@@ -275,20 +271,10 @@
+ 
+   xfburn_settings_init ();
+   
+-#ifdef HAVE_THUNAR_VFS
+-  thunar_vfs_init ();
+-  g_message ("Using Thunar-VFS %d.%d.%d", THUNAR_VFS_MAJOR_VERSION, THUNAR_VFS_MINOR_VERSION, THUNAR_VFS_MICRO_VERSION);
+-#else
+-  g_message ("Thunar-VFS not available, using default implementation");
+-#endif
+-  
+ #ifdef HAVE_HAL
+   error_msg = xfburn_hal_manager_create_global ();
+   if (error_msg) {
+     xfce_err (error_msg);
+-#ifdef HAVE_THUNAR_VFS
+-    thunar_vfs_shutdown ();
+-#endif
+     gdk_threads_leave ();
+     burn_finish ();
+     return EXIT_FAILURE;
+@@ -417,10 +403,6 @@
+   xfburn_hal_manager_shutdown ();
+ #endif
+ 
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/xfburn/xfburn.spec?r1=1.17&r2=1.18&f=u



More information about the pld-cvs-commit mailing list