Bug 123011

Summary: kfmclient exec with anchor URL discards anchor
Product: [Frameworks and Libraries] kio Reporter: Martin Koller <kollix>
Component: generalAssignee: David Faure <faure>
Status: RESOLVED FIXED    
Severity: normal CC: krammer, lecit
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Martin Koller 2006-03-03 11:56:01 UTC
Version:            (using KDE KDE 3.5.1)
Installed from:    Compiled From Sources
OS:                Linux

kfmclient exec file:/tmp/h#123

(where konqi is my default browser)

opens konqi with "file:/tmp/h"  => so it removes the anchor

When I start konqueror file:/tmp/h#123
this works correctly.

I can not use openURL instead, because this does not honor the filetype
setting (e.g. starting netscape instead)
Comment 1 Thiago Macieira 2006-03-04 15:15:46 UTC
I can confirm this, 3.5 r512077.
Comment 2 Kevin Krammer 2006-08-13 14:52:28 UTC
I tracked it down to KRunMX2::subst where it treats URLs of local files differently in the case of %u being specified in the application's .desktop file

Stephan Kulow thinks it might be an overoptimization.

Something like this could help:
Index: krun.cpp
===================================================================
--- krun.cpp    (Revision 572496)
+++ krun.cpp    (Arbeitskopie)
@@ -296,7 +296,7 @@
 {
    switch( option ) {
    case 'u':
-      ret << (url.isLocalFile() ? url.path() : url.url());
+      ret << url.url();
       break;
    case 'd':
       ret << url.directory();

I am reassing it to kdelibs, maybe someone with more knowledge about KIO can have a look at it
Comment 3 David Faure 2006-08-16 21:54:26 UTC
Fixed with pathOrUrl() to avoid confusing apps with file urls in the common case (no query & no ref).