packages: xfburn/xfburn-gio.patch, xfburn/xfburn.spec - say googbye to HAL

baggins baggins at pld-linux.org
Sat Feb 26 15:14:27 CET 2011


Author: baggins                      Date: Sat Feb 26 14:14:27 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- say googbye to HAL

---- Files affected:
packages/xfburn:
   xfburn-gio.patch (1.1 -> 1.2) , xfburn.spec (1.18 -> 1.19) 

---- Diffs:

================================================================
Index: packages/xfburn/xfburn-gio.patch
diff -u packages/xfburn/xfburn-gio.patch:1.1 packages/xfburn/xfburn-gio.patch:1.2
--- packages/xfburn/xfburn-gio.patch:1.1	Thu Feb 24 14:08:07 2011
+++ packages/xfburn/xfburn-gio.patch	Sat Feb 26 15:14:22 2011
@@ -1,7 +1,51 @@
-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 @@
+diff -urN xfburn-0.4.3/config.h.in xfburn-0.4.3-gio/config.h.in
+--- xfburn-0.4.3/config.h.in	2010-02-13 07:43:21.000000000 +0100
++++ xfburn-0.4.3-gio/config.h.in	2011-02-25 12:37:14.000000000 +0100
+@@ -15,9 +15,6 @@
+ /* Define to 1 if you have the `bind_textdomain_codeset' function. */
+ #undef HAVE_BIND_TEXTDOMAIN_CODESET
+ 
+-/* Define if dbus-glib-1 >= 0.34 present */
+-#undef HAVE_DBUS
+-
+ /* Define to 1 if you have the `dcgettext' function. */
+ #undef HAVE_DCGETTEXT
+ 
+@@ -30,8 +27,8 @@
+ /* Define if gstreamer-0.10 >= 0.10.2 present */
+ #undef HAVE_GST
+ 
+-/* Define if hal-storage >= 0.5.7 present */
+-#undef HAVE_HAL
++/* Define if gudev-1.0 >= 145 present */
++#undef HAVE_GUDEV
+ 
+ /* Define to 1 if you have the <inttypes.h> header file. */
+ #undef HAVE_INTTYPES_H
+@@ -39,9 +36,6 @@
+ /* Define if your <locale.h> file defines LC_MESSAGES. */
+ #undef HAVE_LC_MESSAGES
+ 
+-/* Define if LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRWDL present */
+-#undef HAVE_LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRWDL
+-
+ /* Define to 1 if you have the <locale.h> header file. */
+ #undef HAVE_LOCALE_H
+ 
+@@ -66,9 +60,6 @@
+ /* Define to 1 if you have the <sys/types.h> header file. */
+ #undef HAVE_SYS_TYPES_H
+ 
+-/* Define if thunar-vfs-1 >= 0.3.0 present */
+-#undef HAVE_THUNAR_VFS
+-
+ /* Define to 1 if you have the <unistd.h> header file. */
+ #undef HAVE_UNISTD_H
+ 
+diff -urN xfburn-0.4.3/configure.in xfburn-0.4.3-gio/configure.in
+--- xfburn-0.4.3/configure.in	2011-02-26 14:00:58.199792241 +0100
++++ xfburn-0.4.3-gio/configure.in	2011-02-26 14:00:33.391792242 +0100
+@@ -40,45 +40,13 @@
  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])])
@@ -9,14 +53,89 @@
 -	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])
