- fix: save project's layout shouldn't modify the project file

This commit is contained in:
Roy Qu 2022-03-08 20:36:30 +08:00
parent fa9916e28e
commit 2a84679f7c
2 changed files with 11 additions and 10 deletions

View File

@ -21,6 +21,7 @@ Red Panda C++ Version 0.14.5
- fix: undo one symbol completion as a whole operation
- fix: crash when open a project that contains custom folder
- enhancement: symbol completion when editor has selection
- fix: save project's layout shouldn't modify the project file
Red Panda C++ Version 0.14.4
- enhancement: git - log

View File

@ -474,16 +474,16 @@ void Project::saveLayout()
layIni.SetLongValue(groupName,"LeftChar", editor->leftChar());
}
// remove old data from project file
SimpleIni ini;
ini.LoadFile(filename().toLocal8Bit());
groupName = toByteArray(QString("Unit%1").arg(i+1));
ini.Delete(groupName,"Open");
ini.Delete(groupName,"Top");
ini.Delete(groupName,"CursorCol");
ini.Delete(groupName,"CursorRow");
ini.Delete(groupName,"TopLine");
ini.Delete(groupName,"LeftChar");
ini.SaveFile(filename().toLocal8Bit());
// SimpleIni ini;
// ini.LoadFile(filename().toLocal8Bit());
// groupName = toByteArray(QString("Unit%1").arg(i+1));
// ini.Delete(groupName,"Open");
// ini.Delete(groupName,"Top");
// ini.Delete(groupName,"CursorCol");
// ini.Delete(groupName,"CursorRow");
// ini.Delete(groupName,"TopLine");
// ini.Delete(groupName,"LeftChar");
// ini.SaveFile(filename().toLocal8Bit());
}
layIni.SaveFile(changeFileExt(filename(), "layout").toLocal8Bit());
}