Bug 132961

Summary: fails to open a directory with parenthesis from tag editor
Product: [Applications] amarok Reporter: richlv
Component: generalAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Slackware   
OS: Linux   
Latest Commit: Version Fixed In:

Description richlv 2006-08-25 11:19:52 UTC
Version:           svn (using KDE KDE 3.5.4)
Installed from:    Slackware Packages
OS:                Linux

i was sure i reported this - but probably encountered some problems during reporting...

make a directory with parenthesis, place a music file there. add it to amarok playlist, open it's properties in the tag editor. click on the folder icon besides location field.

An error occurred while loading file:///mnt/net/whatever/VA/VA - French Reggae Ska 3 %25282002%2529:
The file or folder /mnt/net/whatever/VA/VA - French Reggae Ska 3 %282002%29 does not exist.

as can be seen, parenthesis are replaced by %28 & %29, and konqueror fails to open such a directory.
Comment 1 Andrew Turner 2006-10-16 17:07:01 UTC
Fixed in revision 596032.

Index: ChangeLog
===================================================================
--- ChangeLog   (revision 595854)
+++ ChangeLog   (working copy)
@@ -51,6 +51,8 @@
     * Show a proper tag dialog when viewing information for DAAP music shares.

   BUGFIXES:
+    * Fix loading directory in external browser in the tag editor when the path
+      contains parentheses. (BR 132961)
     * Stop scripts using a proxy when it's disabled in KDE. Patch by Felix Geyer
       <sniperbeamer_disc1@fobos.de>.
     * While playing Last.fm Streams, sometimes metadata wouldn't be updated
Index: src/app.cpp
===================================================================
--- src/app.cpp (revision 595854)
+++ src/app.cpp (working copy)
@@ -1184,11 +1184,8 @@

     bool invokeBrowser( const QString& url )
     {
-        const QString cmd = "%1 \"%2\"";
-        QString cleanUrl( url );
-        cleanUrl.replace( "(", "%28" ).replace( ")", "%29" );
-        int pid = KRun::runCommand( cmd.arg( AmarokConfig::externalBrowser(), cleanUrl ) );
-        return pid > 0;
+        //URL can be in whatever forms KURL::fromPathOrURL understands - ie most.
+        return KRun::run( AmarokConfig::externalBrowser(), KURL::List( KURL::fromPathOrURL( url ) ) ) > 0;
     }

     namespace ColorScheme