+-
+-dnl **********************************
+-dnl *** Optional support for D-BUS ***
+-dnl **********************************
+-dnl (taken from thunar-0.8.0)
+-XDT_CHECK_OPTIONAL_PACKAGE([DBUS], [dbus-glib-1],
+-                           [0.34], [dbus], [D-BUS support])
++XDT_CHECK_PACKAGE([LIBGIO], [gio-2.0], [2.22.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
+ dnl ********************************
+-dnl *** Check for HAL (optional) ***
++dnl *** Check for gudev (optional) ***
+ dnl ********************************
+-dnl (taken from libexo's configure.in.in rev.26877)
+-XDT_CHECK_OPTIONAL_PACKAGE([HAL], [hal-storage], [0.5.7], [hal], [HAL support], [yes])
+-if test x"$HAL_FOUND" = x"yes"; then
+-  dnl # substituted into exo-hal-0.3.pc
+-  HAL_STORAGE_DEPENDENCY="hal-storage"
+-
+-  dnl # Check if LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRWDL is declared
+-  save_CFLAGS="$CFLAGS"
+-  CFLAGS="$CFLAGS $HAL_CFLAGS"
+-  AC_MSG_CHECKING([whether LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRWDL is declared])
+-  AC_COMPILE_IFELSE(AC_LANG_SOURCE(
+-  [#include <libhal-storage.h>
+-    int main (int argc, char **argv) { return LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRWDL; }
+-  ]),
+-  [
+-    AC_DEFINE([HAVE_LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRWDL], [1], [Define if LIBHAL_DRIVE_CDROM_CAPS_DVDPLUSRWDL present])
+-    AC_MSG_RESULT([yes])
+-  ],
+-  [
+-    AC_MSG_RESULT([no])
+-  ])
+-  CFLAGS="$save_CFLAGS"
+-fi
+-AC_SUBST([HAL_STORAGE_DEPENDENCY])
++XDT_CHECK_OPTIONAL_PACKAGE([GUDEV], [gudev-1.0], [145], [gudev], [UDEV glib support], [yes])
+ 
+ dnl **************************************
+ dnl *** Optional support for gstreamer ***
+diff -urN xfburn-0.4.3/xfburn/Makefile.am xfburn-0.4.3-gio/xfburn/Makefile.am
+--- xfburn-0.4.3/xfburn/Makefile.am	2009-10-24 23:18:10.000000000 +0200
++++ xfburn-0.4.3-gio/xfburn/Makefile.am	2011-02-25 12:34:36.692567046 +0100
+@@ -28,7 +28,7 @@
+ 	xfburn-composition.h						\
+ 	xfburn-compositions-notebook.h					\
+ 	xfburn-create-iso-progress-dialog.h				\
+-	xfburn-hal-manager.h						\
++	xfburn-udev-manager.h						\
+ 	xfburn-device-box.h						\
+ 	xfburn-device.h							\
+ 	xfburn-device-list.h						\
+@@ -69,7 +69,7 @@
+ 	xfburn-composition.c						\
+ 	xfburn-compositions-notebook.c					\
+ 	xfburn-settings.c						\
+-	xfburn-hal-manager.c						\
++	xfburn-udev-manager.c						\
+ 	xfburn-device-box.c						\
+ 	xfburn-device.c							\
+ 	xfburn-device-list.c						\
+@@ -112,13 +112,12 @@
+ 	$(GST_LIBS)							\
+ 	$(GST_PBUTILS_LIBS)
+ 
+-if HAVE_HAL
++if HAVE_GUDEV
+ xfburn_CFLAGS +=							\
+-	$(HAL_CFLAGS)
++	$(GUDEV_CFLAGS)
+ 
+ xfburn_LDADD += 							\
+-	$(HAL_LIBS)
+-	$(HAL_DBUS_LIBS)
++	$(GUDEV_LIBS)
+ 
+ endif
+ 
+diff -urN 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
++++ xfburn-0.4.3-gio/xfburn/xfburn-audio-composition.c	2011-02-26 12:19:40.420961797 +0100
 @@ -34,9 +34,7 @@
  #include <libxfce4util/libxfce4util.h>
  #include <libxfcegui4/libxfcegui4.h>
@@ -28,11 +147,9 @@
  
  #include <exo/exo.h>
  
-@@ -1711,37 +1709,30 @@
-     if (files)
+@@ -1712,26 +1710,6 @@
        for (i=0; files[i] != NULL && files[i][0] != '\0'; i++) {
          gchar *full_path;
-+        GFile *vfs_path;
  
 -#ifdef HAVE_THUNAR_VFS
 -        ThunarVfsPath *vfs_path;
@@ -43,46 +160,31 @@
 -        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;
-         }
- 
+-          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 (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:"))
+@@ -1741,7 +1719,8 @@
  
--        if (full_path[strlen (full_path) - 1] == '\r')
--          full_path[strlen (full_path) - 1] = '\0';
+         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 @@
+@@ -1786,29 +1765,46 @@
      }
    } 
    else if (sd->target == gdk_atom_intern ("text/uri-list", FALSE)) {
@@ -110,7 +212,7 @@
        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);
++	GFile *path = vfs_path->data;
 +	if (path == NULL)
            continue;
 -        full_path = thunar_vfs_path_dup_string (path);
@@ -126,7 +228,6 @@
 +        /* 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;
        }
@@ -138,7 +239,7 @@
  
        priv->full_paths_to_add = g_list_reverse (priv->full_paths_to_add);
        priv->path_where_insert = path_where_insert;
-@@ -1831,18 +1840,10 @@
+@@ -1831,18 +1827,10 @@
          cb_adding_done (XFBURN_ADDING_PROGRESS (priv->progress), composition);
        }
      } else {
@@ -158,9 +259,34 @@
    } 
    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
+diff -urN xfburn-0.4.3/xfburn/xfburn-blank-dialog.c xfburn-0.4.3-gio/xfburn/xfburn-blank-dialog.c
+--- xfburn-0.4.3/xfburn/xfburn-blank-dialog.c	2009-10-24 23:18:10.000000000 +0200
++++ xfburn-0.4.3-gio/xfburn/xfburn-blank-dialog.c	2011-02-25 13:32:08.965731130 +0100
+@@ -30,7 +30,7 @@
+ #include "xfburn-device-box.h"
+ #include "xfburn-device-list.h"
+ #include "xfburn-stock.h"
+-#include "xfburn-hal-manager.h"
++#include "xfburn-udev-manager.h"
+ #include "xfburn-main.h"
+ 
+ #include "xfburn-blank-dialog.h"
+@@ -465,10 +465,10 @@
+  
+   g_free (params);
+ 
+-#ifdef HAVE_HAL
++#ifdef HAVE_GUDEV
+   gdk_threads_enter ();
+   DBG ("blanking done!");
+-  xfburn_hal_manager_send_volume_changed ();
++  xfburn_udev_manager_send_volume_changed ();
+   gdk_threads_leave ();
+ #endif
+ }
+diff -urN 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
++++ xfburn-0.4.3-gio/xfburn/xfburn-data-composition.c	2011-02-26 12:30:35.847961806 +0100
 @@ -37,9 +37,7 @@
  #include <libxfce4util/libxfce4util.h>
  #include <libxfcegui4/libxfcegui4.h>
@@ -202,7 +328,7 @@
  
        if (s.st_size > MAXIMUM_ISO_FILE_SIZE) {
          gdk_threads_enter ();
-@@ -1208,45 +1204,35 @@
+@@ -1208,45 +1204,38 @@
        gdk_threads_enter ();
        screen = gtk_widget_get_screen (GTK_WIDGET (dc));
        icon_theme = gtk_icon_theme_get_for_screen (screen);
@@ -219,9 +345,13 @@
 +      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);
++      if (mime_icon != NULL) {
++        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);
++        }
++      }
 +
        gtk_tree_store_append (GTK_TREE_STORE (model), iter, parent);
  
@@ -249,7 +379,6 @@
        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);
@@ -261,11 +390,9 @@
      }
      g_free (humansize);
      g_free (parent);
-@@ -1672,37 +1658,28 @@
- 
+@@ -1673,26 +1662,6 @@
        for (i=0; files[i] != NULL && files[i][0] != '\0'; i++) {
          gchar *full_path;
-+        GFile *vfs_path;
  
 -#ifdef HAVE_THUNAR_VFS
 -        ThunarVfsPath *vfs_path;
@@ -276,45 +403,31 @@
 -        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;
-         }
- 
+-          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);
+         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:"))
+@@ -1702,8 +1671,7 @@
  
+         if (full_path[strlen (full_path) - 1] == '\r')
+           full_path[strlen (full_path) - 1] = '\0';
+-#endif
+-
++					
          DBG ("Adding path '%s'", full_path);
  
-@@ -1731,26 +1708,45 @@
+         /* remember path to add it later in another thread */
+@@ -1731,26 +1699,44 @@
      gtk_drag_finish (dc, TRUE, FALSE, t);
    } 
    else if (sd->target == gdk_atom_intern ("text/uri-list", FALSE)) {
@@ -326,13 +439,13 @@
      gchar *full_path;
 +    gchar **uris;
 +    gsize   n;
-+
+ 
+-    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]));
- 
--    vfs_paths = thunar_vfs_path_list_from_string ((gchar *) sd->data, &error);
++
 +    g_strfreev (uris);
  
      if (G_LIKELY (vfs_paths != NULL)) {
@@ -341,7 +454,7 @@
        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);
++	GFile *path = vfs_path->data;
 +	if (path == NULL)
            continue;
 -        full_path = thunar_vfs_path_dup_string (path);
@@ -356,7 +469,6 @@
 +            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);
@@ -367,7 +479,7 @@
  
        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 @@
+@@ -1769,18 +1755,10 @@
  
        gtk_drag_finish (dc, TRUE, FALSE, t);
      } else {
@@ -387,9 +499,9 @@
    } 
    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
+diff -urN 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
++++ xfburn-0.4.3-gio/xfburn/xfburn-device-box.c	2011-02-26 01:25:20.948825389 +0100
 @@ -25,10 +25,6 @@
  #include <libxfce4util/libxfce4util.h>
  #include <libxfcegui4/libxfcegui4.h>
@@ -401,9 +513,162 @@
  #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
+diff -urN xfburn-0.4.3/xfburn/xfburn-device.c xfburn-0.4.3-gio/xfburn/xfburn-device.c
+--- xfburn-0.4.3/xfburn/xfburn-device.c	2010-01-29 05:46:24.000000000 +0100
++++ xfburn-0.4.3-gio/xfburn/xfburn-device.c	2011-02-25 13:33:19.306731128 +0100
+@@ -25,7 +25,7 @@
+ #include <unistd.h>
+ 
+ #include "xfburn-device.h"
+-#include "xfburn-hal-manager.h"
++#include "xfburn-udev-manager.h"
+ 
+ /*- globals -*/
+ 
+@@ -430,8 +430,8 @@
+   gchar drive_addr[BURN_DRIVE_ADR_LEN];
+   int i;
+   const int max_checks = 4;
+-#ifdef HAVE_HAL
+-  XfburnHalManager *halman = xfburn_hal_manager_get_global ();
++#ifdef HAVE_GUDEV
++  XfburnUdevManager *udevman = xfburn_udev_manager_get_global ();
+ #endif
+ 
+   ret = burn_drive_convert_fs_adr (priv->addr, drive_addr);
+@@ -448,8 +448,8 @@
+     if (ret > 0)
+       break;
+     else if  (i < max_checks) {
+-#ifdef HAVE_HAL 
+-      if (!xfburn_hal_manager_check_ask_umount (halman, device))
++#ifdef HAVE_GUDEV
++      if (!xfburn_udev_manager_check_ask_umount (udevman, device))
+         usleep(i*100001);
+ #else
+       usleep(i*100001);
+diff -urN xfburn-0.4.3/xfburn/xfburn-device-list.c xfburn-0.4.3-gio/xfburn/xfburn-device-list.c
+--- xfburn-0.4.3/xfburn/xfburn-device-list.c	2009-11-12 04:27:40.000000000 +0100
++++ xfburn-0.4.3-gio/xfburn/xfburn-device-list.c	2011-02-26 01:25:32.553825389 +0100
+@@ -34,7 +34,7 @@
+ #include <libburn.h>
+ 
+ #include "xfburn-global.h"
+-#include "xfburn-hal-manager.h"
++#include "xfburn-udev-manager.h"
+ #include "xfburn-utils.h"
+ 
+ #include "xfburn-device-list.h"
+@@ -50,7 +50,7 @@
+   gint num_burners;
+   XfburnDevice *curr_device;
+ 
+-#ifdef HAVE_HAL
++#ifdef HAVE_GUDEV
+   gulong volume_changed_handlerid;
+ #endif
+ };
+@@ -58,8 +58,8 @@
+ void get_libburn_device_list (XfburnDeviceList *devlist);
+ static void cb_combo_device_changed (GtkComboBox *combo, XfburnDeviceList *devlist);
+ static void cb_refresh_clicked (GtkButton *button, XfburnDeviceList *devlist);
+-#ifdef HAVE_HAL
+-static void cb_volumes_changed (XfburnHalManager *halman, XfburnDeviceList *devlist);
++#ifdef HAVE_GUDEV
++static void cb_volumes_changed (XfburnUdevManager *udevman, XfburnDeviceList *devlist);
+ #endif
+ static XfburnDevice * get_selected_device (GtkComboBox *combo_device);
+ static void refresh (XfburnDeviceList *devlist);
+@@ -219,64 +219,23 @@
+   //klass->volume_changed = cb_volume_changed
+ }
+ 
+-#if 0
+ static void
+ xfburn_device_list_init (XfburnDeviceList *self)
+ {
+   XfburnDeviceListPrivate *priv = GET_PRIVATE (self);
+ 
+-#ifdef HAVE_HAL
+-  XfburnHalManager *halman = xfburn_hal_manager_get_global ();
++#ifdef HAVE_GUDEV
++  XfburnUdevManager *udevman = xfburn_udev_manager_get_global ();
+ #endif
+ 
+   DBG ("Constructing device list");
+   xfburn_console_libburn_messages ();
+ 
+-#ifdef HAVE_HAL
+-  /* FIXME: hal_manager currently only returns burners, not readers */
+-  priv->num_drives = priv->num_burners = xfburn_hal_manager_get_devices (halman, &priv->devices);
+-  if (priv->num_burners < 1) {
+-    /* if some error occurred while checking hal properties,
+-       or hal for some reason did not find a device, then just
+-       fall back on libburn */
+-    g_message ("HAL said there are %d burners, checking libburn if it can detect any", priv->num_burners);
+-
+-    get_libburn_device_list (self);
+-  }
+-
+-  priv->volume_changed_handlerid = g_signal_connect (G_OBJECT (xfburn_hal_manager_get_global ()), "volume-changed", G_CALLBACK (cb_volumes_changed), self);
+-
+-#else
+-  get_libburn_device_list (self);
+-#endif
+-}
+-#endif
+-
+-static void
+-xfburn_device_list_init (XfburnDeviceList *self)
+-{
+-  XfburnDeviceListPrivate *priv = GET_PRIVATE (self);
+-
+-#ifdef HAVE_HAL
+-  XfburnHalManager *halman = xfburn_hal_manager_get_global ();
+-#endif
+-
+-  DBG ("Constructing device list");
+-  xfburn_console_libburn_messages ();
+-
+-#ifdef HAVE_HAL
+-  /* FIXME: hal_manager currently only returns burners, not readers */
+-  priv->num_drives = priv->num_burners = xfburn_hal_manager_get_devices (halman, &priv->devices);
+-  if (priv->num_burners < 1) {
+-    /* if some error occurred while checking hal properties,
+-       or hal for some reason did not find a device, then just
+-       fall back on libburn */
+-    g_message ("HAL said there are %d burners, checking libburn if it can detect any", priv->num_burners);
+-
+-    get_libburn_device_list (self);
+-  }
+-  priv->volume_changed_handlerid = g_signal_connect (G_OBJECT (xfburn_hal_manager_get_global ()), "volume-changed", G_CALLBACK (cb_volumes_changed), self);
+-
++#ifdef HAVE_GUDEV
++  priv->devices = xfburn_udev_manager_get_devices (udevman, &priv->num_drives, &priv->num_burners);
++  if (priv->num_drives > 0 && priv->num_burners < 1)
++    g_warning ("There are %d drives in your system, but none are capable of burning", priv->num_drives);
++  priv->volume_changed_handlerid = g_signal_connect (G_OBJECT (xfburn_udev_manager_get_global ()), "volume-changed", G_CALLBACK (cb_volumes_changed), self);
<<Diff was trimmed, longer than 597 lines>>

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



More information about the pld-cvs-commit mailing list