diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/db-artwork-parser.h | 3 | ||||
-rw-r--r-- | src/db-artwork-writer.c | 8 | ||||
-rw-r--r-- | src/itdb.h | 2 | ||||
-rw-r--r-- | src/itdb_itunesdb.c | 27 | ||||
-rw-r--r-- | tests/test-write-covers.c | 2 |
7 files changed, 20 insertions, 28 deletions
@@ -1,3 +1,7 @@ +2005-10-24 Christophe Fergeau <teuf@gnome.org> + + * (itdb_write): remove mountpoint as parameter as not used. + 2005-10-20 Christophe Fergeau <teuf@gnome.org> * tests/test-covers.c: (save_song_thumbnails): fix warning on amd64 diff --git a/configure.ac b/configure.ac index 7900cf0..452dc2a 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,7 @@ AM_CONFIG_HEADER(config.h) # LIBGPOD_MAJOR_VERSION=0 LIBGPOD_MINOR_VERSION=1 -LIBGPOD_MICRO_VERSION=7 +LIBGPOD_MICRO_VERSION=8 LIBGPOD_INTERFACE_AGE=0 # If you need a modifier for the version number. # Normally empty, but can be used to make "fixup" releases. diff --git a/src/db-artwork-parser.h b/src/db-artwork-parser.h index 550f9c0..da8e743 100644 --- a/src/db-artwork-parser.h +++ b/src/db-artwork-parser.h @@ -38,8 +38,7 @@ G_GNUC_INTERNAL int ipod_parse_photo_db (const char *filename); G_GNUC_INTERNAL int ipod_parse_artwork_db (Itdb_iTunesDB *db); -G_GNUC_INTERNAL int ipod_write_artwork_db (Itdb_iTunesDB *db, - const char *mount_point); +G_GNUC_INTERNAL int ipod_write_artwork_db (Itdb_iTunesDB *db); G_GNUC_INTERNAL char *ipod_db_get_artwork_db_path (const char *mount_point); #endif diff --git a/src/db-artwork-writer.c b/src/db-artwork-writer.c index 655d05b..bf40f29 100644 --- a/src/db-artwork-writer.c +++ b/src/db-artwork-writer.c @@ -716,7 +716,7 @@ ipod_artwork_db_set_ids (Itdb_iTunesDB *db) } int -ipod_write_artwork_db (Itdb_iTunesDB *db, const char *mount_point) +ipod_write_artwork_db (Itdb_iTunesDB *db) { iPodBuffer *buf; int bytes_written; @@ -729,12 +729,12 @@ ipod_write_artwork_db (Itdb_iTunesDB *db, const char *mount_point) * the database appropriately (ie set the 'artwork_count' and * 'artwork_size' fields, as well as the 2 Itdb_Image fields */ - itdb_write_ithumb_files (db, mount_point); + itdb_write_ithumb_files (db, db->mountpoint); /* Now we can update the ArtworkDB file */ id_max = ipod_artwork_db_set_ids (db); /* FIXME: need to create the file if it doesn't exist */ - filename = ipod_db_get_artwork_db_path (mount_point); + filename = ipod_db_get_artwork_db_path (db->mountpoint); if (filename == NULL) { /* FIXME: the iTunesDB will be inconsistent wrt artwork_count * it might be better to 0 out this field in all tracks @@ -776,7 +776,7 @@ ipod_write_artwork_db (Itdb_iTunesDB *db, const char *mount_point) } #else int -ipod_write_artwork_db (Itdb_iTunesDB *db, const char *mount_point) +ipod_write_artwork_db (Itdb_iTunesDB *db) { return -1; } @@ -630,7 +630,7 @@ GQuark itdb_file_error_quark (void); /* functions for reading/writing database, general itdb functions */ Itdb_iTunesDB *itdb_parse (const gchar *mp, GError **error); Itdb_iTunesDB *itdb_parse_file (const gchar *filename, GError **error); -gboolean itdb_write (Itdb_iTunesDB *itdb, const gchar *mp, GError **error); +gboolean itdb_write (Itdb_iTunesDB *itdb, GError **error); gboolean itdb_write_file (Itdb_iTunesDB *itdb, const gchar *filename, GError **error); gboolean itdb_shuffle_write (Itdb_iTunesDB *itdb, diff --git a/src/itdb_itunesdb.c b/src/itdb_itunesdb.c index 50c269a..7405f39 100644 --- a/src/itdb_itunesdb.c +++ b/src/itdb_itunesdb.c @@ -3619,19 +3619,15 @@ gboolean itdb_write_file (Itdb_iTunesDB *itdb, const gchar *filename, Returns TRUE on success, FALSE on error, in which case @error is set accordingly. - - @mp must point to the mount point of the iPod, e.g. "/mnt/ipod" and - be in local encoding. If mp==NULL, itdb->mountpoint is tried. */ -gboolean itdb_write (Itdb_iTunesDB *itdb, const gchar *mp, GError **error) +*/ +gboolean itdb_write (Itdb_iTunesDB *itdb, GError **error) { gchar *itunes_filename, *itunes_path; const gchar *db[] = {"iPod_Control","iTunes",NULL}; gboolean result = FALSE; g_return_val_if_fail (itdb, FALSE); - g_return_val_if_fail (mp || itdb->mountpoint, FALSE); - - if (!mp) mp = itdb->mountpoint; + g_return_val_if_fail (itdb->mountpoint, FALSE); /* First, let's try to write the .ithmb files containing the artwork data * since this operation modifies the 'artwork_count' and 'artwork_size' @@ -3639,16 +3635,16 @@ gboolean itdb_write (Itdb_iTunesDB *itdb, const gchar *mp, GError **error) * Errors happening during that operation are considered non fatal since * they shouldn't corrupt the main database. */ - #if HAVE_GDKPIXBUF - ipod_write_artwork_db (itdb, mp); + ipod_write_artwork_db (itdb); #endif - itunes_path = itdb_resolve_path (mp, db); + itunes_path = itdb_resolve_path (itdb->mountpoint, db); if(!itunes_path) { - gchar *str = g_build_filename (mp, db[0], db[1], db[2], NULL); + gchar *str = g_build_filename (itdb->mountpoint, + db[0], db[1], db[2], NULL); g_set_error (error, ITDB_FILE_ERROR, ITDB_FILE_ERROR_NOTFOUND, @@ -3666,14 +3662,7 @@ gboolean itdb_write (Itdb_iTunesDB *itdb, const gchar *mp, GError **error) g_free(itunes_path); if (result == TRUE) - result = itdb_rename_files (mp, error); - - if (result == TRUE) - { - gchar *mnp = g_strdup (mp); - g_free (itdb->mountpoint); - itdb->mountpoint = mnp; - } + result = itdb_rename_files (itdb->mountpoint, error); /* make sure all buffers are flushed as some people tend to disconnect as soon as gtkpod returns */ diff --git a/tests/test-write-covers.c b/tests/test-write-covers.c index e338716..88c0216 100644 --- a/tests/test-write-covers.c +++ b/tests/test-write-covers.c @@ -117,7 +117,7 @@ main (int argc, char **argv) itdb_track_set_thumbnail (song, coverpath); }*/ - itdb_write (db, NULL, NULL); + itdb_write (db, NULL); itdb_free (db); g_list_foreach (covers, (GFunc)g_free, NULL); g_list_free (covers); |