Only call on interactive uses
Signed-off-by: Yihe Li <winmikedows@hotmail.com>
This commit is contained in:
parent
ea44c2465c
commit
8fea37b8b7
4 changed files with 22 additions and 7 deletions
|
@ -388,6 +388,17 @@ void BaseInstance::setName(QString val)
|
|||
emit propertiesChanged(this);
|
||||
}
|
||||
|
||||
bool BaseInstance::syncInstanceDirName() const
|
||||
{
|
||||
auto oldRoot = instanceRoot();
|
||||
auto newRoot = FS::PathCombine(QFileInfo(oldRoot).dir().absolutePath(), name());
|
||||
if (oldRoot == newRoot)
|
||||
return true;
|
||||
if (!QFile::rename(oldRoot, newRoot))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
QString BaseInstance::name() const
|
||||
{
|
||||
return m_settings->get("name").toString();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue