commit 2fba5270ed84d1bfcd50973f4eb429e65b5b6658
Author: Christophe Fergeau <[email protected]>
Date:   Wed Nov 11 15:37:13 2009 +0100

    add private data to Itdb_Playlist

 src/itdb.h          |    5 +++--
 src/itdb_playlist.c |    7 +++++++
 src/itdb_private.h  |    3 +++
 3 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/src/itdb.h b/src/itdb.h
index 0137451..6868e60 100644
--- a/src/itdb.h
+++ b/src/itdb.h
@@ -1047,6 +1047,7 @@ struct _Itdb_PhotoAlbum
     ItdbUserDataDestroyFunc userdata_destroy;
 };
 
+typedef struct _Itdb_Playlist_Private Itdb_Playlist_Private;
 /**
  * Itdb_Playlist:
  * @itdb:               A pointer to the #Itdb_iTunesDB (for convenience)
@@ -1074,7 +1075,7 @@ struct _Itdb_PhotoAlbum
  * @reserved101:        Reserved for MHOD100 implementation
  * @reserved_int1:      Reserved for future use
  * @reserved_int2:      Reserved for future use
- * @reserved1:          Reserved for future use
+ * @priv:               Private data
  * @reserved2:          Reserved for future use
  * @usertype:           For use by application
  * @userdata:           For use by application
@@ -1105,7 +1106,7 @@ struct _Itdb_Playlist
     /* reserved for future use */
     gint32 reserved_int1;
     gint32 reserved_int2;
-    gpointer reserved1;
+    Itdb_Playlist_Private *priv;
     gpointer reserved2;
     /* below is for use by application */
     guint64 usertype;
diff --git a/src/itdb_playlist.c b/src/itdb_playlist.c
index e5c9e6b..88eba70 100644
--- a/src/itdb_playlist.c
+++ b/src/itdb_playlist.c
@@ -1166,6 +1166,9 @@ Itdb_Playlist *itdb_playlist_duplicate (Itdb_Playlist *pl)
     if (pl->userdata && pl->userdata_duplicate)
        pl_dup->userdata = pl->userdata_duplicate (pl->userdata);
 
+    /* Copy private data too */
+    pl_dup->priv = g_memdup (pl->priv, sizeof (Itdb_Playlist_Private));
+
     return pl_dup;
 }
 
@@ -1241,6 +1244,8 @@ Itdb_Playlist *itdb_playlist_new (const gchar *title, 
gboolean spl)
        /* add at least one rule */
        itdb_splr_add_new (pl, 0);
     }
+    pl->priv = g_new0 (Itdb_Playlist_Private, 1);
+
     return pl;
 }
 
@@ -1260,6 +1265,8 @@ void itdb_playlist_free (Itdb_Playlist *pl)
     g_list_free (pl->splrules.rules);
     if (pl->userdata && pl->userdata_destroy)
        (*pl->userdata_destroy) (pl->userdata);
+
+    g_free (pl->priv);
     g_free (pl);
 }
 
diff --git a/src/itdb_private.h b/src/itdb_private.h
index ee1f229..c190251 100644
--- a/src/itdb_private.h
+++ b/src/itdb_private.h
@@ -185,6 +185,9 @@ struct _Itdb_Track_Private {
        guint32 artist_id;
 };
 
+struct _Itdb_Playlist_Private {
+};
+
 G_GNUC_INTERNAL gboolean itdb_spl_action_known (ItdbSPLAction action);
 G_GNUC_INTERNAL void itdb_splr_free (Itdb_SPLRule *splr);
 G_GNUC_INTERNAL const gchar *itdb_photodb_get_mountpoint (Itdb_PhotoDB 
*photodb);

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to