[easytag] Replace filename characters after substitutions



commit 8afecf0a6573b6db93d91fd4e87e996301c4d495
Author: David King <amigadave amigadave com>
Date:   Tue Jan 5 16:02:40 2016 +0000

    Replace filename characters after substitutions
    
    Ensure that scanner options do not override whether illegal characters
    should be replaced in filenames, by doing the replacement after the
    substitutions. This has the effect that if underscores are to be replaced
    by spaces, and the filename has a trailing underscore, the end result
    will be a filename with an underscore.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760155

 src/scan_dialog.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/scan_dialog.c b/src/scan_dialog.c
index e78182b..13957f4 100644
--- a/src/scan_dialog.c
+++ b/src/scan_dialog.c
@@ -940,9 +940,6 @@ et_scan_generate_new_filename_from_mask (const ET_File *ETFile,
             {
                 EtConvertSpaces convert_mode;
 
-                et_filename_prepare (mask_item->string,
-                                     g_settings_get_boolean (MainSettings,
-                                                             "rename-replace-illegal-chars"));
                 convert_mode = g_settings_get_enum (MainSettings,
                                                     "rename-convert-spaces");
 
@@ -963,6 +960,13 @@ et_scan_generate_new_filename_from_mask (const ET_File *ETFile,
                     default:
                         g_assert_not_reached ();
                 }
+
+                /* This must occur after the space processing, to ensure that a
+                 * trailing space cannot be present (if illegal characters are to be
+                 * replaced). */
+                et_filename_prepare (mask_item->string,
+                                     g_settings_get_boolean (MainSettings,
+                                                             "rename-replace-illegal-chars"));
             }
         }else
         {


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