[easytag/wip/ogg-errors] Improve reporting of Ogg tagging errors



commit eef302d96805d1adfcafaeaf95110198dd07172a
Author: David King <amigadave amigadave com>
Date:   Thu May 30 22:26:14 2013 +0100

    Improve reporting of Ogg tagging errors

 src/easytag.c |   12 +++++-------
 src/ogg_tag.c |    1 -
 src/ogg_tag.h |    6 ------
 3 files changed, 5 insertions(+), 14 deletions(-)
---
diff --git a/src/easytag.c b/src/easytag.c
index 5f63e68..41c722d 100644
--- a/src/easytag.c
+++ b/src/easytag.c
@@ -2986,7 +2986,7 @@ static gboolean
 Write_File_Tag (ET_File *ETFile, gboolean hide_msgbox)
 {
     gchar *cur_filename_utf8 = ((File_Name *)ETFile->FileNameCur->data)->value_utf8;
-    gchar *msg;
+    gchar *msg = NULL;
     gchar *msg1;
     gchar *basename_utf8;
     GtkWidget *msgdialog;
@@ -3007,20 +3007,18 @@ Write_File_Tag (ET_File *ETFile, gboolean hide_msgbox)
     {
 #ifdef ENABLE_OGG
         case OGG_TAG:
-            // Special for Ogg Vorbis because the error is defined into 'vcedit_error(state)'
-            msg = ogg_error_msg;
-            msg1 = g_strdup_printf(_("Cannot write tag in file '%s' (%s)"),
-                                  basename_utf8,ogg_error_msg);
+            /* Special for Ogg Vorbis because the error was already reported in
+             * ET_Save_File_Tag_To_HD. */
             break;
 #endif
         default:
             msg = g_strdup (g_strerror (errno));
             msg1 = g_strdup_printf (_("Cannot write tag in file '%s' (%s)"),
                                     basename_utf8, msg);
+            Log_Print (LOG_ERROR, "%s", msg1);
+            g_free (msg1);
     }
 
-    Log_Print(LOG_ERROR,"%s", msg1);
-    g_free(msg1);
 
     if (!hide_msgbox)
     {
diff --git a/src/ogg_tag.c b/src/ogg_tag.c
index 724d93c..c306c3a 100644
--- a/src/ogg_tag.c
+++ b/src/ogg_tag.c
@@ -136,7 +136,6 @@ ogg_tag_read_file_tag (gchar *filename, File_Tag *FileTag, GError **error)
     g_return_val_if_fail (filename != NULL && FileTag != NULL, FALSE);
     g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
-    ogg_error_msg = NULL;
     file = g_file_new_for_path (filename);
     istream = g_file_read (file, NULL, error);
 
diff --git a/src/ogg_tag.h b/src/ogg_tag.h
index 0d41360..620731d 100644
--- a/src/ogg_tag.h
+++ b/src/ogg_tag.h
@@ -26,12 +26,6 @@
 #include <glib.h>
 #include "et_core.h"
 
-/***************
- * Declaration *
- ***************/
-gchar *ogg_error_msg;
-
-
 /**************
  * Prototypes *
  **************/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]