modify default workspace
This commit is contained in:
parent
51a7bbf301
commit
4bfd45d287
@ -43,13 +43,13 @@ WorkSpace* WorkSpaceManager::LoadDefaultWorkspace(class OEScene* secen) {
|
|||||||
|
|
||||||
WorkSpace* workspace = nullptr;
|
WorkSpace* workspace = nullptr;
|
||||||
|
|
||||||
const QString workspaceDir = Application::GetWorkSpacePath();
|
|
||||||
QFileInfo fileInfo(path);
|
QFileInfo fileInfo(path);
|
||||||
QString newPath = QString("%1/%2/%3").arg(workspaceDir).arg(fileInfo.baseName()).arg(fileInfo.fileName());
|
if (fileInfo.exists()) {
|
||||||
QFileInfo newFileInfo(newPath);
|
workspace = LoadDyt(path);
|
||||||
if (newFileInfo.exists()) {
|
|
||||||
workspace = LoadDyt(newPath);
|
|
||||||
} else {
|
} else {
|
||||||
|
const QString workspaceDir = Application::GetWorkSpacePath();
|
||||||
|
QString newPath = QString("%1/%2/%3").arg(workspaceDir).arg(fileInfo.baseName()).arg(fileInfo.fileName());
|
||||||
|
QFileInfo newFileInfo(newPath);
|
||||||
newPath = QString("%1/%2").arg(workspaceDir).arg(fileInfo.fileName());
|
newPath = QString("%1/%2").arg(workspaceDir).arg(fileInfo.fileName());
|
||||||
workspace = LoadDyt(newPath);
|
workspace = LoadDyt(newPath);
|
||||||
}
|
}
|
||||||
@ -82,9 +82,11 @@ void WorkSpaceManager::SaveDefaultWorkspace() {
|
|||||||
current->Save();
|
current->Save();
|
||||||
QString path = current->GetPath();
|
QString path = current->GetPath();
|
||||||
QFileInfo fileInfo(path);
|
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);
|
QSettings settings(iniFile, QSettings::IniFormat);
|
||||||
settings.setValue("workspace/name", fileInfo.fileName());
|
settings.setValue("workspace/name", path);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WorkSpaceManager::Contains(const QString& name) const {
|
bool WorkSpaceManager::Contains(const QString& name) const {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user