- fix: Project's file encoding is wrongly set to 'AUTO' when load project.

This commit is contained in:
Roy Qu 2023-01-15 15:57:48 +08:00
parent 0f746957a5
commit dbc9a1829c
3 changed files with 3 additions and 3 deletions

View File

@ -8,6 +8,7 @@ Red Panda C++ Version 2.9
- enhancement: Auto backup editing contents. (Save editing contents 3 seconds after input stopped. Auto delete when editor successfully closed) - enhancement: Auto backup editing contents. (Save editing contents 3 seconds after input stopped. Auto delete when editor successfully closed)
- enhancement: Add "Auto backup editing contents" option in options/editor/auto save - enhancement: Add "Auto backup editing contents" option in options/editor/auto save
- fix: rename project file will wrongly set it's encoding to 'ASCII'; - fix: rename project file will wrongly set it's encoding to 'ASCII';
- fix: Project's file encoding is wrongly set to 'AUTO' when load project.
Red Panda C++ Version 2.8 Red Panda C++ Version 2.8

View File

@ -238,7 +238,7 @@ void Project::open()
newUnit->setBuildCmd(fromByteArray(ini.GetValue(groupName,"BuildCmd", ""))); newUnit->setBuildCmd(fromByteArray(ini.GetValue(groupName,"BuildCmd", "")));
QByteArray defaultEncoding = toByteArray(mOptions.encoding); QByteArray defaultEncoding = toByteArray(mOptions.encoding);
//Compatibility //Compatibility
if (ini.GetBoolValue(groupName,"DetectEncoding",true)){ if (ini.GetBoolValue(groupName,"DetectEncoding",false)){
defaultEncoding = ENCODING_AUTO_DETECT; defaultEncoding = ENCODING_AUTO_DETECT;
} }
@ -767,7 +767,6 @@ bool Project::saveUnits()
ini.SetValue(groupName,"FileEncoding", toByteArray(unit->encoding())); ini.SetValue(groupName,"FileEncoding", toByteArray(unit->encoding()));
else else
ini.Delete(groupName,"FileEncoding"); ini.Delete(groupName,"FileEncoding");
} }
ini.SetLongValue("Project","UnitCount",count); ini.SetLongValue("Project","UnitCount",count);
ini.SaveFile(mFilename.toLocal8Bit()); ini.SaveFile(mFilename.toLocal8Bit());

View File

@ -1519,7 +1519,7 @@ void Settings::Editor::doLoad()
mSyntaxCheckWhenLineChanged = boolValue("check_syntax_when_line_changed",true); mSyntaxCheckWhenLineChanged = boolValue("check_syntax_when_line_changed",true);
//auto save //auto save
mEnableEditTempBackup = boolValue("enable_edit_temp_backup",true); mEnableEditTempBackup = boolValue("enable_edit_temp_backup", false);
mEnableAutoSave = boolValue("enable_auto_save",false); mEnableAutoSave = boolValue("enable_auto_save",false);
mAutoSaveInterval = intValue("auto_save_interal",10); mAutoSaveInterval = intValue("auto_save_interal",10);
mAutoSaveTarget = static_cast<enum AutoSaveTarget>( mAutoSaveTarget = static_cast<enum AutoSaveTarget>(