From b5623e36a85a491318198bf8e5013b0eb018e748 Mon Sep 17 00:00:00 2001 From: phantom_sf Date: Sat, 9 Aug 2008 17:00:34 +0000 Subject: 2008-08-09 Paul Richardson * Added eclipse project related files to svn:ignore * src/db-artwork-parser.c src/itdb.h src/itdb_photoalbum.c: Added to Itdb_PhotoAlbum, a reference to its parent Photo DB. When albums are constructed upon loading of the Photo DB, the reference is added as part of initialisation. git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@2096 f01d2545-417e-4e96-918e-98f8d0dbbcb6 --- ChangeLog | 10 ++++++++++ src/db-artwork-parser.c | 1 + src/itdb.h | 1 + src/itdb_photoalbum.c | 2 ++ 4 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index fa626fd..18e1380 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-08-09 Paul Richardson + + * Added eclipse project related files to svn:ignore + * src/db-artwork-parser.c + src/itdb.h + src/itdb_photoalbum.c: + Added to Itdb_PhotoAlbum, a reference to its parent Photo DB. + When albums are constructed upon loading of the Photo DB, the + reference is added as part of initialisation. + 2008-08-09 Todd Zullinger * src/itdb_playlist.c diff --git a/src/db-artwork-parser.c b/src/db-artwork-parser.c index 62cf4a1..3ee20d0 100644 --- a/src/db-artwork-parser.c +++ b/src/db-artwork-parser.c @@ -392,6 +392,7 @@ parse_mhba (DBParseContext *ctx, GError *error) g_free (mhia_ctx); photodb = db_get_photodb (ctx->db); g_return_val_if_fail (photodb, -1); + album->photodb = photodb; photodb->photoalbums = g_list_append (photodb->photoalbums, album); return 0; diff --git a/src/itdb.h b/src/itdb.h index 49d2d3c..d53f588 100644 --- a/src/itdb.h +++ b/src/itdb.h @@ -549,6 +549,7 @@ struct _Itdb_iTunesDB struct _Itdb_PhotoAlbum { + Itdb_PhotoDB *photodb; /* database to which this album belongs */ gchar *name; /* name of photoalbum in UTF8 */ GList *members; /* photos in album (Itdb_Artwork *) */ guint8 album_type; /* 0x01 for master (Photo Library), diff --git a/src/itdb_photoalbum.c b/src/itdb_photoalbum.c index 747c17e..a5e9d76 100644 --- a/src/itdb_photoalbum.c +++ b/src/itdb_photoalbum.c @@ -335,6 +335,7 @@ static void itdb_photodb_photoalbum_free (Itdb_PhotoAlbum *album) { if (album) { + album->photodb = NULL; g_free (album->name); g_list_free (album->members); @@ -735,6 +736,7 @@ Itdb_PhotoAlbum *itdb_photodb_photoalbum_create (Itdb_PhotoDB *db, album = g_new0 (Itdb_PhotoAlbum, 1); album->album_type = 2; /* normal album, set to 1 for Photo Library */ + album->photodb = db; album->name = g_strdup(albumname); db->photoalbums = g_list_insert (db->photoalbums, album, pos); -- cgit