[Easytag-mailing] Patch for EasyTAG 0.30a ( -> 0.30b )



Hi,

      Here is a patch to fix a bug that doesn't save the changed files,
which aren't selected, when changing of directory or exiting, even if
you select the button "Yes" in the dialog box.

Jerome


--
EasyTAG - Tag editor for MP3 and Ogg Vorbis files
http://easytag.sourceforge.net
--
Jerome COUDERC <j couderc ifrance com>







diff -ruN easytag-0.30a/configure easytag-0.30b/configure
--- easytag-0.30a/configure	Sat Oct 18 19:18:41 2003
+++ easytag-0.30b/configure	Sat Oct 18 19:21:15 2003
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.53 for easytag 0.30a.
+# Generated by GNU Autoconf 2.53 for easytag 0.30b.
 #
 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
 # Free Software Foundation, Inc.
@@ -412,8 +412,8 @@
 # Identity of this package.
 PACKAGE_NAME='easytag'
 PACKAGE_TARNAME='easytag'
-PACKAGE_VERSION='0.30a'
-PACKAGE_STRING='easytag 0.30a'
+PACKAGE_VERSION='0.30b'
+PACKAGE_STRING='easytag 0.30b'
 PACKAGE_BUGREPORT=''
 
 ac_unique_file="src/easytag.h"
