- Add patch for new totem-pl-parser API

This commit is contained in:
Bastien Nocera 2010-01-26 15:04:31 +00:00
parent a2bed72f15
commit 3d0e65537b
2 changed files with 123 additions and 1 deletions

View File

@ -0,0 +1,115 @@
From 7b65e83fa697ff53bbb9fd9356b8a0dda3050305 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlos@lanedo.com>
Date: Wed, 23 Dec 2009 16:37:19 +0100
Subject: [PATCH] Use totem_pl_parser_save() for playlist saving.
This newer API doesn't require a GtkTreeModel for writing a
playlist.
https://bugzilla.gnome.org/show_bug.cgi?id=605314
---
src/brasero-project-parse.c | 59 ++++++++++++++-----------------------------
1 files changed, 19 insertions(+), 40 deletions(-)
diff --git a/src/brasero-project-parse.c b/src/brasero-project-parse.c
index bcb8fd6..a49b920 100644
--- a/src/brasero-project-parse.c
+++ b/src/brasero-project-parse.c
@@ -1058,21 +1058,6 @@ error:
#ifdef BUILD_PLAYLIST
-static void
-brasero_project_save_audio_playlist_entry (GtkTreeModel *model,
- GtkTreeIter *iter,
- gchar **uri,
- gchar **title,
- gboolean *custom_title,
- gpointer user_data)
-{
- gtk_tree_model_get (model, iter,
- 0, uri,
- 1, title,
- 2, custom_title,
- -1);
-}
-
gboolean
brasero_project_save_audio_project_playlist (BraseroBurnSession *session,
const gchar *uri,
@@ -1080,34 +1065,33 @@ brasero_project_save_audio_project_playlist (BraseroBurnSession *session,
{
TotemPlParserType pl_type;
TotemPlParser *parser;
- GtkListStore *model;
- GtkTreeIter t_iter;
+ TotemPlPlaylist *playlist;
+ TotemPlPlaylistIter pl_iter;
gboolean result;
+ GFile *file;
GSList *iter;
- gchar *path;
-
- path = g_filename_from_uri (uri, NULL, NULL);
- if (!path)
- return FALSE;
+ file = g_file_new_for_uri (uri);
parser = totem_pl_parser_new ();
+ playlist = totem_pl_playlist_new ();
- /* create and populate treemodel */
- model = gtk_list_store_new (3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
+ /* populate playlist */
iter = brasero_burn_session_get_tracks (session);
for (; iter; iter = iter->next) {
BraseroTrackStream *track;
+ const gchar *title;
gchar *uri;
track = iter->data;
uri = brasero_track_stream_get_source (track, TRUE);
- gtk_list_store_append (model, &t_iter);
- gtk_list_store_set (model, &t_iter,
- 0, uri,
- 1, brasero_track_tag_lookup_string (BRASERO_TRACK (track), BRASERO_TRACK_STREAM_TITLE_TAG),
- 2, TRUE,
- -1);
+ title = brasero_track_tag_lookup_string (BRASERO_TRACK (track), BRASERO_TRACK_STREAM_TITLE_TAG);
+
+ totem_pl_playlist_append (playlist, &pl_iter);
+ totem_pl_playlist_set (playlist, &pl_iter,
+ TOTEM_PL_PARSER_FIELD_URI, uri,
+ TOTEM_PL_PARSER_FIELD_TITLE, title,
+ NULL);
g_free (uri);
}
@@ -1128,18 +1112,13 @@ brasero_project_save_audio_project_playlist (BraseroBurnSession *session,
break;
}
- result = totem_pl_parser_write_with_title (parser,
- GTK_TREE_MODEL (model),
- brasero_project_save_audio_playlist_entry,
- path,
- brasero_burn_session_get_label (session),
- pl_type,
- NULL,
- NULL);
+ result = totem_pl_parser_save (parser, playlist, file,
+ brasero_burn_session_get_label (session),
+ type, NULL);
- g_object_unref (model);
+ g_object_unref (playlist);
g_object_unref (parser);
- g_free (path);
+ g_object_unref (file);
return result;
}
--
1.6.6

View File

@ -6,13 +6,16 @@
Name: brasero
Version: 2.29.4
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Gnome CD/DVD burning application
Group: Applications/Multimedia
License: GPLv2+
URL: http://www.gnome.org/projects/brasero/
Source0: http://ftp.gnome.org/pub/GNOME/sources/brasero/2.29/%{name}-%{version}.tar.bz2
# https://bugzilla.gnome.org/show_bug.cgi?id=605314
Patch0: 0001-Use-totem_pl_parser_save-for-playlist-saving.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: glib2-devel >= 2.15.6
@ -96,6 +99,7 @@ developing brasero applications.
%prep
%setup -q
%patch0 -p1 -b .plparse
%build
%configure \
@ -213,6 +217,9 @@ fi
%changelog
* Tue Jan 26 2010 Bastien Nocera <bnocera@redhat.com> 2.29.4-2
- Add patch for new totem-pl-parser API
* Tue Dec 22 2009 Matthias Clasen <mclasen@redhat.com> 2.29.4-1
- Update to 2.29.4