MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / NormalizePath

Function NormalizePath

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

305 * Other paths will be made absolute
306 */
307QString NormalizePath(QString path)
308{
309 QDir a = QDir::currentPath();
310 QString currentAbsolute = a.absolutePath();
311
312 QDir b(path);
313 QString newAbsolute = b.absolutePath();
314
315 if (newAbsolute.startsWith(currentAbsolute)) {
316 return a.relativeFilePath(newAbsolute);
317 } else {
318 return newAbsolute;
319 }
320}
321
322QString badFilenameChars = "\"\\/?<>:;*|!+\r\n";
323

Calls

no outgoing calls

Tested by

no test coverage detected