Review Request 123937: On transcoding replace spaces with underscores on filename but not on path

Jonathan Monteiro jmon at orbtech.org
Mon Jan 18 20:59:33 UTC 2016


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/123937/#review91285
-----------------------------------------------------------



Adding patch attached to bug ticket.  I only did the replace on the part that wasn't in the collection.  Should '/' be used to join the paths, or is there a cross-platform way to do this?  I tested this in linux and it worked correctly.  I made sure to try a collection folder with a space.


diff --git a/src/dialogs/TrackOrganizer.cpp b/src/dialogs/TrackOrganizer.cpp
index 6e793fd..9bac314 100644
--- a/src/dialogs/TrackOrganizer.cpp
+++ b/src/dialogs/TrackOrganizer.cpp
@@ -134,8 +134,11 @@ QString TrackOrganizer::cleanPath( const QString& path ) const
         result.replace( QRegExp( m_regexPattern ), m_replaceString );
 
     result = result.simplified();
-    if( m_UnderscoresNotSpaces )
+    if( m_UnderscoresNotSpaces ) {
+        result.remove( m_folderPrefix );
         result.replace( QRegExp( "\s" ), "_" );
+        result = m_folderPrefix + "/" + result;
+    }
 
     if( m_vfatSafe )
         // we use UnixBehaviour even on windows, because even there we use / as directory

- Jonathan Monteiro


On May 29, 2015, 1:44 p.m., Taiane Ramos wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/123937/
> -----------------------------------------------------------
> 
> (Updated May 29, 2015, 1:44 p.m.)
> 
> 
> Review request for Amarok.
> 
> 
> Bugs: 342261
>     https://bugs.kde.org/show_bug.cgi?id=342261
> 
> 
> Repository: amarok
> 
> 
> Description
> -------
> 
> On transcoding replace spaces with underscores on filename but not on path
> 
> 
> Diffs
> -----
> 
>   src/dialogs/TrackOrganizer.cpp 6e793fd 
> 
> Diff: https://git.reviewboard.kde.org/r/123937/diff/
> 
> 
> Testing
> -------
> 
> Tested using a path and file name containing spaces.
> 
> 
> Thanks,
> 
> Taiane Ramos
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/amarok-devel/attachments/20160118/73cae321/attachment.html>


More information about the Amarok-devel mailing list