On Sunday 28 December 2014 22:54:51 Frank Reininghaus wrote:
> Hi,
> 
> 2014-12-23 9:44 GMT+01:00 David Faure:
> > On Tuesday 23 December 2014 00:59:56 Marko Käning wrote:
> >>       Fixed in
> >> 
> >> http://commits.kde.org/kio/c5522b6931908d3fd8ad97555a3edf2a3e859b50
> >> 
> >> Ooops, should I have pushed this through Gerrit before committing?
> > 
> > Nope, that's fine, trivial fix. Thanks!
> 
> Wouldn't it be better to use QDir::separator() though, in order to
> make sure that it works on non-Unix operating systems?

This seems to be a very common misconception....

All of the Qt API works fine with forward slashes.

The Windows file-engine in Qt takes care of converting if necessary for the 
underlying native calls, but Qt encapsulates all of that for us, in order to 
make application development much easier.

You only need to use QDir::separator() .... well, never, mostly ;)
If you want to display a path to the user you can use 
QDir::toNativeSeparators() and when reading a path from the user you can use 
QDir::fromNativeSeparators().

Anyway, in this commit we're not talking about user-visible stuff, so '/' is 
perfectly fine.

-- 
David Faure, fa...@kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5

_______________________________________________
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel

Reply via email to