Avoid spurious detaching in QDir::to/fromNativeSeparators
The new code avoids non-const detaching operations until needed and uses
a pointer into the "raw" QChar data from then on, thus skipping unneeded
checks on the reference count for further detaching.
These functions are used all the time by the file system classes so this
small optimization won't hurt. In particular, it will help users who
already use '/' when passing paths into Qt.
Reviewed-by: Peter Hartmann
(cherry picked from commit
773a6df46243831dee7559f90e33d7eff3c5c71e)
Change-Id: I27787e787b544a63c9ea1e4138bd548500104dff
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>