How should we handle a forward slash "/" in new file and rename dialogs?

Mark markg85 at gmail.com
Fri Nov 2 21:08:47 GMT 2012


On Tue, Oct 30, 2012 at 10:39 PM, Frank Reininghaus
<frank78ac at googlemail.com> wrote:
>
> Hi Mark and Emmanuel,
>
> thanks for your investigations!
>
> 2012/10/30 Mark:
> > Hi,
> >
> > I'm doing a bit of dolphin bug triaging and encountered a few bugs
> > already that have something to do with a "/" in a filename. See [1]
> > and [2]. I can see a few possible solutions here.
> >
> > 1. "/" is forbidden.
> > --------------------------------------
> > Since "/" is a directory seperator it might just be unwise to even
> > consider using it in a filename. Also, if dolphin supports this it's
> > by far a certainty that others support it as well.
> >
> > 2. Replace "/" by "⁄".
> > --------------------------------------
> > It looks like a slash but is a divider sign. This might be a workable
> > solution but will change the user input (a "/") to the divider symbol.
>
> it seems that this currently happens when renaming with the rename
> dialog, even though I can't see why this could make sense. Before we
> discuss this further, could someone investigate where in the code the
> replacement happens and why it's done?
>
> Best regards,
> Frank


I've done a few hours (!!) of digging just to find where the / is
replaced by a ⁄ and couldn't find it within the dolphin sources.
Actually, the new file stuff all seems to be going through
DolphinNewFileMenu which goos back to a KNewFileMenu which can be
found here: http://api.kde.org/4.9-api/kdelibs-apidocs/kfile/html/knewfilemenu_8cpp_source.html
>From there on i'm losing it's path since i'm trying to follow the
KInputDialog, but that class in only included in that file, not
actually used.

Adding David to the CC since he might know more here? (he is in the
author list of that file). David, what i'm trying to figure out is why
a "/" is replaced by a "⁄" (notice the subtle difference) when it's
used inside a filename. A "\" doesn't get replaced and just works as
expected.




More information about the kfm-devel mailing list