From 8732f7d37e1ace3308737edbf1934a53daf337a6 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Thu, 6 Jan 2022 20:46:27 +0800 Subject: [PATCH] - fix: shouldn't auto add /bin/gcc to compiler sets - fix: if a dir duplicates in PATH, don't add it to compiler sets repeatedly - enhancement: add "--sanitize=address" to compile option in the Debug compiler set in Linux --- NEWS.md | 3 + RedPandaIDE/RedPandaIDE.pro | 2 +- RedPandaIDE/RedPandaIDE_zh_CN.qm | Bin 110059 -> 110210 bytes RedPandaIDE/RedPandaIDE_zh_CN.ts | 904 +++++++++--------- RedPandaIDE/settings.cpp | 32 +- .../compilersetoptionwidget.cpp | 13 +- 6 files changed, 496 insertions(+), 458 deletions(-) diff --git a/NEWS.md b/NEWS.md index c2e7c67a..0ebff21e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,9 @@ Red Panda C++ Version 0.12.7 - fix: crash when close settings dialog in Ubuntu 20.04 (but we'll leak memory now...) - enhancement: add raylib.h to autolink - fix: shouldn't generate default autolink settings in linux + - fix: shouldn't auto add /bin/gcc to compiler sets + - fix: if a dir duplicates in PATH, don't add it to compiler sets repeatedly + - enhancement: add "--sanitize=address" to compile option in the Debug compiler set in Linux Red Panda C++ Version 0.12.6 - fix: heartbeat for gdb server async command shouldn't disable actions diff --git a/RedPandaIDE/RedPandaIDE.pro b/RedPandaIDE/RedPandaIDE.pro index c0f0f675..f341d3cc 100644 --- a/RedPandaIDE/RedPandaIDE.pro +++ b/RedPandaIDE/RedPandaIDE.pro @@ -15,7 +15,7 @@ isEmpty(PREFIX) { DEFINES += PREFIX=\\\"$${PREFIX}\\\" DEFINES += APP_NAME=\\\"$${APP_NAME}\\\" -DEFINES += REDPANDA_CPP_VERSION=\\\"beta.0.12.6\\\" +DEFINES += REDPANDA_CPP_VERSION=\\\"beta.0.12.7\\\" linux: { LINUX_DISTRO = $$system(cat /etc/issue) diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.qm b/RedPandaIDE/RedP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FD7L#|ApSpJQ6B>ZPU zyQsbXxuRp$1xjYNvFHR%WJ+w+dn8+S*{hp%yZ<#8aMKCh9{vu%?bb2D&q<$NRw_?%^5JoS*SB+yqe`-3 zaV~do1kmH;9-bSwYtwVr`JnEdDP(0JwigMiC z(bxV8xcM{gO#hbvr5#+_br#_6)Jfv1B^0wMJ*BDBW?}Vzpd+@VP0+iFO91`N`aJt3 zfXDjvc~PZ{wQ2I&J6JeHX?rKmr@)K=Zlt~$5w>y@S+m}oUDsh)Y*_@5YBnspI}TV- zV0b$II$%w|p}fBmz*}z!t_&y|dT1=mXK!dStUt6IP~2ds?N^rDc7Kvs_a*rsI?qb4 zkSxhqMqVkP#Joo;va=YzTn06z;(5-r#G z;Nru8>xaoJ=ZmX*`JD^f0JU!ZmBosm!C%q~vPZvw->*}IEYnb0_KAUa`1cnj0e(2a zpIo+InOl(LY>(|1{Dr5V1sFfbf7iE2DX!pe6kG%>H&QIy$4dJsm7UMx-yIvvb|Ops zovaRt#W$13A?r(~Jin_Ka7{6V9ByUboyxhE1{`r#{Wf`Wi?EK8xluIHXs(Ynwvu~h zp%`j3hP9|nvID7UCxn@OJj^wj`^vrRAUy#UyvqY0-Z zhTb(D+200W44U2^QMMl5MsAmnt^J7-t~hHuMPsfZ^9tcLM=M~hL)dpqnMccV8hY4o z)(8W$PXmme6i(eZ2^cq$JI`rv-zMC;Dgb=(wQ&32il#+3gdcx+O9{*86wAxP=&@Jw WM!r`^=LF`bHu2cin4&fubN>&>$rdO8 diff --git a/RedPandaIDE/RedPandaIDE_zh_CN.ts b/RedPandaIDE/RedPandaIDE_zh_CN.ts index 444c7fde..2e366c27 100644 --- a/RedPandaIDE/RedPandaIDE_zh_CN.ts +++ b/RedPandaIDE/RedPandaIDE_zh_CN.ts @@ -123,12 +123,12 @@ Copyright (c) 2020-2021 royqh1979@gmail.com 本程序附带一份GNU通用公共许可协议的副本。您也可以从GNU网站<http://www.gnu.org/licenses/>获取。 - + Version: 版本: - + Non-GCC Compiler 非GCC编译器 @@ -172,17 +172,17 @@ Copyright (c) 2020-2021 royqh1979@gmail.com BacktraceModel - + Function 函数 - + Filename 文件名 - + Line @@ -228,37 +228,37 @@ Copyright (c) 2020-2021 royqh1979@gmail.com BreakpointModel - + Filename 文件名 - + Line - + Condition 条件 - + Save file '%1' failed. 保存文件'%1'失败。 - + Can't open file '%1' for write. 无法写入文件'%1'. - + Error in json file '%1':%2 : %3 JSON文件'%1':%2中存在错误:%3 - + Can't open file '%1' for read. 无法读取文件'%1'. @@ -654,44 +654,44 @@ Copyright (c) 2020-2021 royqh1979@gmail.com CompilerManager - - - - - + + + + + No compiler set 无编译器设置 - - - - - + + + + + No compiler set is configured. 没有配置编译器设置。 - - - - - + + + + + Can't start debugging. 无法启动调试器 - + Encoding not support 不支持字符编码 - + Clang only support utf-8 encoding. Clang只支持UTF-8编码 - + Strings in the program might be wrongly processed. 程序中的文字内容可能无法被正确处理和显示。 @@ -1162,7 +1162,7 @@ Are you really want to continue? 无法在"%1"找到gdb server - + Execute to evaluate 执行以求值 @@ -1171,22 +1171,22 @@ Are you really want to continue? 不在当前语境中 - + Compile 编译 - + Source file is more recent than executable. 源文件比程序文件新。 - + Recompile? 重新编译? - + Signal "%1" Received: 收到信号"%1": @@ -1208,11 +1208,11 @@ Are you really want to continue? - - - - - + + + + + Error 错误 @@ -1221,70 +1221,70 @@ Are you really want to continue? 无法写入文件"%1" - + Save As 另存为 - + The text to be copied exceeds count limit! 要复制的内容超过了行数限制! - + The text to be copied exceeds character limit! 要复制的内容超过了字符数限制! - + The text to be cut exceeds count limit! 要剪切的内容超过了行数限制! - + The text to be cut exceeds character limit! 要剪切的内容超过了字符数限制! - + Print Document 打印文档 - - - + + + Ctrl+click for more info Ctrl+单击以获取更多信息 - - + + Symbol '%1' not found! 未找到符号'%1'! - + astyle not found 找不到astyle程序 - + Can't find astyle in "%1". 找不到astyle程序"%1". - + Break point condition 断点条件 - + Enter the condition of the breakpoint: 输入当前断点的生效条件: - + Readonly 只读 @@ -1397,32 +1397,32 @@ Are you really want to continue? 同时带格式复制为 - + Copy && Export As HTML 复制/导出为HTML - - + + Use background color 使用背景色 - - + + Use editor's color scheme Use editor's color schema 使用编辑器的配色方案 - - + + Color scheme Color schema 配色方案 - + Export As RTF 导出为RTF @@ -3173,18 +3173,18 @@ Are you really want to continue? MainWindow - + Red Panda C++ 小熊猫C++ - - - - - + + + + + Issues 编译器 @@ -3260,7 +3260,7 @@ Are you really want to continue? - + Debug Console 调试主控台 @@ -3336,7 +3336,7 @@ Are you really want to continue? 工具栏2 - + New 新建 @@ -3394,8 +3394,8 @@ Are you really want to continue? - - + + Compile 编译 @@ -3441,8 +3441,8 @@ Are you really want to continue? - - + + Copy 复制 @@ -3453,7 +3453,7 @@ Are you really want to continue? - + Paste 粘贴 @@ -3464,7 +3464,7 @@ Are you really want to continue? - + Select All 选择全部 @@ -3584,14 +3584,14 @@ Are you really want to continue? - + Problem Set 试题集 - + New Problem Set 新建试题集 @@ -3610,14 +3610,14 @@ Are you really want to continue? - + Save Problem Set 保存试题集 - + Load Problem Set 载入试题集 @@ -3653,7 +3653,7 @@ Are you really want to continue? - + Problem 试题 @@ -3957,7 +3957,7 @@ Are you really want to continue? - + Clear all breakpoints 删除所有断点 @@ -4058,7 +4058,7 @@ Are you really want to continue? - + Rename Symbol 重命名符号 @@ -4079,13 +4079,13 @@ Are you really want to continue? - + Export As RTF 导出为RTF - + Export As HTML 导出为HTML @@ -4210,7 +4210,7 @@ Are you really want to continue? - + Open Folder 打开文件夹 @@ -4220,42 +4220,42 @@ Are you really want to continue? 运行参数... - + File Encoding 文件编码 - + Recent Files 文件历史 - - + - + + Debugging 正在调试 - - + - + + Running 正在运行 - - + - + + Compiling 正在编译 @@ -4264,193 +4264,193 @@ Are you really want to continue? 行:%1 列:%2 已选择:%3 总行数:%4 总长度:%5 - + Line:%1 Col:%2 Selected:%3 Lines:%4 Length:%5 Line: %1 Col: %2 Selected: %3 Lines: %4 Length: %5 行: %1 列: %2 已选择 :%3 总行数: %4 总长度: %5 - + Read Only 只读 - + Insert 插入 - + Overwrite 覆写 - + Close project 关闭项目 - + Are you sure you want to close %1? 你确定要关闭'%1'吗? - - + + Confirm 确认 - - - + + + Source file is not compiled. 源文件尚未编译。 - - + + Compile now? 现在编译? - - + + Source file is more recent than executable. 源文件比可执行程序新。 - + Recompile now? 重新编译? - + No compiler set 无编译器设置 - + No compiler set is configured. 没有配置编译器设置。 - + Can't start debugging. 无法启动调试器 - - + + Enable debugging 启用调试参数 - - + + You have not enabled debugging info (-g3) and/or stripped it from the executable (-s) in Compiler Options.<BR /><BR />Do you want to correct this now? 当前编译设置中未启用调试选项(-g3),或启用了信息剥除选项(-s)<br /><br/>是否纠正这一问题? - + Project not built 项目尚未构建 - + Project hasn't been built. Build it now? 项目尚未构建。是否构建? - + Host applcation missing 宿主程序不存在 - + DLL project needs a host application to run. 动态链接库(DLL)需要一个宿主程序来运行。 - + But it's missing. 但它不存在。 - + Host application not exists 宿主程序不存在 - + Host application file '%1' doesn't exist. 宿主程序'%1'不存在。 - + Recompile? 重新编译? - - + + Save last open info error 保存上次打开信息失败 - + Can't remove old last open information file '%1' 无法删除旧上次打开信息文件'%1' - + Can't save last open info file '%1' 无法保存上次打开信息文件'%1' - + Load last open info error 载入上次打开信息失败 - + Can't load last open info file '%1' 无法载入上次打开信息文件'%1' - + Open Source File 打开源代码文件 - + Show detail debug logs 显示详细调试器日志 - + Copy all 全部复制 - - + + Clear 清除 - + Export 导出 - + Insert Snippet 插入代码段 - - + + Problem Set %1 试题集%1 @@ -4471,68 +4471,68 @@ Are you really want to continue? 或者选择使用其他的网络端口。 - - + + Rebuild Project 重新构建项目 - - + + Project has been modified, do you want to rebuild it? 项目已经被修改过,是否需要重新构建? - + Auto Save Error 自动保存出错 - + Auto save "%1" to "%2" failed:%3 自动保存"%1"到"%2"失败:%3 - + Properties... 试题属性... - + Set Problem Set Name 设置试题集名称 - + Problem Set Name: 试题集名称: - + Remove 删除 - + Remove All Bookmarks 删除全部书签 - + Modify Description 修改描述 - - - + + + Bookmark Description 书签描述 - - - + + + Description: 描述: @@ -4541,129 +4541,129 @@ Are you really want to continue? 在调试主控台中显示调试器输出 - + Remove this search 清除这次搜索 - + Clear all searches 删除所有搜索 - + Breakpoint condition... 断点条件... - + Break point condition 断点条件 - + Enter the condition of the breakpoint: 输入当前断点的生效条件: - + Remove All Breakpoints Remove all breakpoints 删除所有断点 - + Remove Breakpoint 删除当前断点 - + Rename File 重命名文件 - - + + Add Folder 添加文件夹 - + New folder 新文件夹 - + Folder name: 文件夹: - + Rename Folder 重命名 - + Remove Folder 删除文件夹 - + Sort By Type 按类型排序 - + Sort alphabetically 按名称排序 - + Show inherited members 显示继承的成员 - + Goto declaration 跳转到声明处 - + Goto definition 跳转到定义处 - + Open in Editor 在编辑器中打开 - + Open in External Program 使用外部程序打开 - + Open in Terminal 在终端中打开 - + Open in Windows Explorer 在Windows浏览器中打开 - + Character sets 字符集 - + %1 files autosaved 已自动保存%1个文件 - + Set answer to... 设置答案源代码... @@ -4684,97 +4684,97 @@ Are you really want to continue? C/C++源代码文件 (*.c *.cpp *.cc *.cxx) - + Save project 保存项目 - + The project '%1' has modifications. 项目'%1'有改动。 - - + + Do you want to save it? 需要保存吗? - - + + File Changed 文件已发生变化 - + New Project File? 新建项目文件? - + Do you want to add the new file to the project? 您是否要将新建的文件加入项目? - - - - + + + + Save Error 保存失败 - + Change Project Compiler Set 改变项目编译器配置集 - + Change the project's compiler set will lose all custom compiler set options. 改变项目的编译器配置集会导致所有的自定义编译器选项被重置。 - + Do you really want to do that? 你真的想要做那些吗? - + Do you really want to clear all breakpoints in this file? 您真的要清除该文件的所有断点吗? - + New project 新建项目 - + Close %1 and start new project? 关闭'%1'以打开新项目? - + Folder not exist 文件夹不存在 - + Folder '%1' doesn't exist. Create it now? 文件夹'%1'不存在。是否创建? - + Can't create folder 无法创建文件夹 - + Failed to create folder '%1'. 创建文件夹'%1'失败。 - + Save new project as @@ -4783,222 +4783,222 @@ Are you really want to continue? 小熊猫Dev-C++项目文件 (*.dev) - + New project fail 新建项目失败 - + Can't assign project template 无法使用模板创建项目 - + Remove file 删除文件 - + Remove the file from disk? 同时从硬盘上删除文件? - + untitled 无标题 - + New Project File Name 新的项目文件名 - + File Name: 文件名: - + File Already Exists! 文件已存在! - + File '%1' already exists! 文件'%1'已经存在! - + Add to project 添加到项目 - + Red Panda C++ project file (*.dev) 小熊猫C++项目文件(*.dev) - + Rename Error 重命名出错 - + Symbol '%1' is defined in system header. 符号'%1'在系统头文件中定义,无法修改。 - + New Name 新名称 - - + + Replace Error 替换出错 - + Can't open file '%1' for replace! 无法打开文件'%1'进行替换! - + Contents has changed since last search! 内容和上次查找时不一致。 - + Rich Text Format Files (*.rtf) RTF格式文件 (*.rtf) - + HTML Files (*.html) HTML文件 (*.html) - + The current problem set is not empty. 当前的试题集不是空的。 - + Problem %1 试题%1 - - + + Problem Set Files (*.pbs) 试题集文件 (*.pbs) - + Load Error 载入失败 - - + + Problem Case %1 试题案例%1 - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + Error 错误 - + Recent Projects 项目历史 - + File '%1' was changed. 磁盘文件'%1'已被修改。 - + Reload its content from disk? 是否重新读取它的内容? - + File '%1' was removed. 磁盘文件'%1'已被删除。 - + Keep it open? 是否保持它在小熊猫C++中打开的编辑窗口? - + Open 打开 - + Compile Failed 编译失败 - + Run Failed 运行失败 - - + + Confirm Convertion 确认转换 - - + + The editing file will be saved using %1 encoding. <br />This operation can't be reverted. <br />Are you sure to continue? 当前编辑器中的文件将会使用%1编码保存。<br />这项操作无法被撤回。<br />你确定要继续吗? - + New Watch Expression 新监视表达式 - + Enter Watch Expression (it is recommended to use 'this->' for class members): 输入监视表达式 - + Parsing file %1 of %2: "%3" (%1/%2)正在解析文件"%3" - - + + Done parsing %1 files in %2 seconds 完成%1个文件的解析,用时%2秒 - + (%1 files per second) (每秒%1个文件) @@ -5248,52 +5248,52 @@ Are you really want to continue? ProjectCompiler - + Building makefile... 正在构建makefile... - + - Filename: %1 - 文件名: %1 - + Can't open '%1' for write! 无法写入文件'%1'! - + - Resource File: %1 - 资源文件: %1 - + Compiling project changes... 正在编译项目修改... - + - Project Filename: %1 - 项目文件名: %1 - + - Compiler Set Name: %1 - 编译器配置: %1 - + Processing makefile: 正在处理makefile... - + - makefile processer: %1 - makefile处理器: %1 - + - Command: %1 %2 - 命令: %1 %2 @@ -5862,12 +5862,12 @@ Are you really want to continue? QObject - + Save 保存 - + Save changes to %1? 将修改保存到"%1"? @@ -5929,175 +5929,180 @@ Are you really want to continue? 无法载入自动链接设置 - - - - + + + + The following %1 directories don't exist: 下列%1文件夹不存在: - - + + binary 二进制 - + No %1 directories have been specified. 未指定%1文件夹 - + C include C包含 - - + + C++ include C++包含 - - - - + + + + Cannot find the %1 "%2" 无法找到%1程序"%2" - + C options C语言选项 - + Support all ANSI standard C programs (-ansi) 支持所有ANSI标准C程序(-ansi) - + Do not recognize asm,inline or typeof as a keyword (-fno-asm) 不支持将asm、inline和typeof作为关键字(-fno-asm) - + Imitate traditional C preprocessors (-traditional-cpp) 模仿传统C预处理器行为(-traditional-cpp) - + Code Generation 代码生成 - + Optimize for the following machine (-march) 生成特定机器的专用指令(-march) - + Optimize less, while maintaining full compatibility (-tune) 完整兼容特定机器,较少优化(-tune) - + Enable use of specific instructions (-mx) 启用特定指令集(-mx) - + Optimization level (-Ox) 优化级别(-Ox) - + Compile with the following pointer size (-mx) 使用下列指针大小编译(-mx) - + Language standard (-std) 语言标准(-std) - + Profile 性能分析 - + Generate debugging information (-g3) 生成调试信息(-g3) - + + Would you like Red Panda C++ to search for compilers in PATH? + 您同意小熊猫C++在PATH路径中寻找gcc编译器吗? + + + Generate profiling info for analysis (-pg) 生成性能分析信息(-pg) - + Warnings 代码警告 - + Inhibit all warning messages (-w) 忽略所有警告信息(-w) - + Show most warnings (-Wall) 启用常见问题警告(-Wall) - + Show some more warnings (-Wextra) 启用更多问题警告(-Wextra) - + Check ISO C/C++/C++0x conformance (-pedantic) 检查ISO C/C++/C++0x语法一致性(-pedantic) - + Only check the code for syntax errors (-fsyntax-only) 只进行语法检查(不编译)(-fsyntax-only) - + Make all warnings into errors (-Werror) 将警告作为错误处理(-Werror) - + Abort compilation on first error (-Wfatal-errors) 遇到第一个错误后立即中止编译(-Wfatal-errors) - + Linker 链接器 - + Link an Objective C program (-lobjc) 链接Objective-C程序 (-lobjc) - + Do not use standard system libraries (-nostdlib) 不使用标准库和系统启动文件(-nostdlib) - + Do not create a console window (-mwindows) 不产生控制台窗口(-mwindows) - + Strip executable (-s) 剥除附加信息(-s) @@ -6106,53 +6111,54 @@ Are you really want to continue? 链接Ojbective C程序(-lobjc) - + Output 输出 - + Put comments in generated assembly code (-fverbose-asm) 在生成的汇编代码中加入注释(-fverbose-asm) - + Use pipes instead of temporary files during compilation (-pipe) 编译时使用管道而不是临时文件(-pipe) - + Do not assemble, compile and generate the assemble code (-S) 只生成汇编代码(-S) - - + + Confirm 确认 - + The following problems were found during validation of compiler set "%1": 在验证编译器设置"%1"时遇到了下列问题: - + Would you like Red Panda C++ to remove them for you and add the default paths to the valid paths? 是否让小熊猫C++删除这些配置,并尝试重新建立配置? - + Leaving those directories will lead to problems during compilation.<br /><br />Unless you know exactly what you're doing, it is recommended that you click Yes. 如果仍然保留这些设置,可能会导致编译错误。<br /><br />请选择“是”,除非您清楚的知道选择“否”的后果, - + + Compiler set not configuared. 未配置编译器设置。 - + Would you like Red Panda C++ to search for compilers in the following locations: <BR />'%1'<BR />'%2'? 您需要小熊猫C++在下列位置搜索编译器吗:<br />%1<br />%2 @@ -6195,27 +6201,27 @@ Are you really want to continue? 无标题 - + Index %1 out of range 下标"%1"越界 - + bytes 字节 - + KB KB - + MB MB - + GB GB @@ -6504,31 +6510,31 @@ Are you really want to continue? 无标题 - + constructor 构造函数 - + destructor 析构函数 - - - - + + + + Can't open file '%1' for read. 无法读取文件'%1'. - - + + Can't open file '%1' for write. 无法写入文件'%1'. - + Can't parse problem set file '%1':%2 无法解析试题集文件"%1":%2 @@ -6536,12 +6542,12 @@ Are you really want to continue? RegisterModel - + Register 寄存器 - + Value @@ -6872,7 +6878,7 @@ Are you really want to continue? SettingsDialog - + Options 选项 @@ -6898,239 +6904,243 @@ Are you really want to continue? 取消 - + Appearence 外观 - - - - - - + + + + + + Environment 环境 - + File Association 文件关联 - + Shortcuts 快捷键 - + Folders 文件夹 - + Terminal 终端程序 - + Performance 性能 - - + + Compiler Set 编译器配置集 - - + + Compiler 编译器 - + Auto Link 自动链接 - - - - - - - + + + + + + + General 通用 - - - - - - - - - - - + + + + + + + + + + + + + Editor 编辑器 - + Font 字体 - + Copy & Export 复制/导出 - + + Color 配色 - + Code Completion 代码补全 - + Symbol Completion 符号补全 - + + Snippet 代码模板 - + Auto Syntax Checking 自动语法检查 - + Tooltips 信息提示 - + Auto save 自动保存 - + Misc 杂项 - - - - + + + + Program Runner 程序运行 - - + + Problem Set 试题集 - + Debugger 调试器 - - + + Code Formatter 代码排版 - + Program 程序 - + Tools 工具 - + Project Options 项目选项 - - - - - - - - - - + + + + + + + + + + Project 项目 - + Files 文件 - + Custom Compile options 自定义编译选项 - + Directories 文件夹 - + Precompiled Header 预编译头文件 - + Makefile Makefile - + Output 输出 - + DLL host DLL宿主 - + Version info 版本信息 - + Save Changes 保存修改 - + There are changes in the settings, do you want to save them before swtich to other page? 本页中有尚未保存的设置修改,是否保存后再切换到其他页? @@ -7291,12 +7301,12 @@ Are you really want to continue? SynEditStringList - + Can't open file '%1' for read! 无法读取文件'%1'! - + Can't open file '%1' for save! 无法写入文件'%2'! @@ -7304,22 +7314,22 @@ Are you really want to continue? TodoModel - + Filename 文件名 - + Line - + Column - + Content 内容 @@ -7457,49 +7467,49 @@ Are you really want to continue? WatchModel - + Save file '%1' failed. 保存文件'%1'失败。 - + Can't open file '%1' for write. 无法写入文件'%1'. - + Error in json file '%1':%2 : %3 JSON文件'%1':%2中存在错误:%3 - - + + Execute to evaluate 执行以求值 - - + + Not Valid 在当前作用域中无效 - + Can't open file '%1' for read. 无法读取文件'%1'. - + Expression 表达式 - + Type 类型 - + Value diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index 2be48262..d37e4d1f 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -26,6 +26,7 @@ #include #include #include +#include const char ValueToChar[28] = {'0', '1', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', @@ -2408,6 +2409,11 @@ static void setDebugOptions(Settings::PCompilerSet pSet) { pSet->setOption(pOption,'1'); } +#ifdef Q_OS_LINUX + pSet->setCustomCompileParams("--sanitize=address"); + pSet->setUseCustomCompileParams(true); +#endif + // pOption = pSet->findOption("-static"); // if (pOption) { // pSet->setOption(pOption,'1'); @@ -2502,14 +2508,21 @@ void Settings::CompilerSets::clearSets() void Settings::CompilerSets::findSets() { clearSets(); +#ifdef Q_OS_WIN addSets(includeTrailingPathDelimiter(mSettings->dirs().appDir())+"MinGW32"+QDir::separator()+"bin"); addSets(includeTrailingPathDelimiter(mSettings->dirs().appDir())+"MinGW64"+QDir::separator()+"bin"); +#endif QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); QString path = env.value("PATH"); QStringList pathList = path.split(PATH_SEPARATOR); + QSet searched; foreach (const QString& s, pathList){ - addSets(s); + if (searched.contains(s)) + continue;; + searched.insert(s); + if (s!="/bin") // /bin/gcc is symbolic link to /usr/bin/gcc + addSets(s); } } @@ -2581,12 +2594,19 @@ void Settings::CompilerSets::loadSets() return; } } else { +#ifdef Q_OS_WIN + QString msg = QObject::tr("Compiler set not configuared.") + +"

" + +QObject::tr("Would you like Red Panda C++ to search for compilers in the following locations:
'%1'
'%2'? ") + .arg(includeTrailingPathDelimiter(pSettings->dirs().appDir()) + "MinGW32") + .arg(includeTrailingPathDelimiter(pSettings->dirs().appDir()) + "MinGW64"); +#else + QString msg = QObject::tr("Compiler set not configuared.") + +"

" + +QObject::tr("Would you like Red Panda C++ to search for compilers in PATH?"); +#endif if (QMessageBox::warning(nullptr,QObject::tr("Confirm"), - QObject::tr("Compiler set not configuared.") - +"

" - +QObject::tr("Would you like Red Panda C++ to search for compilers in the following locations:
'%1'
'%2'? ") - .arg(includeTrailingPathDelimiter(pSettings->dirs().appDir()) + "MinGW32") - .arg(includeTrailingPathDelimiter(pSettings->dirs().appDir()) + "MinGW64"), + msg, QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) { return; } diff --git a/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp b/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp index 847ce14d..48d743f8 100644 --- a/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp +++ b/RedPandaIDE/settingsdialog/compilersetoptionwidget.cpp @@ -234,11 +234,16 @@ void CompilerSetOptionWidget::saveCurrentCompilerSet() void CompilerSetOptionWidget::on_btnFindCompilers_pressed() { - if (QMessageBox::warning(this,tr("Confirm"), - tr("Red Panda C++ will clear current compiler list and search" - " for compilers in the following locations:\n '%1'\n'%2'\nAre you really want to continue?") +#ifdef Q_OS_WIN + QString msg = tr("Red Panda C++ will clear current compiler list and search" + " for compilers in the following locations:
'%1'
'%2'
Are you really want to continue?") .arg(includeTrailingPathDelimiter(pSettings->dirs().appDir()) + "MinGW32") - .arg(includeTrailingPathDelimiter(pSettings->dirs().appDir()) + "MinGW64"), + .arg(includeTrailingPathDelimiter(pSettings->dirs().appDir()) + "MinGW64"); +#else + QString msg = tr("Red Panda C++ will clear current compiler list and search" + " for compilers in the the PATH.
Are you really want to continue?"); +#endif + if (QMessageBox::warning(this,tr("Confirm"),msg, QMessageBox::Ok | QMessageBox::Cancel) != QMessageBox::Ok ) return; pSettings->compilerSets().clearSets();