I always use '/' for my path, I use to native path only when doing command or when needed. I also have toWindowsPath toUnixPath functions when doing cross platform request (non native call). The cleanPath() could be useful indeed, but if i remeber well I had some special edge case I wanted to cover. Anyway my unit test seem to indicate this work properly. If you come with a better solution, I could try it, I did not spend too much time on this.
________________________________ From: Interest <[email protected]> on behalf of Hamish Moffatt <[email protected]> Sent: Monday, August 26, 2019 7:59 PM To: [email protected] <[email protected]> Subject: Re: [Interest] equivalent of python glob On 27/8/19 12:33 am, Jérôme Godbout wrote: > This is what I did for pathJoin > > const QString SEPARATOR("/"); > QString FileSystemUtil::pathJoin(const QStringList& paths) Thanks. You could do that simpler with QDir::cleanPath() and QDir::toNativeSeparators() I think (and not have to hardcode the separator). I got my glob working with a mix of QDir, QFileInfo and QDirIterator. I think it's a shame there isn't something simpler built in to C++ or Qt though. Hamish _______________________________________________ Interest mailing list [email protected] https://lists.qt-project.org/listinfo/interest
_______________________________________________ Interest mailing list [email protected] https://lists.qt-project.org/listinfo/interest
