Revision: 1515
          http://gtkpod.svn.sourceforge.net/gtkpod/?rev=1515&view=rev
Author:   jcsjcs
Date:     2007-06-01 07:19:21 -0700 (Fri, 01 Jun 2007)

Log Message:
-----------
        * src/itdb_photoalbum.c (itdb_photodb_parse): return a valid
          photodb structure including the main Photo Library album if no
          database existed, analogous to itdb_photodb_create(). Without
          this the test-photos script won't work as expected and other
          applications also would have to add extra checks for presence of
          the main Photo Libarary.

Modified Paths:
--------------
    libgpod/trunk/ChangeLog
    libgpod/trunk/src/itdb_photoalbum.c

Modified: libgpod/trunk/ChangeLog
===================================================================
--- libgpod/trunk/ChangeLog     2007-06-01 13:56:32 UTC (rev 1514)
+++ libgpod/trunk/ChangeLog     2007-06-01 14:19:21 UTC (rev 1515)
@@ -11,6 +11,13 @@
          src/db-itunes-parser.h: '#if 0' unused structure to avoid
          confusion.
 
+       * src/itdb_photoalbum.c (itdb_photodb_parse): return a valid
+         photodb structure including the main Photo Library album if no
+         database existed, analogous to itdb_photodb_create(). Without
+         this the test-photos script won't work as expected and other
+         applications also would have to add extra checks for presence of
+         the main Photo Libarary.
+
 2007-05-30  Todd Zullinger <tmzullinger at users.sourceforge.net>
 
         * bindings/python/tests/resources/iTunes/iTunesDB.ext

Modified: libgpod/trunk/src/itdb_photoalbum.c
===================================================================
--- libgpod/trunk/src/itdb_photoalbum.c 2007-06-01 13:56:32 UTC (rev 1514)
+++ libgpod/trunk/src/itdb_photoalbum.c 2007-06-01 14:19:21 UTC (rev 1515)
@@ -1,4 +1,4 @@
-/* Time-stamp: <2007-01-15 01:02:46 jcs>
+/* Time-stamp: <2007-06-01 23:03:58 jcs>
 |
 |  Copyright (C) 2002-2006 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.
@@ -224,6 +224,15 @@
     photodb = itdb_photodb_new ();
     itdb_device_set_mountpoint (photodb->device, mp);
     ipod_parse_photo_db (photodb);
+
+    /* if photodb is empty, create a valid photodb including the main
+       Photo Library album */
+    if (!photodb->photos && !photodb->photoalbums)
+    {
+       itdb_photodb_free (photodb);
+       photodb = itdb_photodb_create (mp);
+    }
+
     return photodb;
 }
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to