> On May 28, 2011, 9:29 a.m., David Faure wrote: > > The handling of '/' could use KIO::encodeFileName instead, for consistency. > > I agree about "." and ".." though ;) > > Mark Gaiser wrote: > I wonder.. don't we need a "isFilename" function that checks if a > filename meets all the characters that are allowed in a filename thus > returning false when it starts with a / or for example contains a *? or being > equal to . or .. ? That would make the use more "portable" since i can > imagine other apps benefiting from that (any app that needs to create a file > or folder from user input)
Filenames containing * and ? are perfectly legal. The only truly illegal characters in a unix filename are / and \0. To be portable, you need to consider the underlying filesystem in which a file is being created since this sets the rules, for example FAT has a bunch of characters that can't be used (eg. consider how a filename starting with ? would interact with its file deletion handling). Short version, I don't see how the function you propose could be implemented. - Richard J. ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/101456/#review3562 ----------------------------------------------------------- On May 28, 2011, 6:26 p.m., Matthias Fuchs wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://git.reviewboard.kde.org/r/101456/ > ----------------------------------------------------------- > > (Updated May 28, 2011, 6:26 p.m.) > > > Review request for kdelibs and David Faure. > > > Summary > ------- > > nt > > > This addresses bug 211751. > http://bugs.kde.org/show_bug.cgi?id=211751 > > > Diffs > ----- > > kio/kio/kdirmodel.cpp 6bf57be > kio/kio/kfileitemdelegate.cpp cb3939d > > Diff: http://git.reviewboard.kde.org/r/101456/diff > > > Testing > ------- > > > Thanks, > > Matthias > >
