Bug 174864 - File->Insert File on file with colon in name fails
Summary: File->Insert File on file with colon in name fails
Status: RESOLVED FIXED
Alias: None
Product: kfile
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Michael Pyne
URL:
Keywords:
: 182648 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-11-11 14:10 UTC by Rusty Russell
Modified: 2009-05-03 03:29 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Fix inaccurate protocol detection (1.13 KB, patch)
2009-03-05 02:47 UTC, Michael Pyne
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rusty Russell 2008-11-11 14:10:56 UTC
Version:            (using KDE 4.1.2)
OS:                Linux
Installed from:    Ubuntu Packages

File is called virtio:linux_standardize_s_concept_of_page_size-fix.patch

Selecting it from dialog gave the following error dialog:

Could not start process Unable to create io-slave:
klauncher said: Unknown protocol 'virtio'.
Comment 1 FiNeX 2008-11-11 14:13:58 UTC
I'm not sure to have understood how to reproduce this issue in kontact. Could you explain better the steps?

Thanks!
Comment 2 Rusty Russell 2008-11-12 02:01:43 UTC
Sure!

$ echo something > /tmp/foo:bar
$ kontact
Press  "Mail" button
Press "New Message" button
Message->Insert File and try to select the /tmp/foo:bar file created above.

See error dialog.

Hope that helps,
Rusty.



Comment 3 FiNeX 2008-11-12 10:27:49 UTC
Thanks!

I've reproduced this problem, not only with kontact/kmail, but in every file dialog. I've got with similar error messages:

I've created a file called: "/tmp/foo:bar"

(kmail)
"The file or folder /bar does not exist."

(kate)
"The file /bar could not be loaded, as it was not possible to read from it.

Check if you have read access to this file."
Comment 4 Rafael Fernández López 2008-11-12 21:35:11 UTC
SVN commit 883396 by ereslibre:

Use QDir::isAbsolutePath instead of KUrl::isRelativeUrl. The use case is different and doesn't fit
isRelativeUrl.

BUG: 174864

 M  +2 -3      kfilewidget.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=883396
Comment 5 Rusty Russell 2008-11-12 23:08:44 UTC
Did this fix Save As as well?  I get a similar problem there (saving a mail with subject 'foo: bar' in kontact).

Thanks!
Comment 6 FiNeX 2008-11-12 23:52:36 UTC
Yeah, it fix both save and open files with ":" in the filename :-)
Comment 7 Rusty Russell 2009-03-03 23:50:50 UTC
This bug is back, worse than ever.

KDE 4:4.2.0-0ubuntu1~intrepid~ppa2

Reopening :(
Comment 8 Michael Pyne 2009-03-05 02:47:43 UTC
Created attachment 31784 [details]
Fix inaccurate protocol detection

This patch should do the trick, KFileWidget seems to be getting confused in code designed to move to the right URL if the user manually types in a full URL.  KUrl::protocol() can return something sane even if the full foo:// isn't typed (since some KIO slaves use URIs like man:write(2) for instance).

The even betterer fix would be to never redirect if the string matches a file name but I haven't made it that far yet.
Comment 9 Michael Pyne 2009-03-05 03:02:32 UTC
SVN commit 935417 by mpyne:

Use more accurate check for URI protocols in the file name field of KFileWidget to allow for filenames with
colons in the name.  Will backport to 4.2.2.

The real fix I think is to skip this action if the URI path matches a real file name in any event but this
helps bridge the gap for now.

CCBUG:174864


 M  +5 -4      kfilewidget.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=935417
Comment 10 Michael Pyne 2009-03-05 03:04:29 UTC
SVN commit 935418 by mpyne:

Backport fix for bug 174864 (Can't use file names with ':') to KDE 4.2.2.  My
trunk commit mentioned that this helps except for full protocol lines, but file
names can't contain '/' so this is actually sufficient.

BUG:174864


 M  +5 -4      kfilewidget.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=935418
Comment 11 Michael Pyne 2009-05-03 03:29:57 UTC
*** Bug 182648 has been marked as a duplicate of this bug. ***