diff --git a/RedPandaIDE/compiler/compiler.cpp b/RedPandaIDE/compiler/compiler.cpp index d9dd4d9a..e8586946 100644 --- a/RedPandaIDE/compiler/compiler.cpp +++ b/RedPandaIDE/compiler/compiler.cpp @@ -43,8 +43,8 @@ Compiler::Compiler(const QString &filename, bool onlyCheckSyntax): mOnlyCheckSyntax{onlyCheckSyntax}, mFilename{filename}, mRebuild{false}, - mForceEnglishOutput{false}, - mParserForFile() + mParserForFile{}, + mForceEnglishOutput{false} { getParserForFile(filename); } diff --git a/RedPandaIDE/compiler/projectcompiler.cpp b/RedPandaIDE/compiler/projectcompiler.cpp index 5f2b45ac..e30b7906 100644 --- a/RedPandaIDE/compiler/projectcompiler.cpp +++ b/RedPandaIDE/compiler/projectcompiler.cpp @@ -56,7 +56,7 @@ void ProjectCompiler::createStandardMakeFile() QFile file(mProject->makeFileName()); bool genModuleDef; newMakeFile(file, genModuleDef); - QString executable = extractRelativePath(mProject->makeFileName(), mProject->executable()); + QString executable = extractRelativePath(mProject->makeFileName(), mProject->outputFilename()); QString exeTarget = escapeFilenameForMakefileTarget(executable); QString exeCommand = escapeArgumentForMakefileRecipe(executable, false); writeln(file, exeTarget + ": $(OBJ)\n"); @@ -73,12 +73,12 @@ void ProjectCompiler::createStaticMakeFile() { QFile file(mProject->makeFileName()); newMakeFile(file); - QString executable = extractRelativePath(mProject->makeFileName(), mProject->executable()); - QString exeTarget = escapeFilenameForMakefileTarget(executable); - QString exeCommand = escapeArgumentForMakefileRecipe(executable, false); - writeln(file, exeTarget + ": $(OBJ)"); - writeln(file, "\tar r " + exeCommand + " $(LINKOBJ)"); - writeln(file, "\tranlib " + exeCommand); + QString libFilename = extractRelativePath(mProject->makeFileName(), mProject->outputFilename()); + QString libTarget = escapeFilenameForMakefileTarget(libFilename); + QString libCommand = escapeArgumentForMakefileRecipe(libFilename, false); + writeln(file, libTarget + ": $(OBJ)"); + writeln(file, "\tar r " + libCommand + " $(LINKOBJ)"); + writeln(file, "\tranlib " + libCommand); writeMakeObjFilesRules(file); } @@ -87,21 +87,21 @@ void ProjectCompiler::createDynamicMakeFile() QFile file(mProject->makeFileName()); bool genModuleDef; newMakeFile(file, genModuleDef); - QString executable = extractRelativePath(mProject->makeFileName(), mProject->executable()); - QString exeTarget = escapeFilenameForMakefileTarget(executable); - QString exeCommand = escapeArgumentForMakefileRecipe(executable, false); - writeln(file, exeTarget + ": $(DEF) $(OBJ)"); + QString dynamicLibFilename = extractRelativePath(mProject->makeFileName(), mProject->outputFilename()); + QString dynamicLibTarget = escapeFilenameForMakefileTarget(dynamicLibFilename); + QString dynamicLibCommand = escapeArgumentForMakefileRecipe(dynamicLibFilename, false); + writeln(file, dynamicLibTarget + ": $(DEF) $(OBJ)"); if (genModuleDef) { if (mProject->options().isCpp) { - writeln(file, "\t$(CXX) -mdll $(LINKOBJ) -o " + exeCommand + " $(LIBS) $(DEF) -Wl,--output-def,$(OUTPUT_DEF),--out-implib,$(STATIC)"); + writeln(file, "\t$(CXX) -mdll $(LINKOBJ) -o " + dynamicLibCommand + " $(LIBS) $(DEF) -Wl,--output-def,$(OUTPUT_DEF),--out-implib,$(STATIC)"); } else { - writeln(file, "\t$(CC) -mdll $(LINKOBJ) -o " + exeCommand + " $(LIBS) $(DEF) -Wl,--output-def,$(OUTPUT_DEF),--out-implib,$(STATIC)"); + writeln(file, "\t$(CC) -mdll $(LINKOBJ) -o " + dynamicLibCommand + " $(LIBS) $(DEF) -Wl,--output-def,$(OUTPUT_DEF),--out-implib,$(STATIC)"); } } else { if (mProject->options().isCpp) { - writeln(file, "\t$(CXX) -mdll $(LINKOBJ) -o " + exeCommand + " $(LIBS) $(DEF) -Wl,--out-implib,$(STATIC)"); + writeln(file, "\t$(CXX) -mdll $(LINKOBJ) -o " + dynamicLibCommand + " $(LIBS) $(DEF) -Wl,--out-implib,$(STATIC)"); } else { - writeln(file, "\t$(CC) -mdll $(LINKOBJ) -o " + exeCommand + " $(LIBS) $(DEF) -Wl,--out-implib,$(STATIC)"); + writeln(file, "\t$(CC) -mdll $(LINKOBJ) -o " + dynamicLibCommand + " $(LIBS) $(DEF) -Wl,--out-implib,$(STATIC)"); } } writeMakeObjFilesRules(file); @@ -116,12 +116,12 @@ void ProjectCompiler::newMakeFile(QFile &file) void ProjectCompiler::newMakeFile(QFile& file, bool &genModuleDef) { // Create OBJ output directory - if (!mProject->options().objectOutput.isEmpty()) { - QDir(mProject->directory()).mkpath(mProject->options().objectOutput); + if (!mProject->options().folderForObjFiles.isEmpty()) { + QDir(mProject->directory()).mkpath(mProject->options().folderForObjFiles); } // Create executable output directory - if (!mProject->options().exeOutput.isEmpty()) { - QDir(mProject->directory()).mkpath(mProject->options().exeOutput); + if (!mProject->options().folderForOutput.isEmpty()) { + QDir(mProject->directory()).mkpath(mProject->options().folderForOutput); } // Write more information to the log file than before log(tr("Building makefile...")); @@ -187,9 +187,9 @@ void ProjectCompiler::writeMakeDefines(QFile &file, bool &genModuleDef) if (fileType == FileType::CSource || fileType == FileType::CppSource || fileType==FileType::GAS) { QString relativeName = extractRelativePath(mProject->directory(), unit->fileName()); - if (!mProject->options().objectOutput.isEmpty()) { + if (!mProject->options().folderForObjFiles.isEmpty()) { // ofile = C:\MyProgram\obj\main.o - QString fullObjFile = includeTrailingPathDelimiter(mProject->options().objectOutput) + QString fullObjFile = includeTrailingPathDelimiter(mProject->options().folderForObjFiles) + extractFileName(unit->fileName()); QString relativeObjFile = extractRelativePath(mProject->directory(), changeFileExt(fullObjFile, OBJ_EXT)); objects << relativeObjFile; @@ -212,8 +212,8 @@ void ProjectCompiler::writeMakeDefines(QFile &file, bool &genModuleDef) QString cleanRes; #ifdef Q_OS_WIN if (!mProject->options().privateResource.isEmpty()) { - if (!mProject->options().objectOutput.isEmpty()) { - QString fullResFile = includeTrailingPathDelimiter(mProject->options().objectOutput) + + if (!mProject->options().folderForObjFiles.isEmpty()) { + QString fullResFile = includeTrailingPathDelimiter(mProject->options().folderForObjFiles) + changeFileExt(mProject->options().privateResource, RES_EXT); QString relativeResFile = extractRelativePath(mProject->directory(), fullResFile); @@ -251,7 +251,7 @@ void ProjectCompiler::writeMakeDefines(QFile &file, bool &genModuleDef) QStringList resourceArguments = parseArguments(mProject->options().resourceCmd, devCppMacroVariables(), true); #endif - QString executable = extractRelativePath(mProject->makeFileName(), mProject->executable()); + QString executable = extractRelativePath(mProject->makeFileName(), mProject->outputFilename()); QString cleanExe = localizePath(executable); QString pchHeader = extractRelativePath(mProject->makeFileName(), mProject->options().precompiledHeader); QString pch = extractRelativePath(mProject->makeFileName(), mProject->options().precompiledHeader + "." GCH_EXT); @@ -301,8 +301,8 @@ void ProjectCompiler::writeMakeDefines(QFile &file, bool &genModuleDef) // This needs to be put in before the clean command. if (mProject->options().type == ProjectType::DynamicLib) { - QString outputFileDir = extractFilePath(mProject->executable()); - QString outputFilename = extractFileName(mProject->executable()); + QString outputFileDir = extractFilePath(mProject->outputFilename()); + QString outputFilename = extractFileName(mProject->outputFilename()); QString libOutputFile; if (!outputFilename.startsWith("lib")) { libOutputFile = includeTrailingPathDelimiter(outputFileDir) + "lib" + outputFilename; @@ -409,8 +409,8 @@ void ProjectCompiler::writeMakeObjFilesRules(QFile &file) } QString objFileNameTarget; QString objFileNameCommand; - if (!mProject->options().objectOutput.isEmpty()) { - QString fullObjname = includeTrailingPathDelimiter(mProject->options().objectOutput) + + if (!mProject->options().folderForObjFiles.isEmpty()) { + QString fullObjname = includeTrailingPathDelimiter(mProject->options().folderForObjFiles) + extractFileName(unit->fileName()); QString objectFile = extractRelativePath(mProject->makeFileName(), changeFileExt(fullObjname, OBJ_EXT)); objFileNameTarget = escapeFilenameForMakefileTarget(objectFile); @@ -517,8 +517,8 @@ void ProjectCompiler::writeMakeObjFilesRules(QFile &file) // Determine resource output file QString fullName; - if (!mProject->options().objectOutput.isEmpty()) { - fullName = includeTrailingPathDelimiter(mProject->options().objectOutput) + + if (!mProject->options().folderForObjFiles.isEmpty()) { + fullName = includeTrailingPathDelimiter(mProject->options().folderForObjFiles) + changeFileExt(mProject->options().privateResource, RES_EXT); } else { fullName = changeFileExt(mProject->options().privateResource, RES_EXT); @@ -625,7 +625,7 @@ bool ProjectCompiler::prepareForCompile() } mDirectory = mProject->directory(); - mOutputFile = mProject->executable(); + mOutputFile = mProject->outputFilename(); log(tr("Processing makefile:")); log("--------"); diff --git a/RedPandaIDE/compiler/sdccprojectcompiler.cpp b/RedPandaIDE/compiler/sdccprojectcompiler.cpp index 0d52f2c9..c1ac2be4 100644 --- a/RedPandaIDE/compiler/sdccprojectcompiler.cpp +++ b/RedPandaIDE/compiler/sdccprojectcompiler.cpp @@ -62,12 +62,12 @@ void SDCCProjectCompiler::createStandardMakeFile() void SDCCProjectCompiler::newMakeFile(QFile& file) { // Create OBJ output directory - if (!mProject->options().objectOutput.isEmpty()) { - QDir(mProject->directory()).mkpath(mProject->options().objectOutput); + if (!mProject->options().folderForObjFiles.isEmpty()) { + QDir(mProject->directory()).mkpath(mProject->options().folderForObjFiles); } // Create executable output directory - if (!mProject->options().exeOutput.isEmpty()) { - QDir(mProject->directory()).mkpath(mProject->options().exeOutput); + if (!mProject->options().folderForOutput.isEmpty()) { + QDir(mProject->directory()).mkpath(mProject->options().folderForOutput); } // Write more information to the log file than before log(tr("Building makefile...")); @@ -120,9 +120,9 @@ void SDCCProjectCompiler::writeMakeDefines(QFile &file) if (fileType == FileType::CSource || fileType == FileType::CppSource || fileType==FileType::GAS) { - if (!mProject->options().objectOutput.isEmpty()) { + if (!mProject->options().folderForObjFiles.isEmpty()) { // ofile = C:\MyProgram\obj\main.o - QString fullObjFile = includeTrailingPathDelimiter(mProject->options().objectOutput) + QString fullObjFile = includeTrailingPathDelimiter(mProject->options().folderForObjFiles) + extractFileName(unit->fileName()); QString relativeObjFile = extractRelativePath(mProject->directory(), changeFileExt(fullObjFile, SDCC_REL_SUFFIX)); Objects << relativeObjFile; @@ -145,9 +145,9 @@ void SDCCProjectCompiler::writeMakeDefines(QFile &file) QStringList libraryArguments = getLibraryArguments(FileType::Project); QStringList cIncludeArguments = getCIncludeArguments() + getProjectIncludeArguments(); - QString executable = extractRelativePath(mProject->makeFileName(), mProject->executable()); + QString executable = extractRelativePath(mProject->makeFileName(), mProject->outputFilename()); QString cleanExe = localizePath(executable); - QString ihx = extractRelativePath(mProject->makeFileName(), changeFileExt(mProject->executable(), SDCC_IHX_SUFFIX)); + QString ihx = extractRelativePath(mProject->makeFileName(), changeFileExt(mProject->outputFilename(), SDCC_IHX_SUFFIX)); QString cleanIhx = localizePath(ihx); writeln(file, "CC = " + escapeArgumentForMakefileVariableValue(cc, true)); @@ -239,8 +239,8 @@ void SDCCProjectCompiler::writeMakeObjFilesRules(QFile &file) } QString objFileNameTarget; QString objFileNameCommand; - if (!mProject->options().objectOutput.isEmpty()) { - QString fullObjname = includeTrailingPathDelimiter(mProject->options().objectOutput) + + if (!mProject->options().folderForObjFiles.isEmpty()) { + QString fullObjname = includeTrailingPathDelimiter(mProject->options().folderForObjFiles) + extractFileName(unit->fileName()); QString objFile = extractRelativePath(mProject->makeFileName(), changeFileExt(fullObjname, SDCC_REL_SUFFIX)); objFileNameTarget = escapeFilenameForMakefileTarget(objFile); @@ -341,7 +341,7 @@ bool SDCCProjectCompiler::prepareForCompile() } mDirectory = mProject->directory(); - mOutputFile = mProject->executable(); + mOutputFile = mProject->outputFilename(); log(tr("Processing makefile:")); log("--------"); log(tr("- makefile processer: %1").arg(mCompiler)); diff --git a/RedPandaIDE/customfileiconprovider.cpp b/RedPandaIDE/customfileiconprovider.cpp index fcb426e9..d84989ff 100644 --- a/RedPandaIDE/customfileiconprovider.cpp +++ b/RedPandaIDE/customfileiconprovider.cpp @@ -39,6 +39,8 @@ void CustomFileIconProvider::setRootFolder(const QString &folder) { #ifdef ENABLE_VCS mVCSRepository->setFolder(folder); +#else + Q_UNUSED(folder); #endif } diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index c1fe3731..77c11946 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -2251,7 +2251,7 @@ bool MainWindow::compile(bool rebuild, CppCompileType compileType) } mProject->buildPrivateResource(); if (mCompileSuccessionTask) { - mCompileSuccessionTask->execName = mProject->executable(); + mCompileSuccessionTask->execName = mProject->outputFilename(); mCompileSuccessionTask->isExecutable = true; } stretchMessagesPanel(true); @@ -2371,14 +2371,14 @@ void MainWindow::runExecutable(RunType runType) CompileTarget target =getCompileTarget(); if (target == CompileTarget::Project) { QStringList binDirs = mProject->binDirs(); - QFileInfo execInfo(mProject->executable()); + QFileInfo execInfo(mProject->outputFilename()); QDateTime execModTime = execInfo.lastModified(); if (execInfo.exists() && mProject->modifiedSince(execModTime)) { //if project options changed, or units added/removed //mProject->saveAll(); mCompileSuccessionTask=std::make_shared(); mCompileSuccessionTask->type = runTypeToCompileSuccessionTaskType(runType); - mCompileSuccessionTask->execName=mProject->executable(); + mCompileSuccessionTask->execName=mProject->outputFilename(); mCompileSuccessionTask->isExecutable=true; mCompileSuccessionTask->binDirs=binDirs; compile(true); @@ -2389,14 +2389,14 @@ void MainWindow::runExecutable(RunType runType) //mProject->saveAll(); mCompileSuccessionTask=std::make_shared(); mCompileSuccessionTask->type = runTypeToCompileSuccessionTaskType(runType); - mCompileSuccessionTask->execName=mProject->executable(); + mCompileSuccessionTask->execName=mProject->outputFilename(); mCompileSuccessionTask->isExecutable=true; mCompileSuccessionTask->binDirs=binDirs; compile(); return; } - runExecutable(mProject->executable(),mProject->filename(),runType, + runExecutable(mProject->outputFilename(),mProject->filename(),runType, binDirs); } else { Editor * editor = mEditorList->getEditor(); @@ -2486,24 +2486,24 @@ void MainWindow::debug() } // Did we compile? - if (!fileExists(mProject->executable())) { + if (!fileExists(mProject->outputFilename())) { mCompileSuccessionTask=std::make_shared(); mCompileSuccessionTask->type = CompileSuccessionTaskType::Debug; - mCompileSuccessionTask->execName = mProject->executable(); + mCompileSuccessionTask->execName = mProject->outputFilename(); mCompileSuccessionTask->isExecutable = true; mCompileSuccessionTask->binDirs = binDirs; compile(); return; } { - QFileInfo execInfo(mProject->executable()); + QFileInfo execInfo(mProject->outputFilename()); QDateTime execModTime = execInfo.lastModified(); if (execInfo.exists() && mProject->modifiedSince(execModTime)) { //if project options changed, or units added/removed //mProject->saveAll(); mCompileSuccessionTask=std::make_shared(); mCompileSuccessionTask->type = CompileSuccessionTaskType::Debug; - mCompileSuccessionTask->execName=mProject->executable(); + mCompileSuccessionTask->execName=mProject->outputFilename(); mCompileSuccessionTask->isExecutable=true; mCompileSuccessionTask->binDirs=binDirs; compile(true); @@ -2514,7 +2514,7 @@ void MainWindow::debug() //mProject->saveAll(); mCompileSuccessionTask=std::make_shared(); mCompileSuccessionTask->type = CompileSuccessionTaskType::Debug; - mCompileSuccessionTask->execName=mProject->executable(); + mCompileSuccessionTask->execName=mProject->outputFilename(); mCompileSuccessionTask->isExecutable=true; mCompileSuccessionTask->binDirs=binDirs; compile(); @@ -2542,7 +2542,7 @@ void MainWindow::debug() } // Reset UI, remove invalid breakpoints prepareDebugger(); - filePath = mProject->executable(); + filePath = mProject->outputFilename(); // mDebugger->setUseUTF8(e->fileEncoding() == ENCODING_UTF8 || e->fileEncoding() == ENCODING_UTF8_BOM); @@ -8245,7 +8245,7 @@ void MainWindow::doCompileRun(RunType runType) QString execName; if (target == CompileTarget::Project) { binDirs = mProject->binDirs(); - execName = mProject->executable(); + execName = mProject->outputFilename(); } else { binDirs = getDefaultCompilerSetBinDirs(); } diff --git a/RedPandaIDE/parser/parserutils.h b/RedPandaIDE/parser/parserutils.h index 39c36638..4d516be5 100644 --- a/RedPandaIDE/parser/parserutils.h +++ b/RedPandaIDE/parser/parserutils.h @@ -33,7 +33,7 @@ enum class ParserLanguage { #endif }; -inline qHash(const ParserLanguage& value, uint seed) { +inline uint qHash(const ParserLanguage& value, uint seed) { return qHash((int)value, seed); } @@ -118,7 +118,7 @@ enum class StatementKind { Alias, // using alias }; -inline qHash(const StatementKind& value, uint seed) { +inline uint qHash(const StatementKind& value, uint seed) { return qHash((int)value, seed); } diff --git a/RedPandaIDE/project.cpp b/RedPandaIDE/project.cpp index 57e75786..0dcec0be 100644 --- a/RedPandaIDE/project.cpp +++ b/RedPandaIDE/project.cpp @@ -123,11 +123,11 @@ QString Project::directory() const return fileInfo.absolutePath(); } -QString Project::executable() const +QString Project::outputFilename() const { QString exeFileName; - if (mOptions.overrideOutput && !mOptions.overridenOutput.isEmpty()) { - exeFileName = mOptions.overridenOutput; + if (mOptions.useCustomOutputFilename && !mOptions.customOutputFilename.isEmpty()) { + exeFileName = mOptions.customOutputFilename; } else { switch(mOptions.type) { #ifdef ENABLE_SDCC @@ -155,9 +155,9 @@ QString Project::executable() const } } QString exePath; - if (!mOptions.exeOutput.isEmpty()) { + if (!mOptions.folderForOutput.isEmpty()) { QDir baseDir(directory()); - exePath = baseDir.filePath(mOptions.exeOutput); + exePath = baseDir.filePath(mOptions.folderForOutput); } else { exePath = directory(); } @@ -1090,12 +1090,12 @@ bool Project::saveAsTemplate(const QString &templateFolder, ini->SetBoolValue("Project", "IncludeVersionInfo", true); if (mOptions.supportXPThemes) ini->SetBoolValue("Project", "SupportXPThemes", true); - if (!mOptions.exeOutput.isEmpty()) - ini->SetValue("Project", "ExeOutput", extractRelativePath(directory(),mOptions.exeOutput).toUtf8()); - if (!mOptions.objectOutput.isEmpty()) - ini->SetValue("Project", "ObjectOutput", extractRelativePath(directory(),mOptions.objectOutput).toUtf8()); - if (!mOptions.logOutput.isEmpty()) - ini->SetValue("Project", "LogOutput", extractRelativePath(directory(),mOptions.logOutput).toUtf8()); + if (!mOptions.folderForOutput.isEmpty()) + ini->SetValue("Project", "ExeOutput", extractRelativePath(directory(),mOptions.folderForOutput).toUtf8()); + if (!mOptions.folderForObjFiles.isEmpty()) + ini->SetValue("Project", "ObjectOutput", extractRelativePath(directory(),mOptions.folderForObjFiles).toUtf8()); + if (!mOptions.logFilename.isEmpty()) + ini->SetValue("Project", "LogOutput", extractRelativePath(directory(),mOptions.logFilename).toUtf8()); if (mOptions.execEncoding!=ENCODING_SYSTEM_DEFAULT) ini->SetValue("Project","ExecEncoding", mOptions.execEncoding); @@ -1190,12 +1190,12 @@ void Project::saveOptions() ini.SetValue("Project", "ResourceCommand", toByteArray(textToLines(mOptions.resourceCmd).join(" "))); ini.SetLongValue("Project","IsCpp", mOptions.isCpp); ini.SetValue("Project","Icon", toByteArray(extractRelativePath(directory(), mOptions.icon))); - ini.SetValue("Project","ExeOutput", toByteArray(extractRelativePath(directory(),mOptions.exeOutput))); - ini.SetValue("Project","ObjectOutput", toByteArray(extractRelativePath(directory(),mOptions.objectOutput))); - ini.SetValue("Project","LogOutput", toByteArray(extractRelativePath(directory(),mOptions.logOutput))); - ini.SetLongValue("Project","LogOutputEnabled", mOptions.logOutputEnabled); - ini.SetLongValue("Project","OverrideOutput", mOptions.overrideOutput); - ini.SetValue("Project","OverrideOutputName", toByteArray(mOptions.overridenOutput)); + ini.SetValue("Project","ExeOutput", toByteArray(extractRelativePath(directory(),mOptions.folderForOutput))); + ini.SetValue("Project","ObjectOutput", toByteArray(extractRelativePath(directory(),mOptions.folderForObjFiles))); + ini.SetValue("Project","LogOutput", toByteArray(extractRelativePath(directory(),mOptions.logFilename))); + ini.SetLongValue("Project","LogOutputEnabled", mOptions.logOutput); + ini.SetLongValue("Project","OverrideOutput", mOptions.useCustomOutputFilename); + ini.SetValue("Project","OverrideOutputName", toByteArray(mOptions.customOutputFilename)); ini.SetValue("Project","HostApplication", toByteArray(extractRelativePath(directory(), mOptions.hostApplication))); ini.SetLongValue("Project","UseCustomMakefile", mOptions.useCustomMakefile); ini.SetValue("Project","CustomMakefile", toByteArray(extractRelativePath(directory(),mOptions.customMakefile))); @@ -1444,12 +1444,12 @@ void Project::buildPrivateResource() contents.append("// THIS WILL MAKE THE PROGRAM USE THE COMMON CONTROLS"); contents.append("// LIBRARY VERSION 6.0 (IF IT IS AVAILABLE)"); contents.append("//"); - if (!mOptions.exeOutput.isEmpty()) + if (!mOptions.folderForOutput.isEmpty()) contents.append( - "1 24 \"" + includeTrailingPathDelimiter(mOptions.exeOutput) - + extractFileName(executable()) + ".Manifest\""); + "1 24 \"" + includeTrailingPathDelimiter(mOptions.folderForOutput) + + extractFileName(outputFilename()) + ".Manifest\""); else - contents.append("1 24 \"" + extractFileName(executable()) + ".Manifest\""); + contents.append("1 24 \"" + extractFileName(outputFilename()) + ".Manifest\""); } if (mOptions.includeVersionInfo) { @@ -1573,7 +1573,7 @@ void Project::buildPrivateResource() content.append(" "); content.append(""); content.append(""); - stringsToFile(content,executable() + ".Manifest"); + stringsToFile(content,outputFilename() + ".Manifest"); } // create private header file @@ -2024,12 +2024,12 @@ void Project::loadOptions(SimpleIni& ini) #endif )); mOptions.isCpp = ini.GetBoolValue("Project", "IsCpp", false); - mOptions.exeOutput = generateAbsolutePath(directory(), fromByteArray(ini.GetValue("Project", "ExeOutput", ""))); - mOptions.objectOutput = generateAbsolutePath(directory(), fromByteArray(ini.GetValue("Project", "ObjectOutput", ""))); - mOptions.logOutput = generateAbsolutePath(directory(), fromByteArray(ini.GetValue("Project", "LogOutput", ""))); - mOptions.logOutputEnabled = ini.GetBoolValue("Project", "LogOutputEnabled", false); - mOptions.overrideOutput = ini.GetBoolValue("Project", "OverrideOutput", false); - mOptions.overridenOutput = fromByteArray(ini.GetValue("Project", "OverrideOutputName", "")); + mOptions.folderForOutput = generateAbsolutePath(directory(), fromByteArray(ini.GetValue("Project", "ExeOutput", ""))); + mOptions.folderForObjFiles = generateAbsolutePath(directory(), fromByteArray(ini.GetValue("Project", "ObjectOutput", ""))); + mOptions.logFilename = generateAbsolutePath(directory(), fromByteArray(ini.GetValue("Project", "LogOutput", ""))); + mOptions.logOutput = ini.GetBoolValue("Project", "LogOutputEnabled", false); + mOptions.useCustomOutputFilename = ini.GetBoolValue("Project", "OverrideOutput", false); + mOptions.customOutputFilename = fromByteArray(ini.GetValue("Project", "OverrideOutputName", "")); mOptions.hostApplication = generateAbsolutePath(directory(), fromByteArray(ini.GetValue("Project", "HostApplication", ""))); mOptions.useCustomMakefile = ini.GetBoolValue("Project", "UseCustomMakefile", false); mOptions.customMakefile = generateAbsolutePath(directory(),fromByteArray(ini.GetValue("Project", "CustomMakefile", ""))); @@ -2155,7 +2155,7 @@ void Project::loadOptions(SimpleIni& ini) mOptions.versionInfo.legalCopyright = fromByteArray(ini.GetValue("VersionInfo", "LegalCopyright", "")); mOptions.versionInfo.legalTrademarks = fromByteArray(ini.GetValue("VersionInfo", "LegalTrademarks", "")); mOptions.versionInfo.originalFilename = fromByteArray(ini.GetValue("VersionInfo", "OriginalFilename", - toByteArray(extractFileName(executable())))); + toByteArray(extractFileName(outputFilename())))); mOptions.versionInfo.productName = fromByteArray(ini.GetValue("VersionInfo", "ProductName", toByteArray(mName))); mOptions.versionInfo.productVersion = fromByteArray(ini.GetValue("VersionInfo", "ProductVersion", "0.1.1.1")); mOptions.versionInfo.autoIncBuildNr = ini.GetBoolValue("VersionInfo", "AutoIncBuildNr", false); diff --git a/RedPandaIDE/project.h b/RedPandaIDE/project.h index 666443b5..59954211 100644 --- a/RedPandaIDE/project.h +++ b/RedPandaIDE/project.h @@ -212,7 +212,7 @@ public: ~Project(); QString directory() const; - QString executable() const; + QString outputFilename() const; QString makeFileName(); QString xmakeFileName(); bool unitsModifiedSince(const QDateTime& time); diff --git a/RedPandaIDE/projectoptions.cpp b/RedPandaIDE/projectoptions.cpp index 948ffac6..fcacb1af 100644 --- a/RedPandaIDE/projectoptions.cpp +++ b/RedPandaIDE/projectoptions.cpp @@ -43,10 +43,10 @@ ProjectOptions::ProjectOptions() type = ProjectType::GUI; version = 3; isCpp = false; - logOutputEnabled = false; + logOutput = false; useCustomMakefile = false; usePrecompiledHeader = false; - overrideOutput = false; + useCustomOutputFilename = false; includeVersionInfo = false; supportXPThemes = false; compilerSet = 0; diff --git a/RedPandaIDE/projectoptions.h b/RedPandaIDE/projectoptions.h index 0991ea09..f764ccc3 100644 --- a/RedPandaIDE/projectoptions.h +++ b/RedPandaIDE/projectoptions.h @@ -76,16 +76,16 @@ struct ProjectOptions{ QStringList makeIncludes; bool isCpp; QString icon; - QString exeOutput; - QString objectOutput; - QString logOutput; - bool logOutputEnabled; + QString folderForOutput; + QString folderForObjFiles; + QString logFilename; + bool logOutput; bool useCustomMakefile; QString customMakefile; bool usePrecompiledHeader; QString precompiledHeader; - bool overrideOutput; - QString overridenOutput; + bool useCustomOutputFilename; + QString customOutputFilename; QString hostApplication; bool includeVersionInfo; bool supportXPThemes; diff --git a/RedPandaIDE/projecttemplate.cpp b/RedPandaIDE/projecttemplate.cpp index 3dd3f95e..077503bf 100644 --- a/RedPandaIDE/projecttemplate.cpp +++ b/RedPandaIDE/projecttemplate.cpp @@ -152,9 +152,9 @@ void ProjectTemplate::readTemplateFile(const QString &fileName) mOptions.isCpp = mIni->GetBoolValue("Project", "IsCpp", false); mOptions.includeVersionInfo = mIni->GetBoolValue("Project", "IncludeVersionInfo", false); mOptions.supportXPThemes = mIni->GetBoolValue("Project", "SupportXPThemes", false); - mOptions.exeOutput = fromByteArray(mIni->GetValue("Project", "ExeOutput", "")); - mOptions.objectOutput = fromByteArray(mIni->GetValue("Project", "ObjectOutput", "")); - mOptions.logOutput = fromByteArray(mIni->GetValue("Project", "LogOutput", "")); + mOptions.folderForOutput = fromByteArray(mIni->GetValue("Project", "ExeOutput", "")); + mOptions.folderForObjFiles = fromByteArray(mIni->GetValue("Project", "ObjectOutput", "")); + mOptions.logFilename = fromByteArray(mIni->GetValue("Project", "LogOutput", "")); mOptions.execEncoding = mIni->GetValue("Project","ExecEncoding", ENCODING_SYSTEM_DEFAULT); mOptions.staticLink = mIni->GetBoolValue("Project", "StaticLink",true); diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index 7005c910..0d72e206 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -1446,8 +1446,8 @@ void Settings::Editor::doLoad() mEnhanceHomeKey = boolValue("enhance_home_key", true); mEnhanceEndKey = boolValue("enhance_end_key",true); mKeepCaretX = boolValue("keep_caret_x",true); - mCaretForInsert = static_cast( intValue("caret_for_insert",static_cast(QSynedit::EditCaretType::ctVerticalLine))); - mCaretForOverwrite = static_cast( intValue("caret_for_overwrite",static_cast(QSynedit::EditCaretType::ctBlock))); + mCaretForInsert = static_cast( intValue("caret_for_insert",static_cast(QSynedit::EditCaretType::VerticalLine))); + mCaretForOverwrite = static_cast( intValue("caret_for_overwrite",static_cast(QSynedit::EditCaretType::Block))); mCaretUseTextColor = boolValue("caret_use_text_color",true); mCaretColor = colorValue("caret_color",Qt::yellow); diff --git a/RedPandaIDE/settingsdialog/editorgeneralwidget.cpp b/RedPandaIDE/settingsdialog/editorgeneralwidget.cpp index 7c7687e4..4682aa11 100644 --- a/RedPandaIDE/settingsdialog/editorgeneralwidget.cpp +++ b/RedPandaIDE/settingsdialog/editorgeneralwidget.cpp @@ -47,7 +47,7 @@ static void setCaretTypeIndex(QComboBox* combo, QSynedit::EditCaretType caretTyp static QSynedit::EditCaretType getCaretTypeIndex(QComboBox* combo) { if (combo->currentIndex()<0) - return QSynedit::EditCaretType::ctVerticalLine; + return QSynedit::EditCaretType::VerticalLine; return static_cast(combo->currentIndex()); } void EditorGeneralWidget::doLoad() diff --git a/RedPandaIDE/settingsdialog/projectgeneralwidget.cpp b/RedPandaIDE/settingsdialog/projectgeneralwidget.cpp index b0309e32..796e5b38 100644 --- a/RedPandaIDE/settingsdialog/projectgeneralwidget.cpp +++ b/RedPandaIDE/settingsdialog/projectgeneralwidget.cpp @@ -74,7 +74,7 @@ void ProjectGeneralWidget::doLoad() ui->txtName->setText(project->name()); ui->txtFileName->setText(project->filename()); - ui->txtOutputFile->setText(project->executable()); + ui->txtOutputFile->setText(project->outputFilename()); int srcCount=0,headerCount=0,resCount=0,otherCount=0, totalCount=0; foreach (const PProjectUnit& unit, project->unitList()) { @@ -251,6 +251,6 @@ void ProjectGeneralWidget::on_cbType_currentIndexChanged(int /*index*/) std::shared_ptr project = pMainWindow->project(); if (!project) return; - ui->txtOutputFile->setText(project->executable()); + ui->txtOutputFile->setText(project->outputFilename()); } diff --git a/RedPandaIDE/settingsdialog/projectoutputwidget.cpp b/RedPandaIDE/settingsdialog/projectoutputwidget.cpp index 2571fc7b..eb0271f8 100644 --- a/RedPandaIDE/settingsdialog/projectoutputwidget.cpp +++ b/RedPandaIDE/settingsdialog/projectoutputwidget.cpp @@ -38,22 +38,22 @@ ProjectOutputWidget::~ProjectOutputWidget() void ProjectOutputWidget::doLoad() { - ui->txtOutputDir->setText(pMainWindow->project()->options().exeOutput); - ui->txtObjOutputDir->setText(pMainWindow->project()->options().objectOutput); - ui->grpAutosaveCompileLog->setChecked(pMainWindow->project()->options().logOutputEnabled); - ui->txtCompileLog->setText(pMainWindow->project()->options().logOutput); - ui->grpOverrideOutput->setChecked(pMainWindow->project()->options().overrideOutput); - ui->txtOutputFilename->setText(pMainWindow->project()->options().overridenOutput); + ui->txtOutputDir->setText(pMainWindow->project()->options().folderForOutput); + ui->txtObjOutputDir->setText(pMainWindow->project()->options().folderForObjFiles); + ui->grpAutosaveCompileLog->setChecked(pMainWindow->project()->options().logOutput); + ui->txtCompileLog->setText(pMainWindow->project()->options().logFilename); + ui->grpOverrideOutput->setChecked(pMainWindow->project()->options().useCustomOutputFilename); + ui->txtOutputFilename->setText(pMainWindow->project()->options().customOutputFilename); } void ProjectOutputWidget::doSave() { - pMainWindow->project()->options().exeOutput = ui->txtOutputDir->text(); - pMainWindow->project()->options().objectOutput = ui->txtObjOutputDir->text(); - pMainWindow->project()->options().logOutputEnabled = ui->grpAutosaveCompileLog->isChecked(); - pMainWindow->project()->options().logOutput = ui->txtCompileLog->text(); - pMainWindow->project()->options().overrideOutput = ui->grpOverrideOutput->isChecked(); - pMainWindow->project()->options().overridenOutput = ui->txtOutputFilename->text(); + pMainWindow->project()->options().folderForOutput = ui->txtOutputDir->text(); + pMainWindow->project()->options().folderForObjFiles = ui->txtObjOutputDir->text(); + pMainWindow->project()->options().logOutput = ui->grpAutosaveCompileLog->isChecked(); + pMainWindow->project()->options().logFilename = ui->txtCompileLog->text(); + pMainWindow->project()->options().useCustomOutputFilename = ui->grpOverrideOutput->isChecked(); + pMainWindow->project()->options().customOutputFilename = ui->txtOutputFilename->text(); pMainWindow->project()->saveOptions(); } diff --git a/RedPandaIDE/settingsdialog/projectoutputwidget.ui b/RedPandaIDE/settingsdialog/projectoutputwidget.ui index 4fb671e5..10c924a4 100644 --- a/RedPandaIDE/settingsdialog/projectoutputwidget.ui +++ b/RedPandaIDE/settingsdialog/projectoutputwidget.ui @@ -17,7 +17,7 @@ - Executable output directory + Directory for output @@ -36,7 +36,7 @@ - Object file output directory + Directory for obj files diff --git a/RedPandaIDE/settingsdialog/settingswidget.cpp b/RedPandaIDE/settingsdialog/settingswidget.cpp index 691903af..3842a42c 100644 --- a/RedPandaIDE/settingsdialog/settingswidget.cpp +++ b/RedPandaIDE/settingsdialog/settingswidget.cpp @@ -203,6 +203,7 @@ void SettingsWidget::clearSettingsChanged() void SettingsWidget::showEvent(QShowEvent *event) { + Q_UNUSED(event); load(); } diff --git a/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts b/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts index 7863476e..739c1e9f 100644 --- a/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts +++ b/RedPandaIDE/translations/RedPandaIDE_pt_BR.ts @@ -1460,12 +1460,12 @@ Inserir a condição de parada: - + Readonly Apenas leitura - + Error Load File Erro ao carregar arquivo @@ -4276,7 +4276,7 @@ MainWindow - + Red Panda C++ Red Panda C++ @@ -5483,13 +5483,13 @@ Ctrl+Shift+Down - + - + @@ -5501,7 +5501,7 @@ Erro - + New Novo @@ -5527,18 +5527,18 @@ - + Problem Set %1 Conjunto de problemas %1 - + Load Theme Error Erro ao carregar tema - + @@ -7018,7 +7018,7 @@ - + Exact @@ -7033,7 +7033,7 @@ - + Folder Not Empty @@ -8137,22 +8137,30 @@ Configuração - Executable output directory Pasta do executável - + browse navegar - Object file output directory - Pasta do arquivo objeto + Pasta do arquivo objeto + + + + Directory for output + + + + + Directory for obj files + @@ -8381,7 +8389,7 @@ QFileSystemModel - + <b>The name "%1" cannot be used.</b><p>Try using another name, with fewer characters or no punctuation marks. @@ -8681,7 +8689,7 @@ - + Save Salvar @@ -9000,7 +9008,7 @@ Índice %1 fora dos limites - + bytes bytes @@ -10878,7 +10886,7 @@ Remover compilado - + Read tools config failed Falha ao ler configurações de ferramentas diff --git a/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts b/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts index d03ef258..cc698e57 100644 --- a/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts +++ b/RedPandaIDE/translations/RedPandaIDE_zh_CN.ts @@ -1722,7 +1722,7 @@ p, li { white-space: pre-wrap; } 输入当前断点的生效条件: - + Readonly 只读 @@ -4629,7 +4629,7 @@ p, li { white-space: pre-wrap; } MainWindow - + Red Panda C++ 小熊猫C++ @@ -4790,7 +4790,7 @@ p, li { white-space: pre-wrap; } 工具栏2 - + New 新建 @@ -4923,7 +4923,7 @@ p, li { white-space: pre-wrap; } - + Copy @@ -6202,12 +6202,12 @@ p, li { white-space: pre-wrap; } 文件编码 - + Recent Files 文件历史 - + @@ -6529,7 +6529,7 @@ p, li { white-space: pre-wrap; } 清除 - + Export 导出 @@ -6540,7 +6540,7 @@ p, li { white-space: pre-wrap; } - + Problem Set %1 试题集%1 @@ -7496,13 +7496,13 @@ p, li { white-space: pre-wrap; } 试题案例%1 - + - + @@ -7514,7 +7514,7 @@ p, li { white-space: pre-wrap; } 错误 - + Recent Projects 项目历史 @@ -7525,7 +7525,7 @@ p, li { white-space: pre-wrap; } 载入主题失败 - + Clear History 清除历史 @@ -7589,7 +7589,7 @@ p, li { white-space: pre-wrap; } 确认转换 - + Exact 完全一致 @@ -7608,7 +7608,7 @@ p, li { white-space: pre-wrap; } 行: %1 列: %2 (%3个字符) 总行数: %4 - + If you are using the Release compiler set, please use choose the Debug version from toolbar. @@ -8800,22 +8800,30 @@ p, li { white-space: pre-wrap; } 表单 - Executable output directory 可执行文件输出文件夹 - + browse 浏览 - Object file output directory - 目标文件输出文件夹 + 目标文件输出文件夹 + + + + Directory for output + 输出文件夹 + + + + Directory for obj files + obj文件夹 @@ -8825,7 +8833,7 @@ p, li { white-space: pre-wrap; } Override output filename - 自定义可执行文件名 + 自定义项目输出文件名 @@ -9057,7 +9065,7 @@ p, li { white-space: pre-wrap; } QFileSystemModel - + <b>The name "%1" cannot be used.</b><p>Try using another name, with fewer characters or no punctuation marks. <b>文件名 "%1" 无法被使用!</b><p>可能是重名、过长、为空或者是使用了不能出现在文件名里的符号。 @@ -9066,7 +9074,7 @@ p, li { white-space: pre-wrap; } QObject - + Save 保存 @@ -9551,7 +9559,7 @@ p, li { white-space: pre-wrap; } 下标"%1"越界 - + bytes 字节 @@ -11782,7 +11790,7 @@ p, li { white-space: pre-wrap; } 在文件管理器中打开编译结果 - + Read tools config failed 读取工具配置失败 diff --git a/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts b/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts index dc2a8332..9381e427 100644 --- a/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts +++ b/RedPandaIDE/translations/RedPandaIDE_zh_TW.ts @@ -1297,12 +1297,12 @@ - + Readonly - + Error Load File @@ -4061,7 +4061,7 @@ MainWindow - + Red Panda C++ @@ -5255,13 +5255,13 @@ - + - + @@ -5273,7 +5273,7 @@ - + New @@ -5299,18 +5299,18 @@ - + Problem Set %1 - + Load Theme Error - + @@ -6711,7 +6711,7 @@ - + Exact @@ -6726,7 +6726,7 @@ - + Folder Not Empty @@ -7762,21 +7762,25 @@ - Executable output directory - + browse - - Object file output directory + + Directory for output + + + + + Directory for obj files @@ -7981,7 +7985,7 @@ QFileSystemModel - + <b>The name "%1" cannot be used.</b><p>Try using another name, with fewer characters or no punctuation marks. @@ -8274,7 +8278,7 @@ - + Save @@ -8483,7 +8487,7 @@ - + bytes @@ -10097,7 +10101,7 @@ - + Read tools config failed diff --git a/RedPandaIDE/utils.cpp b/RedPandaIDE/utils.cpp index bf459a28..acf6a4b9 100644 --- a/RedPandaIDE/utils.cpp +++ b/RedPandaIDE/utils.cpp @@ -201,8 +201,8 @@ QMap devCppMacroVariables() result["PROJECTFILENAME"] = extractFileName(e->filename()); result["PROJECTPATH"] = localizePath(extractFileDir(e->filename())); } else if (pMainWindow->project()) { - result["EXENAME"] = extractFileName(pMainWindow->project()->executable()); - result["EXEFILE"] = localizePath(pMainWindow->project()->executable()); + result["EXENAME"] = extractFileName(pMainWindow->project()->outputFilename()); + result["EXEFILE"] = localizePath(pMainWindow->project()->outputFilename()); result["PROJECTNAME"] = pMainWindow->project()->name(); result["PROJECTFILE"] = localizePath(pMainWindow->project()->filename()); result["PROJECTFILENAME"] = extractFileName(pMainWindow->project()->filename()); diff --git a/libs/qsynedit/qsynedit/constants.h b/libs/qsynedit/qsynedit/constants.h index 37643883..889a692c 100644 --- a/libs/qsynedit/qsynedit/constants.h +++ b/libs/qsynedit/qsynedit/constants.h @@ -60,4 +60,5 @@ extern const QChar SoftBreakGlyph; } + #endif // CONSTANTS_H diff --git a/libs/qsynedit/qsynedit/qsynedit.cpp b/libs/qsynedit/qsynedit/qsynedit.cpp index 446f61d1..a7921893 100644 --- a/libs/qsynedit/qsynedit/qsynedit.cpp +++ b/libs/qsynedit/qsynedit/qsynedit.cpp @@ -113,8 +113,8 @@ QSynEdit::QSynEdit(QWidget *parent) : QAbstractScrollArea(parent), this->setFrameShape(QFrame::Panel); this->setFrameShadow(QFrame::Sunken); this->setLineWidth(1); - mInsertCaret = EditCaretType::ctVerticalLine; - mOverwriteCaret = EditCaretType::ctBlock; + mInsertCaret = EditCaretType::VerticalLine; + mOverwriteCaret = EditCaretType::Block; mActiveSelectionMode = SelectionMode::Normal; mReadOnly = false; @@ -3675,7 +3675,7 @@ void QSynEdit::paintCaret(QPainter &painter, const QRect rcClip) caretColor = mCaretColor; } switch(ct) { - case EditCaretType::ctVerticalLine: { + case EditCaretType::VerticalLine: { QRect caretRC; int size = std::max(1, mTextHeight/15); caretRC.setLeft(rcClip.left()+1); @@ -3685,7 +3685,7 @@ void QSynEdit::paintCaret(QPainter &painter, const QRect rcClip) painter.fillRect(caretRC,caretColor); break; } - case EditCaretType::ctHorizontalLine: { + case EditCaretType::HorizontalLine: { QRect caretRC; int size = std::max(1,mTextHeight/15); caretRC.setLeft(rcClip.left()); @@ -3695,10 +3695,10 @@ void QSynEdit::paintCaret(QPainter &painter, const QRect rcClip) painter.fillRect(caretRC,caretColor); break; } - case EditCaretType::ctBlock: + case EditCaretType::Block: painter.fillRect(rcClip, caretColor); break; - case EditCaretType::ctHalfBlock: + case EditCaretType::HalfBlock: QRect rc=rcClip; rc.setTop(rcClip.top()+rcClip.height() / 2); painter.fillRect(rcClip, caretColor); diff --git a/libs/qsynedit/qsynedit/qsynedit.h b/libs/qsynedit/qsynedit/qsynedit.h index cf876da4..9c589cdc 100644 --- a/libs/qsynedit/qsynedit/qsynedit.h +++ b/libs/qsynedit/qsynedit/qsynedit.h @@ -39,7 +39,7 @@ enum class ScrollStyle { }; enum class EditCaretType { - ctVerticalLine=0, ctHorizontalLine=1, ctHalfBlock=2, ctBlock=3 + VerticalLine=0, HorizontalLine=1, HalfBlock=2, Block=3 }; enum class StatusChange { @@ -113,12 +113,6 @@ enum class SearchAction { Exit }; - - -enum class TransientType { - ttBefore, ttAfter -}; - /* using SynPaintTransientProc = std::function; diff --git a/libs/qsynedit/qsynedit_zh_CN.ts b/libs/qsynedit/qsynedit_zh_CN.ts index d0eab0a3..8213f104 100644 --- a/libs/qsynedit/qsynedit_zh_CN.ts +++ b/libs/qsynedit/qsynedit_zh_CN.ts @@ -4288,7 +4288,7 @@ QSynedit::Document - + Can't open file '%1' for read! 无法读取文件"%1".