[brasero] Fix a problem in BraseroVideoTreeModel because of which gtk_tree_model_iter_n_children (model, NULL)



commit 0f0e1e9f3f0a029235a234ed44638d3231e52f07
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Wed Jul 15 21:09:23 2009 +0200

    Fix a problem in BraseroVideoTreeModel because of which gtk_tree_model_iter_n_children (model, NULL) always returned 0

 src/brasero-video-tree-model.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/src/brasero-video-tree-model.c b/src/brasero-video-tree-model.c
index e511afd..1f13af7 100644
--- a/src/brasero-video-tree-model.c
+++ b/src/brasero-video-tree-model.c
@@ -102,6 +102,30 @@ static gint
 brasero_video_tree_model_iter_n_children (GtkTreeModel *model,
 					  GtkTreeIter *iter)
 {
+	if (!iter) {
+		guint num = 0;
+		GSList *iter;
+		GSList * tracks;
+		BraseroVideoTreeModelPrivate *priv;
+
+		priv = BRASERO_VIDEO_TREE_MODEL_PRIVATE (model);
+
+		/* This is a special case in which we return the number
+		 * of rows that are in the model. */
+		tracks = brasero_burn_session_get_tracks (BRASERO_BURN_SESSION (priv->session));
+		for (iter = tracks; iter; iter = iter->next) {
+			BraseroTrackStream *track;
+
+			track = iter->data;
+			num ++;
+
+			if (brasero_track_stream_get_gap (track) > 0)
+				num ++;
+		}
+
+		return num;
+	}
+
 	return 0;
 }
 



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