MCPcopy Create free account
hub / github.com/ElyPrismLauncher/Launcher / NormalizePath

Function NormalizePath

launcher/FileSystem.cpp:784–797  ·  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

782 * Other paths will be made absolute
783 */
784QString NormalizePath(QString path)
785{
786 QDir a = QDir::currentPath();
787 QString currentAbsolute = a.absolutePath();
788
789 QDir b(path);
790 QString newAbsolute = b.absolutePath();
791
792 if (newAbsolute.startsWith(currentAbsolute)) {
793 return a.relativeFilePath(newAbsolute);
794 } else {
795 return newAbsolute;
796 }
797}
798
799static const QString BAD_WIN_CHARS = "<>:\"|?*\r\n";
800static const QString BAD_NTFS_CHARS = "<>:\"|?*";

Calls

no outgoing calls

Tested by

no test coverage detected