Please stop the bleeding, now! And use the cross-platform directory / path wrapper class. Some have Qt: QDir, QFileInfo, QFile. Just use them.
ooh, and QDir has a nice static method for you that does exactly what you want:
path = QDir::fromNativeSeparators(path);
There is no excuse to do this manually (with errors)
source share