mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-07-04 20:36:58 +03:00
Fix problem with instance list not using the instance folder path
This commit is contained in:
parent
9233477295
commit
6ecb833dbf
6 changed files with 134 additions and 71 deletions
|
|
@ -39,6 +39,30 @@ QString AbsolutePath(QString path)
|
|||
return QFileInfo(path).absolutePath();
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize path
|
||||
*
|
||||
* Any paths inside the current directory will be normalized to relative paths (to current)
|
||||
* Other paths will be made absolute
|
||||
*/
|
||||
QString NormalizePath(QString path)
|
||||
{
|
||||
QDir a = QDir::currentPath();
|
||||
QString currentAbsolute = a.absolutePath();
|
||||
|
||||
QDir b(path);
|
||||
QString newAbsolute = b.absolutePath();
|
||||
|
||||
if (newAbsolute.startsWith(currentAbsolute))
|
||||
{
|
||||
return a.relativeFilePath(newAbsolute);
|
||||
}
|
||||
else
|
||||
{
|
||||
return newAbsolute;
|
||||
}
|
||||
}
|
||||
|
||||
QString badFilenameChars = "\"\\/?<>:*|!";
|
||||
|
||||
QString RemoveInvalidFilenameChars(QString string, QChar replaceWith)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue