modify default workspace

This commit is contained in:
pimin 2025-11-02 18:11:56 +08:00
parent 51a7bbf301
commit 4bfd45d287

View File

@ -43,13 +43,13 @@ WorkSpace* WorkSpaceManager::LoadDefaultWorkspace(class OEScene* secen) {
WorkSpace* workspace = nullptr;
const QString workspaceDir = Application::GetWorkSpacePath();
QFileInfo fileInfo(path);
if (fileInfo.exists()) {
workspace = LoadDyt(path);
} else {
const QString workspaceDir = Application::GetWorkSpacePath();
QString newPath = QString("%1/%2/%3").arg(workspaceDir).arg(fileInfo.baseName()).arg(fileInfo.fileName());
QFileInfo newFileInfo(newPath);
if (newFileInfo.exists()) {
workspace = LoadDyt(newPath);
} else {
newPath = QString("%1/%2").arg(workspaceDir).arg(fileInfo.fileName());
workspace = LoadDyt(newPath);
}
@ -82,9 +82,11 @@ void WorkSpaceManager::SaveDefaultWorkspace() {
current->Save();
QString path = current->GetPath();
QFileInfo fileInfo(path);
LOG_INFO("save default workspace name:{}", fileInfo.fileName().toLocal8Bit().constData());
LOG_INFO("save default workspace name:{}, path:{}",
fileInfo.fileName().toLocal8Bit().constData(),
path.toLocal8Bit().constData());
QSettings settings(iniFile, QSettings::IniFormat);
settings.setValue("workspace/name", fileInfo.fileName());
settings.setValue("workspace/name", path);
}
bool WorkSpaceManager::Contains(const QString& name) const {