[brasero] Deprecates brasero_track_data_get_excluded () and add brasero_track_data_get_excluded_list ()



commit 4ebb94678a431f4a8b43ed523c93f4bc463cc955
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Thu Nov 5 21:04:40 2009 +0100

    Deprecates brasero_track_data_get_excluded () and add brasero_track_data_get_excluded_list ()
    The former function was a problem for GI

 libbrasero-burn/brasero-track-data.c   |   31 ++++++++++++++++++++++++++++---
 libbrasero-burn/brasero-track-data.h   |    3 +++
 plugins/checksum/burn-checksum-files.c |   11 +++++++++--
 plugins/libburnia/burn-libisofs.c      |    2 +-
 plugins/local-track/burn-local-image.c |    2 +-
 plugins/local-track/burn-uri.c         |    2 +-
 src/brasero-project-parse.c            |    2 +-
 7 files changed, 44 insertions(+), 9 deletions(-)
---
diff --git a/libbrasero-burn/brasero-track-data.c b/libbrasero-burn/brasero-track-data.c
index fe0b3ba..92c5d0c 100644
--- a/libbrasero-burn/brasero-track-data.c
+++ b/libbrasero-burn/brasero-track-data.c
@@ -366,6 +366,30 @@ brasero_track_data_get_grafts_real (BraseroTrackData *track)
 }
 
 /**
+ * brasero_track_data_get_excluded_list:
+ * @track: a #BraseroTrackData.
+ *
+ * Returns a list of URIs which must not be included in
+ * the image to be created.
+ * Do not free the list or any of the URIs after
+ * usage as @track retains ownership.
+ *
+ * Return value: (transfer none) (element-type utf8) (allow-none): a #GSList of #gchar * or %NULL if no
+ * URI should be excluded.
+ **/
+
+GSList *
+brasero_track_data_get_excluded_list (BraseroTrackData *track)
+{
+	BraseroTrackDataClass *klass;
+
+	g_return_val_if_fail (BRASERO_IS_TRACK_DATA (track), NULL);
+
+	klass = BRASERO_TRACK_DATA_GET_CLASS (track);
+	return klass->get_excluded (track);
+}
+
+/**
  * brasero_track_data_get_excluded:
  * @track: a #BraseroTrackData.
  * @copy: a #gboolean.
@@ -376,11 +400,12 @@ brasero_track_data_get_grafts_real (BraseroTrackData *track)
  * be freed once it is not needed anymore. If %FALSE,
  * do not free after usage as @track retains ownership.
  *
- * Return value: (transfer none) (element-type utf8) (allow-none): a #GSList of #gchar * or %NULL if no
+ * Deprecated since 2.29.2
+ *
+ * Return value: a #GSList of #gchar * or %NULL if no
  * URI should be excluded.
  **/
-/* FIXME the copy option is not easy for bindings
- * we should probably use (allow-none) (default FALSE) */
+
 GSList *
 brasero_track_data_get_excluded (BraseroTrackData *track,
 				 gboolean copy)
diff --git a/libbrasero-burn/brasero-track-data.h b/libbrasero-burn/brasero-track-data.h
index a44bf24..3915aee 100644
--- a/libbrasero-burn/brasero-track-data.h
+++ b/libbrasero-burn/brasero-track-data.h
@@ -124,6 +124,9 @@ GSList *
 brasero_track_data_get_grafts (BraseroTrackData *track);
 
 GSList *
+brasero_track_data_get_excluded_list (BraseroTrackData *track);
+
+GSList *
 brasero_track_data_get_excluded (BraseroTrackData *track,
 				 gboolean copy);
 
