MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / NormalizePath

Function NormalizePath

launcher/FileSystem.cpp:806–819  ·  view source on GitHub ↗

* Normalize path * * Any paths inside the current folder will be normalized to relative paths (to current) * Other paths will be made absolute */

Source from the content-addressed store, hash-verified

804 * Other paths will be made absolute
805 */
806QString NormalizePath(QString path)
807{
808 QDir a = QDir::currentPath();
809 QString currentAbsolute = a.absolutePath();
810
811 QDir b(path);
812 QString newAbsolute = b.absolutePath();
813
814 if (newAbsolute.startsWith(currentAbsolute)) {
815 return a.relativeFilePath(newAbsolute);
816 } else {
817 return newAbsolute;
818 }
819}
820
821static const QString BAD_WIN_CHARS = "<>:\"|?*\r\n";
822static const QString BAD_NTFS_CHARS = "<>:\"|?*";

Calls

no outgoing calls

Tested by

no test coverage detected