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

Function DirNameFromString

launcher/FileSystem.cpp:885–903  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

883}
884
885QString DirNameFromString(QString string, QString inDir)
886{
887 int num = 0;
888 QString baseName = RemoveInvalidFilenameChars(string, '-');
889 QString dirName;
890 do {
891 if (num == 0) {
892 dirName = baseName;
893 } else {
894 dirName = baseName + "(" + QString::number(num) + ")";
895 }
896
897 // If it's over 9000
898 if (num > 9000)
899 return "";
900 num++;
901 } while (QFileInfo(PathCombine(inDir, dirName)).exists());
902 return dirName;
903}
904
905// Does the folder path contain any '!'? If yes, return true, otherwise false.
906// (This is a problem for Java)

Callers 3

commitStagedInstanceMethod · 0.85
installMethod · 0.85
renameMethod · 0.85

Calls 4

QFileInfoClass · 0.85
PathCombineFunction · 0.85
existsMethod · 0.80

Tested by

no test coverage detected