diff --git a/plugins/checksum/burn-checksum-files.c b/plugins/checksum/burn-checksum-files.c
index efea627..32ffec7 100644
--- a/plugins/checksum/burn-checksum-files.c
+++ b/plugins/checksum/burn-checksum-files.c
@@ -596,7 +596,7 @@ brasero_checksum_files_create_checksum (BraseroChecksumFiles *self,
 
 	/* we fill a hash table with all the files that are excluded globally */
 	excludedH = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
-	iter = brasero_track_data_get_excluded (BRASERO_TRACK_DATA (track), FALSE);
+	iter = brasero_track_data_get_excluded_list (BRASERO_TRACK_DATA (track));
 	for (; iter; iter = iter->next) {
 		gchar *uri;
 		gchar *path;
@@ -1127,6 +1127,7 @@ brasero_checksum_files_end (gpointer data)
 
 	/* let's create a new DATA track with the md5 file created */
 	if (BRASERO_IS_TRACK_DATA (current)) {
+		GSList *iter;
 		GSList *grafts;
 		GSList *excluded;
 		BraseroGraftPt *graft;
@@ -1162,7 +1163,13 @@ brasero_checksum_files_end (gpointer data)
 				 graft->uri);
 
 		new_grafts = g_slist_prepend (new_grafts, graft);
-		excluded = brasero_track_data_get_excluded (BRASERO_TRACK_DATA (current), TRUE);
+		excluded = brasero_track_data_get_excluded_list (BRASERO_TRACK_DATA (current));
+
+		/* Duplicate the list since brasero_track_data_set_source ()
+		 * takes ownership afterwards */
+		excluded = g_slist_copy (excluded);
+		for (iter = excluded; iter; iter = iter->next)
+			iter->data = g_strdup (iter->data);
 
 		track = brasero_track_data_new ();
 		brasero_track_data_add_fs (track, brasero_track_data_get_fs (BRASERO_TRACK_DATA (current)));
diff --git a/plugins/libburnia/burn-libisofs.c b/plugins/libburnia/burn-libisofs.c
index ef6f98a..8d5d2db 100644
--- a/plugins/libburnia/burn-libisofs.c
+++ b/plugins/libburnia/burn-libisofs.c
@@ -604,7 +604,7 @@ brasero_libisofs_create_volume_thread (gpointer data)
 	grafts = g_slist_sort (grafts, brasero_libisofs_sort_graft_points);
 
 	/* add global exclusions */
-	for (excluded = brasero_track_data_get_excluded (BRASERO_TRACK_DATA (track), FALSE);
+	for (excluded = brasero_track_data_get_excluded_list (BRASERO_TRACK_DATA (track));
 	     excluded; excluded = excluded->next) {
 		gchar *uri, *local;
 
diff --git a/plugins/local-track/burn-local-image.c b/plugins/local-track/burn-local-image.c
index adb2144..1aa8104 100644
--- a/plugins/local-track/burn-local-image.c
+++ b/plugins/local-track/burn-local-image.c
@@ -406,7 +406,7 @@ brasero_local_track_update_track (BraseroLocalTrack *self)
 		/* Translate the globally excluded.
 		 * NOTE: if we can't find a parent for an excluded URI that
 		 * means it shouldn't be included. */
-		unreadable = brasero_track_data_get_excluded (BRASERO_TRACK_DATA (current), FALSE);
+		unreadable = brasero_track_data_get_excluded_list (BRASERO_TRACK_DATA (current));
 		for (; unreadable; unreadable = next) {
 			gchar *new_uri;
 
diff --git a/plugins/local-track/burn-uri.c b/plugins/local-track/burn-uri.c
index 0a139ed..56add53 100644
--- a/plugins/local-track/burn-uri.c
+++ b/plugins/local-track/burn-uri.c
@@ -498,7 +498,7 @@ brasero_burn_uri_thread (gpointer data)
 	grafts = g_slist_reverse (grafts);
 
 	/* remove all excluded starting by burn:// from the list */
-	for (src = brasero_track_data_get_excluded (BRASERO_TRACK_DATA (current), FALSE); src; src = src->next) {
+	for (src = brasero_track_data_get_excluded_list (BRASERO_TRACK_DATA (current)); src; src = src->next) {
 		gchar *uri;
 
 		uri = src->data;
diff --git a/src/brasero-project-parse.c b/src/brasero-project-parse.c
index ffacf46..404655e 100644
--- a/src/brasero-project-parse.c
+++ b/src/brasero-project-parse.c
@@ -773,7 +773,7 @@ _save_data_track_xml (xmlTextWriter *project,
 	}
 
 	/* save excluded uris */
-	iter = brasero_track_data_get_excluded (BRASERO_TRACK_DATA (track), FALSE);
+	iter = brasero_track_data_get_excluded_list (BRASERO_TRACK_DATA (track));
 	for (; iter; iter = iter->next) {
 		xmlChar *escaped;
 



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