- fix: Can't correctly load project's custom compile options, if it contains more than one line contents.

This commit is contained in:
Roy Qu 2023-02-10 09:42:55 +08:00
parent 7e4a87a704
commit 78f9aa8b3c
4 changed files with 21 additions and 17 deletions

View File

@ -1,3 +1,7 @@
Red Panda C++ Version 2.12
- fix: Can't correctly load project's custom compile options, if it contains more than one line contents.
Red Panda C++ Version 2.11
- fix: Can't correctly handle definitions for "operator,"

View File

@ -10,7 +10,7 @@ isEmpty(APP_NAME) {
}
isEmpty(APP_VERSION) {
APP_VERSION = 2.11
APP_VERSION = 2.12
}
macos: {

View File

@ -1028,15 +1028,15 @@ bool Project::saveAsTemplate(const QString &templateFolder,
if (!mOptions.libDirs.isEmpty())
ini->SetValue("Project", "Libs", relativePaths(mOptions.libDirs).join(";").toUtf8());
if (!mOptions.compilerCmd.isEmpty())
ini->SetValue("Project", "Compiler", mOptions.compilerCmd.toUtf8());
ini->SetValue("Project", "Compiler", textToLines(mOptions.compilerCmd).join(";CONFIG_LINE;").toUtf8());
if (!mOptions.cppCompilerCmd.isEmpty())
ini->SetValue("Project", "CppCompiler", mOptions.cppCompilerCmd.toUtf8());
ini->SetValue("Project", "CppCompiler", textToLines(mOptions.cppCompilerCmd).join(";CONFIG_LINE;").toUtf8());
if (!mOptions.linkerCmd.isEmpty())
ini->SetValue("Project", "Linker",mOptions.linkerCmd.toUtf8());
ini->SetValue("Project", "Linker",textToLines(mOptions.linkerCmd).join(";CONFIG_LINE;").toUtf8());
if (!mOptions.resourceCmd.isEmpty())
ini->SetValue("Project", "ResourceCommand",mOptions.resourceCmd.toUtf8());
ini->SetValue("Project", "ResourceCommand",textToLines(mOptions.resourceCmd).join(";CONFIG_LINE;").toUtf8());
if (!mOptions.assemblerArgs.isEmpty())
ini->SetValue("Project", "AssemblerArgs",mOptions.assemblerArgs.toUtf8());
ini->SetValue("Project", "AssemblerArgs",textToLines(mOptions.assemblerArgs).join(";CONFIG_LINE;").toUtf8());
ini->SetBoolValue("Project", "IsCpp", mOptions.isCpp);
if (mOptions.includeVersionInfo)
ini->SetBoolValue("Project", "IncludeVersionInfo", true);
@ -1133,11 +1133,11 @@ void Project::saveOptions()
ini.SetValue("Project","ResourceIncludes", toByteArray(relativePaths(mOptions.resourceIncludes).join(";")));
ini.SetValue("Project","MakeIncludes", toByteArray(relativePaths(mOptions.makeIncludes).join(";")));
ini.SetValue("Project","PrivateResource", toByteArray(mOptions.privateResource));
ini.SetValue("Project","Compiler", toByteArray(mOptions.compilerCmd));
ini.SetValue("Project","CppCompiler", toByteArray(mOptions.cppCompilerCmd));
ini.SetValue("Project","AssemblerArgs",toByteArray(mOptions.assemblerArgs));
ini.SetValue("Project","Linker", toByteArray(mOptions.linkerCmd));
ini.SetValue("Project", "ResourceCommand", toByteArray(mOptions.resourceCmd));
ini.SetValue("Project","Compiler", toByteArray(textToLines(mOptions.compilerCmd).join(";CONFIG_LINE;")));
ini.SetValue("Project","CppCompiler", toByteArray(textToLines(mOptions.cppCompilerCmd).join(";CONFIG_LINE;")));
ini.SetValue("Project","AssemblerArgs",toByteArray(textToLines(mOptions.assemblerArgs).join(";CONFIG_LINE;")));
ini.SetValue("Project","Linker", toByteArray(textToLines(mOptions.linkerCmd).join(";CONFIG_LINE;")));
ini.SetValue("Project", "ResourceCommand", toByteArray(textToLines(mOptions.resourceCmd).join(";CONFIG_LINE;")));
ini.SetLongValue("Project","IsCpp", mOptions.isCpp);
ini.SetValue("Project","Icon", toByteArray(extractRelativePath(directory(), mOptions.icon)));
ini.SetValue("Project","ExeOutput", toByteArray(extractRelativePath(directory(),mOptions.exeOutput)));
@ -1939,11 +1939,11 @@ void Project::loadOptions(SimpleIni& ini)
}
mOptions.type = static_cast<ProjectType>(ini.GetLongValue("Project", "type", 0));
mOptions.compilerCmd = fromByteArray(ini.GetValue("Project", "Compiler", ""));
mOptions.cppCompilerCmd = fromByteArray(ini.GetValue("Project", "CppCompiler", ""));
mOptions.linkerCmd = fromByteArray(ini.GetValue("Project", "Linker", ""));
mOptions.resourceCmd = fromByteArray(ini.GetValue("Project", "ResourceCommand", ""));
mOptions.assemblerArgs = fromByteArray(ini.GetValue("Project","AssemblerArgs",""));
mOptions.compilerCmd = fromByteArray(ini.GetValue("Project", "Compiler", "")).replace(";CONFIG_LINE;","\n");
mOptions.cppCompilerCmd = fromByteArray(ini.GetValue("Project", "CppCompiler", "")).replace(";CONFIG_LINE;","\n");
mOptions.linkerCmd = fromByteArray(ini.GetValue("Project", "Linker", "")).replace(";CONFIG_LINE;","\n");
mOptions.resourceCmd = fromByteArray(ini.GetValue("Project", "ResourceCommand", "")).replace(";CONFIG_LINE;","\n");
mOptions.assemblerArgs = fromByteArray(ini.GetValue("Project","AssemblerArgs","")).replace(";CONFIG_LINE;","\n");
mOptions.binDirs = absolutePaths(fromByteArray(ini.GetValue("Project", "Bins", "")).split(";",
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
Qt::SkipEmptyParts

View File

@ -14,7 +14,7 @@ qsynedit.subdir = libs/qsynedit
APP_NAME = RedPandaCPP
APP_VERSION = 2.11
APP_VERSION = 2.12
# Add the dependencies so that the RedPandaIDE project can add the depended programs
# into the main app bundle