commit aefe4550792dc95f1814dcbb4bf53a10261b25ba
Author: phantomjinx <[email protected]>
Date: Sun May 15 18:31:52 2011 +0100
Errors not being cascaded in write file info function
* file.c
* modifies filetype_write_file_info function to avoid throwing away the
populated GError.
* filetype_iface.c
* Ensure that the no functions have supported logging
* mp4file.c
* Better explanation of unsupported mp4 files
libgtkpod/file.c | 8 ++++----
libgtkpod/filetype_iface.c | 9 ++++++++-
plugins/filetype_mp4/mp4file.c | 2 +-
3 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/libgtkpod/file.c b/libgtkpod/file.c
index 28921da..b73bb2e 100644
--- a/libgtkpod/file.c
+++ b/libgtkpod/file.c
@@ -1675,14 +1675,14 @@ gboolean add_track_by_filename(iTunesDB *itdb, gchar
*fname, Playlist *plitem, g
\*------------------------------------------------------------------*/
/* Call the correct tag writing function for the filename @name */
-static gboolean file_write_info(gchar *name, Track *track, GError *error) {
+static gboolean file_write_info(gchar *name, Track *track, GError **error) {
FileType *filetype;
g_return_val_if_fail (name, FALSE);
g_return_val_if_fail (track, FALSE);
filetype = determine_filetype(name);
- return filetype_write_file_info(filetype, name, track, &error);
+ return filetype_write_file_info(filetype, name, track, error);
}
/* Write tags to file */
@@ -1717,7 +1717,7 @@ gboolean write_tags_to_file(Track *track) {
}
if (etr->pc_path_locale && (strlen(etr->pc_path_locale) > 0)) {
- if (! file_write_info(etr->pc_path_locale, track, error)) {
+ if (! file_write_info(etr->pc_path_locale, track, &error)) {
gchar *msg = g_strdup_printf(_("Couldn't change tags of file:
%s"), etr->pc_path_locale);
if (error) {
gtkpod_warning("%s\n%s", msg, error->message);
@@ -1733,7 +1733,7 @@ gboolean write_tags_to_file(Track *track) {
if (!get_offline(itdb) && track->transferred && track->ipod_path &&
(g_utf8_strlen(track->ipod_path, -1) > 0)) {
/* need to get ipod filename */
ipod_fullpath = get_file_name_from_source(track, SOURCE_IPOD);
- if (!file_write_info(ipod_fullpath, track, error)) {
+ if (!file_write_info(ipod_fullpath, track, &error)) {
gchar *msg = g_strdup_printf(_("Couldn't change tags of file:
%s\n"), ipod_fullpath);
if (error) {
gtkpod_warning("%s\n%s", msg, error->message);
diff --git a/libgtkpod/filetype_iface.c b/libgtkpod/filetype_iface.c
index 06bb952..2d14ed1 100644
--- a/libgtkpod/filetype_iface.c
+++ b/libgtkpod/filetype_iface.c
@@ -170,14 +170,17 @@ gboolean filetype_is_audio_filetype(FileType *filetype) {
}
Track *filetype_no_track_info(const gchar *name, GError **error) {
+ gtkpod_log_error(error, _("Error: Track info for this file type not
supported."));
return NULL;
}
gboolean filetype_no_write_file_info(const gchar *filename, Track *track,
GError **error) {
+ gtkpod_log_error(error, _("Error: Writing track info to files of this file
type is not supported."));
return FALSE;
}
gboolean filetype_no_soundcheck(const gchar *filename, Track *track, GError
**error) {
+ gtkpod_log_error(error, _("Error: Limiting of sound level not supported
for this file type."));
return FALSE;
}
@@ -187,15 +190,19 @@ gchar *filetype_no_gain_cmd() {
gboolean filetype_no_read_lyrics(const gchar *filename, gchar **lyrics, GError
**error) {
gtkpod_log_error (error,
- _("Error: Lyrics not supported for this file format."));
+ _("Error: Lyrics not supported for this file type."));
return FALSE;
}
gboolean filetype_no_write_lyrics(const gchar *filename, const gchar *lyrics,
GError **error) {
+ gtkpod_log_error (error,
+ _("Error: Writing of lyrics is not supported for this file
type."));
return FALSE;
}
gboolean filetype_no_read_gapless(const gchar *filename, Track *track, GError
**error) {
+ gtkpod_log_error (error,
+ _("Error: Gapless playback for this file type is not
supported."));
return FALSE;
}
diff --git a/plugins/filetype_mp4/mp4file.c b/plugins/filetype_mp4/mp4file.c
index 7e41f4b..11582e6 100644
--- a/plugins/filetype_mp4/mp4file.c
+++ b/plugins/filetype_mp4/mp4file.c
@@ -991,7 +991,7 @@ gboolean mp4_write_file_info(const gchar *mp4FileName,
Track *track, GError **er
else {
gchar *filename = charset_to_utf8(mp4FileName);
gtkpod_log_error(error,
- g_strdup_printf(_("'%s' does not
appear to be a m4a/m4b/m4v/mp4 audio file.\n"), filename));
+ g_strdup_printf(_("Only writing to
m4a/m4b/m4v/mp4 audio tracks is supported. '%s' is not one of these file
formats.\n"), filename));
g_free(filename);
result = FALSE;
}
------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2