@@ -918,7 +918,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures easytag 0.30a to adapt to many kinds of systems.
+\`configure' configures easytag 0.30b to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -984,7 +984,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of easytag 0.30a:";;
+     short | recursive ) echo "Configuration of easytag 0.30b:";;
    esac
   cat <<\_ACEOF
 
@@ -1092,7 +1092,7 @@
 test -n "$ac_init_help" && exit 0
 if $ac_init_version; then
   cat <<\_ACEOF
-easytag configure 0.30a
+easytag configure 0.30b
 generated by GNU Autoconf 2.53
 
 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
@@ -1107,7 +1107,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by easytag $as_me 0.30a, which was
+It was created by easytag $as_me 0.30b, which was
 generated by GNU Autoconf 2.53.  Invocation command line was
 
   $ $0 $@
@@ -1639,7 +1639,7 @@
 
 # Define the identity of the package.
  PACKAGE=easytag
- VERSION=0.30a
+ VERSION=0.30b
 
 
 cat >>confdefs.h <<_ACEOF
@@ -12653,7 +12653,7 @@
 } >&5
 cat >&5 <<_CSEOF
 
-This file was extended by easytag $as_me 0.30a, which was
+This file was extended by easytag $as_me 0.30b, which was
 generated by GNU Autoconf 2.53.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -12715,7 +12715,7 @@
 
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-easytag config.status 0.30a
+easytag config.status 0.30b
 configured by $0, generated by GNU Autoconf 2.53,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
diff -ruN easytag-0.30a/configure.in easytag-0.30b/configure.in
--- easytag-0.30a/configure.in	Sat Oct 18 19:18:41 2003
+++ easytag-0.30b/configure.in	Sat Oct 18 19:21:39 2003
@@ -6,7 +6,7 @@
 dnl VERSION=0.28
 
 AC_PREREQ(2.53)
-AC_INIT(easytag, 0.30a) dnl defines ($PACKAGE, $VERSION)
+AC_INIT(easytag, 0.30b) dnl defines ($PACKAGE, $VERSION)
 AC_CONFIG_SRCDIR(src/easytag.h)
 dnl -------------------------------
 dnl Init automake
diff -ruN easytag-0.30a/easytag.spec easytag-0.30b/easytag.spec
--- easytag-0.30a/easytag.spec	Sat Oct 18 19:18:41 2003
+++ easytag-0.30b/easytag.spec	Sat Oct 18 19:21:53 2003
@@ -1,5 +1,5 @@
 %define    name      easytag
-%define    version   0.30a
+%define    version   0.30b
 %define    release   1
 %define    prefix    /usr
 
diff -ruN easytag-0.30a/src/browser.c easytag-0.30b/src/browser.c
--- easytag-0.30a/src/browser.c	Sat Sep  6 23:03:48 2003
+++ easytag-0.30b/src/browser.c	Sat Oct 18 19:26:44 2003
@@ -558,7 +558,7 @@
             switch(button)
             {
                 case BUTTON_YES:
-                    if (Save_Selected_Files_With_Answer()==-1) return;
+                    if (Save_All_Files_With_Answer()==-1) return;
                     break;
                 case BUTTON_NO:
                     break;
diff -ruN easytag-0.30a/src/easytag.c easytag-0.30b/src/easytag.c
--- easytag-0.30a/src/easytag.c	Sun Sep  7 01:02:34 2003
+++ easytag-0.30b/src/easytag.c	Sat Oct 18 19:53:01 2003
@@ -92,8 +92,9 @@
 void Rename_File      (ET_File *ETFile);
 gint Save_File        (ET_File *ETFile, gboolean multiple_files);
 gint Delete_File      (ET_File *ETFile, gboolean multiple_files);
-gint Save_File_With_Answer             (gboolean multiple_files);
+gint Save_Selected_Files_With_Answer   (void);
 gint Save_All_Files_With_Answer        (void);
+gint Save_List_Of_Files                (GList *etfilelist);
 gint Delete_Selected_Files_With_Answer (void);
 
 void Display_Usage (void);
@@ -1247,12 +1248,6 @@
 
 
 /*
- * Save_File_With_Answer: Function to save single/multiple file(s).
- *  - multiple_files = TRUE : when saving files, a msgbox appears with ability 
- *                            to do the same action for all files.
- *  - multiple_files = FALSE : appears only a msgbox to ak confirmation.
- */
-/*
  * Action when Save button is pressed
  */
 void Action_Save_Selected_Files (void)
@@ -1261,16 +1256,36 @@
 }
 
 
+gint Save_All_Files_With_Answer (void)
+{
+    GList *etfilelist;
+
+    if (!ETFileList) return FALSE;
+    etfilelist = g_list_first(ETFileList);
+    return Save_List_Of_Files(etfilelist);
+}
+
 gint Save_Selected_Files_With_Answer (void)
 {
-    gint   progress_bar_index;
-    gint   saving_answer;
+    GList *etfilelist;
+
+    etfilelist = ET_File_List_Get_Selection();
+    return Save_List_Of_Files(etfilelist);
+}
+
+/*
+ * Save_List_Of_Files: Function to save a list of files.
+ */
+gint Save_List_Of_Files (GList *etfilelist)
+{
+    gint       progress_bar_index;
+    gint       saving_answer;
+    gint       nb_files_to_save;
+    gchar     *msg;
+    GList     *etfilelist_tmp;
     ET_File   *etfile_save_position = NULL;
     File_Tag  *FileTag;
     File_Name *FileNameNew;
-    GList *etfilelist;
-    gint   nb_files_to_save;
-    gchar *msg;
 
 
     if (!ETFileList) return FALSE;
@@ -1283,15 +1298,15 @@
 
     /* Count the number of files to save */
     nb_files_to_save = 0;
-    etfilelist = ET_File_List_Get_Selection();
-    while (etfilelist)
+    etfilelist_tmp = etfilelist;
+    while (etfilelist_tmp)
     {
-        File_Tag  *filetag  = ((ET_File *)etfilelist->data)->FileTag->data;
-        File_Name *filename = ((ET_File *)etfilelist->data)->FileNameNew->data;
+        File_Tag  *filetag  = ((ET_File *)etfilelist_tmp->data)->FileTag->data;
+        File_Name *filename = ((ET_File *)etfilelist_tmp->data)->FileNameNew->data;
 
         if ( (filename && filename->saved==FALSE) || (filetag && filetag->saved==FALSE) )
             nb_files_to_save++;
-        etfilelist = etfilelist->next;
+        etfilelist_tmp = etfilelist_tmp->next;
     }
 
     /* Initialize status bar */
@@ -1312,24 +1327,24 @@
     Main_Stop_Button_Pressed = 0;
     gtk_widget_set_sensitive(TBStopButton,TRUE);
     
-    etfilelist = ET_File_List_Get_Selection();
-    while (etfilelist)
+    etfilelist_tmp = etfilelist;
+    while (etfilelist_tmp)
     {
-        FileTag     = ((ET_File *)etfilelist->data)->FileTag->data;
-        FileNameNew = ((ET_File *)etfilelist->data)->FileNameNew->data;
+        FileTag     = ((ET_File *)etfilelist_tmp->data)->FileTag->data;
+        FileNameNew = ((ET_File *)etfilelist_tmp->data)->FileNameNew->data;
         
         /* We process only the files not saved */
         if ( FileTag->saved == FALSE || FileNameNew->saved == FALSE )
         {
-            ET_Display_File_Data_To_UI((ET_File *)etfilelist->data);
-            Browser_List_Select_File((ET_File *)etfilelist->data,FALSE);
+            ET_Display_File_Data_To_UI((ET_File *)etfilelist_tmp->data);
+            Browser_List_Select_File((ET_File *)etfilelist_tmp->data,FALSE);
 
             gtk_progress_set_value(GTK_PROGRESS(ProgressBar),++progress_bar_index);
             /* Needed to refresh status bar */
             while (gtk_events_pending())
                 gtk_main_iteration();
 
-            saving_answer = Save_File((ET_File *)etfilelist->data,(nb_files_to_save>1)?TRUE:FALSE);
+            saving_answer = Save_File((ET_File *)etfilelist_tmp->data,(nb_files_to_save>1)?TRUE:FALSE);
 
             if (saving_answer == -1)
             {
@@ -1346,7 +1361,7 @@
             }
         }
 
-        etfilelist = etfilelist->next;
+        etfilelist_tmp = etfilelist_tmp->next;
         if (Main_Stop_Button_Pressed == 1 )
             break;
         
@@ -2875,7 +2890,7 @@
 void Quit_MainWindow_Save_And_Quit (void)
 {
     /* Save modified tags */
-    if (Save_Selected_Files_With_Answer() == -1) return;
+    if (Save_All_Files_With_Answer() == -1) return;
     Quit_MainWindow_Confirmed();
 }
 
diff -ruN easytag-0.30a/src/easytag.h easytag-0.30b/src/easytag.h
--- easytag-0.30a/src/easytag.h	Sun Aug 31 15:30:52 2003
+++ easytag-0.30b/src/easytag.h	Sat Oct 18 19:26:48 2003
@@ -137,6 +137,7 @@
 void Action_Undo_From_History_List      (void);
 void Action_Redo_From_History_List      (void);
 void Action_Delete_Selected_Files       (void);
+gint Save_All_Files_With_Answer         (void);
 gint Save_Selected_Files_With_Answer    (void);
 
 void Action_Main_Stop_Button_Pressed    (void);




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