Filter out invalid chars

Signed-off-by: Yihe Li <winmikedows@hotmail.com>
This commit is contained in:
Yihe Li 2025-03-27 06:54:10 +08:00
parent 8fea37b8b7
commit 294448a01e
No known key found for this signature in database
3 changed files with 6 additions and 6 deletions

View file

@ -388,10 +388,9 @@ void BaseInstance::setName(QString val)
emit propertiesChanged(this);
}
bool BaseInstance::syncInstanceDirName() const
bool BaseInstance::syncInstanceDirName(const QString& newRoot) const
{
auto oldRoot = instanceRoot();
auto newRoot = FS::PathCombine(QFileInfo(oldRoot).dir().absolutePath(), name());
if (oldRoot == newRoot)
return true;
if (!QFile::rename(oldRoot, newRoot))