nautilus-cd-burner r2250 - in trunk: . src



Author: hadess
Date: Tue Dec 16 09:34:26 2008
New Revision: 2250
URL: http://svn.gnome.org/viewvc/nautilus-cd-burner?rev=2250&view=rev

Log:
2008-12-16  Bastien Nocera  <hadess hadess net>

	* configure.in:
	* src/ncb-operation.c (burn_folder_is_dvd_video):
	Use GIO to detect whether burn:/// contains a Video-DVD
	(Closes: #550012)



Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/src/ncb-operation.c

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Tue Dec 16 09:34:26 2008
@@ -57,7 +57,7 @@
 
 dnl ===========================================================================
 dnl Minimum versions of the libraries
-GLIB_REQUIRED=2.15.4
+GLIB_REQUIRED=2.17.4
 GTK_REQUIRED=2.5.4
 LIBGLADE_REQUIRED=2.0.0
 LIBGNOME_REQUIRED=2.14.0

Modified: trunk/src/ncb-operation.c
==============================================================================
--- trunk/src/ncb-operation.c	(original)
+++ trunk/src/ncb-operation.c	Tue Dec 16 09:34:26 2008
@@ -1291,58 +1291,26 @@
 static gboolean
 burn_folder_is_dvd_video (void)
 {
-        GFile           *file;
-        GFileEnumerator *enumerator;
-        gboolean         done;
-        gboolean         is_dvd_video;
-        GError          *error;
-
-        is_dvd_video = FALSE;
-
-        file = g_file_new_for_uri (BURN_URI);
-
-        error = NULL;
-        enumerator = g_file_enumerate_children (file,
-                                                G_FILE_ATTRIBUTE_STANDARD_NAME,
-                                                0,
-                                                NULL,
-                                                &error);
-        if (enumerator == NULL) {
-                g_warning ("Could not open burn uri %s: %s\n",
-                           BURN_URI,
-                           error->message);
-                g_error_free (error);
-                return FALSE;
-        }
-
-        done = FALSE;
-        while (! done) {
-                GFileInfo  *info;
-                const char *name;
-                char       *filename;
-
-                info = g_file_enumerator_next_file (enumerator, NULL, NULL);
-                if (info == NULL) {
-                        break;
-                }
-
-                name = g_file_info_get_name (info);
-
-                g_object_unref (info);
-
-                filename = g_utf8_strup (name, -1);
-                if (strcmp (filename, "VIDEO_TS") == 0) {
-                        done = TRUE;
-                        is_dvd_video = TRUE;
-                }
-
-                g_free (filename);
-        }
-
-        g_object_unref (file);
-        g_object_unref (enumerator);
+	GFile           *file;
+	gboolean         is_dvd_video;
+	char           **content_types;
+	guint            i;
+
+	is_dvd_video = FALSE;
+
+	file = g_file_new_for_uri (BURN_URI);
+	content_types = g_content_type_guess_for_tree (file);
+	g_object_unref (file);
+
+	for (i = 0; content_types[i] != NULL; i++) {
+		if (g_str_equal (content_types[i], "x-content/video-dvd") != FALSE) {
+			is_dvd_video = TRUE;
+			break;
+		}
+	}
+	g_strfreev (content_types);
 
-        return is_dvd_video;
+	return is_dvd_video;
 }
 
 static NautilusBurnRecorderTrack *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]