From 4f2b87662fd4889df0229be4c570da740216bf4e Mon Sep 17 00:00:00 2001 From: royqh1979 Date: Mon, 25 Oct 2021 21:59:01 +0800 Subject: [PATCH] - enhancement: use project's compiler set type info to find a nearest system compiler set, when the project compiler set is not valid. - fix: toolbar's compiler set info not correctly updated when change it in the project settings dialog. --- NEWS.md | 2 ++ RedPandaIDE/mainwindow.cpp | 1 + RedPandaIDE/project.cpp | 11 ++++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index a5b064f7..a9941513 100644 --- a/NEWS.md +++ b/NEWS.md @@ -16,6 +16,8 @@ Version 0.7.3 - enhancement: prompt for filename when create new project unit file - fix: options not correctly set when change compiler set in the project settings - change: reset compiler settings when change the project compiler set + - enhancement: use project's compiler set type info to find a nearest system compiler set, when the project compiler set is not valid. + - fix: toolbar's compiler set info not correctly updated when change it in the project settings dialog. Version 0.7.2 - fix: rainbow parenthesis stop functioning when change editor's general options diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index deab36cc..1de0b8f2 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -4108,6 +4108,7 @@ void MainWindow::on_actionProject_options_triggered() QString oldName = mProject->name(); PSettingsDialog dialog = SettingsDialog::projectOptionDialog(); dialog->exec(); + updateCompilerSet(); } diff --git a/RedPandaIDE/project.cpp b/RedPandaIDE/project.cpp index 0eda57c3..3daff0ba 100644 --- a/RedPandaIDE/project.cpp +++ b/RedPandaIDE/project.cpp @@ -1374,13 +1374,22 @@ void Project::loadOptions(SimpleIni& ini) QMessageBox::Ok ); mOptions.compilerSet = pSettings->compilerSets().defaultIndex(); + int compilerSetType = ini.GetLongValue("Project","CompilerSetType",-1); + if (compilerSetType>=0) { + for (int i=0;icompilerSets().size();i++) { + Settings::PCompilerSet pSet = pSettings->compilerSets().getSet(i); + if (pSet && pSet->compilerSetType() == compilerSetType) { + mOptions.compilerSet = i; + break; + } + } + } setModified(true); } mOptions.compilerOptions = ini.GetValue("Project", "CompilerSettings", ""); mOptions.staticLink = ini.GetBoolValue("Project", "StaticLink", true); mOptions.addCharset = ini.GetBoolValue("Project", "AddCharset", true); - mOptions.compilerSetType = ini.GetLongValue("Project","CompilerSetType",-1); if (mOptions.compilerSetType<0) { updateCompilerSetType(); }