- enhancement: more charset selection in the edit menu

- fix: can't correctly get system default encoding name when save file
 - fix: Tokenizer can't correctly handle array parameters
 - fix: debug actions enabled states not correct updated when processing debug mouse tooltips
This commit is contained in:
royqh1979@gmail.com 2021-09-28 22:26:12 +08:00
parent a4f60e45bf
commit 2d393cb509
11 changed files with 541 additions and 337 deletions

View File

@ -2,6 +2,11 @@ Version 0.2.2
- enhancement: support C++ using type alias; - enhancement: support C++ using type alias;
- fix: when press shift, completion popu window will hide - fix: when press shift, completion popu window will hide
- enhancement: options in debugger setting widget, to skip system/project/custom header&project files when step into - enhancement: options in debugger setting widget, to skip system/project/custom header&project files when step into
- fix: icon not correctly displayed for global variables in the class browser
- enhancement: more charset selection in the edit menu
- fix: can't correctly get system default encoding name when save file
- fix: Tokenizer can't correctly handle array parameters
- fix: debug actions enabled states not correct updated when processing debug mouse tooltips
Version 0.2.1 Version 0.2.1
- fix: crash when load last opens - fix: crash when load last opens

View File

@ -88,6 +88,120 @@
<translation></translation> <translation></translation>
</message> </message>
</context> </context>
<context>
<name>CharsetInfoManager</name>
<message>
<location filename="platform.cpp" line="68"/>
<location filename="platform.cpp" line="111"/>
<location filename="platform.cpp" line="175"/>
<source>Arabic</source>
<translation></translation>
</message>
<message>
<location filename="platform.cpp" line="69"/>
<location filename="platform.cpp" line="83"/>
<location filename="platform.cpp" line="108"/>
<location filename="platform.cpp" line="176"/>
<source>Greek</source>
<translation></translation>
</message>
<message>
<location filename="platform.cpp" line="70"/>
<location filename="platform.cpp" line="112"/>
<location filename="platform.cpp" line="173"/>
<location filename="platform.cpp" line="179"/>
<source>Baltic</source>
<translation></translation>
</message>
<message>
<location filename="platform.cpp" line="71"/>
<location filename="platform.cpp" line="75"/>
<location filename="platform.cpp" line="76"/>
<location filename="platform.cpp" line="79"/>
<location filename="platform.cpp" line="107"/>
<location filename="platform.cpp" line="170"/>
<location filename="platform.cpp" line="181"/>
<source>Western Europe</source>
<translation>西</translation>
</message>
<message>
<location filename="platform.cpp" line="72"/>
<location filename="platform.cpp" line="105"/>
<source>Central Europe</source>
<translation></translation>
</message>
<message>
<location filename="platform.cpp" line="73"/>
<location filename="platform.cpp" line="82"/>
<location filename="platform.cpp" line="106"/>
<location filename="platform.cpp" line="115"/>
<location filename="platform.cpp" line="159"/>
<location filename="platform.cpp" line="169"/>
<location filename="platform.cpp" line="174"/>
<source>Cyrillic</source>
<translation>西</translation>
</message>
<message>
<location filename="platform.cpp" line="74"/>
<location filename="platform.cpp" line="109"/>
<location filename="platform.cpp" line="172"/>
<location filename="platform.cpp" line="178"/>
<source>Turkish</source>
<translation></translation>
</message>
<message>
<location filename="platform.cpp" line="77"/>
<location filename="platform.cpp" line="81"/>
<source>Northern Europe</source>
<translation></translation>
</message>
<message>
<location filename="platform.cpp" line="78"/>
<location filename="platform.cpp" line="110"/>
<location filename="platform.cpp" line="177"/>
<source>Hebrew</source>
<translation></translation>
</message>
<message>
<location filename="platform.cpp" line="85"/>
<source>Thai</source>
<translation></translation>
</message>
<message>
<location filename="platform.cpp" line="87"/>
<location filename="platform.cpp" line="197"/>
<source>Japanese</source>
<translation></translation>
</message>
<message>
<location filename="platform.cpp" line="88"/>
<location filename="platform.cpp" line="90"/>
<location filename="platform.cpp" line="202"/>
<source>Chinese</source>
<translation></translation>
</message>
<message>
<location filename="platform.cpp" line="89"/>
<location filename="platform.cpp" line="199"/>
<source>Korean</source>
<translation></translation>
</message>
<message>
<location filename="platform.cpp" line="113"/>
<source>Vietnamese</source>
<translation></translation>
</message>
<message>
<location filename="platform.cpp" line="171"/>
<source>Eastern Europe</source>
<translation></translation>
</message>
<message>
<location filename="platform.cpp" line="180"/>
<source>Celtic</source>
<translation></translation>
</message>
</context>
<context> <context>
<name>ColorEdit</name> <name>ColorEdit</name>
<message> <message>
@ -2190,7 +2304,7 @@ Are you really want to continue?</source>
</message> </message>
<message> <message>
<location filename="mainwindow.ui" line="300"/> <location filename="mainwindow.ui" line="300"/>
<location filename="mainwindow.cpp" line="2500"/> <location filename="mainwindow.cpp" line="2551"/>
<source>Issues</source> <source>Issues</source>
<translation></translation> <translation></translation>
</message> </message>
@ -2334,7 +2448,7 @@ Are you really want to continue?</source>
<translation type="vanished">2</translation> <translation type="vanished">2</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="93"/> <location filename="mainwindow.cpp" line="94"/>
<source>New</source> <source>New</source>
<translation></translation> <translation></translation>
</message> </message>
@ -2392,10 +2506,10 @@ Are you really want to continue?</source>
<location filename="mainwindow.ui" line="965"/> <location filename="mainwindow.ui" line="965"/>
<location filename="mainwindow.ui" line="1110"/> <location filename="mainwindow.ui" line="1110"/>
<location filename="mainwindow.ui" line="1113"/> <location filename="mainwindow.ui" line="1113"/>
<location filename="mainwindow.cpp" line="1157"/> <location filename="mainwindow.cpp" line="1154"/>
<location filename="mainwindow.cpp" line="1168"/> <location filename="mainwindow.cpp" line="1165"/>
<location filename="mainwindow.cpp" line="2214"/> <location filename="mainwindow.cpp" line="2265"/>
<location filename="mainwindow.cpp" line="2225"/> <location filename="mainwindow.cpp" line="2276"/>
<source>Compile</source> <source>Compile</source>
<translation></translation> <translation></translation>
</message> </message>
@ -2441,7 +2555,7 @@ Are you really want to continue?</source>
</message> </message>
<message> <message>
<location filename="mainwindow.ui" line="1181"/> <location filename="mainwindow.ui" line="1181"/>
<location filename="mainwindow.cpp" line="1558"/> <location filename="mainwindow.cpp" line="1555"/>
<source>Copy</source> <source>Copy</source>
<translation></translation> <translation></translation>
</message> </message>
@ -2795,7 +2909,7 @@ Are you really want to continue?</source>
</message> </message>
<message> <message>
<location filename="mainwindow.ui" line="1598"/> <location filename="mainwindow.ui" line="1598"/>
<location filename="mainwindow.cpp" line="3266"/> <location filename="mainwindow.cpp" line="3317"/>
<source>Clear all breakpoints</source> <source>Clear all breakpoints</source>
<translation></translation> <translation></translation>
</message> </message>
@ -2890,42 +3004,42 @@ Are you really want to continue?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="98"/> <location filename="mainwindow.cpp" line="1855"/>
<source>File Encoding</source> <source>File Encoding</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="116"/> <location filename="mainwindow.cpp" line="106"/>
<source>Recent Files</source> <source>Recent Files</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="465"/> <location filename="mainwindow.cpp" line="462"/>
<location filename="mainwindow.cpp" line="467"/> <location filename="mainwindow.cpp" line="464"/>
<location filename="mainwindow.cpp" line="497"/> <location filename="mainwindow.cpp" line="494"/>
<location filename="mainwindow.cpp" line="499"/> <location filename="mainwindow.cpp" line="496"/>
<location filename="mainwindow.cpp" line="526"/> <location filename="mainwindow.cpp" line="523"/>
<location filename="mainwindow.cpp" line="528"/> <location filename="mainwindow.cpp" line="525"/>
<source>Debugging</source> <source>Debugging</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="470"/> <location filename="mainwindow.cpp" line="467"/>
<location filename="mainwindow.cpp" line="472"/> <location filename="mainwindow.cpp" line="469"/>
<location filename="mainwindow.cpp" line="503"/> <location filename="mainwindow.cpp" line="500"/>
<location filename="mainwindow.cpp" line="505"/> <location filename="mainwindow.cpp" line="502"/>
<location filename="mainwindow.cpp" line="531"/> <location filename="mainwindow.cpp" line="528"/>
<location filename="mainwindow.cpp" line="533"/> <location filename="mainwindow.cpp" line="530"/>
<source>Running</source> <source>Running</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="475"/> <location filename="mainwindow.cpp" line="472"/>
<location filename="mainwindow.cpp" line="477"/> <location filename="mainwindow.cpp" line="474"/>
<location filename="mainwindow.cpp" line="509"/> <location filename="mainwindow.cpp" line="506"/>
<location filename="mainwindow.cpp" line="511"/> <location filename="mainwindow.cpp" line="508"/>
<location filename="mainwindow.cpp" line="536"/> <location filename="mainwindow.cpp" line="533"/>
<location filename="mainwindow.cpp" line="538"/> <location filename="mainwindow.cpp" line="535"/>
<source>Compiling</source> <source>Compiling</source>
<translation></translation> <translation></translation>
</message> </message>
@ -2934,421 +3048,427 @@ Are you really want to continue?</source>
<translation type="vanished">:%1 :%2 :%3 :%4 :%5</translation> <translation type="vanished">:%1 :%2 :%3 :%4 :%5</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="670"/> <location filename="mainwindow.cpp" line="667"/>
<source>Line:%1 Col:%2 Selected:%3 Lines:%4 Length:%5</source> <source>Line:%1 Col:%2 Selected:%3 Lines:%4 Length:%5</source>
<translation>:%1 :%2 :%3 :%4 :%5</translation> <translation>:%1 :%2 :%3 :%4 :%5</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="688"/> <location filename="mainwindow.cpp" line="685"/>
<source>Read Only</source> <source>Read Only</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="690"/> <location filename="mainwindow.cpp" line="687"/>
<source>Insert</source> <source>Insert</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="692"/> <location filename="mainwindow.cpp" line="689"/>
<source>Overwrite</source> <source>Overwrite</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="755"/> <location filename="mainwindow.cpp" line="752"/>
<source>Close project</source> <source>Close project</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="756"/> <location filename="mainwindow.cpp" line="753"/>
<source>Are you sure you want to close %1?</source> <source>Are you sure you want to close %1?</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="949"/> <location filename="mainwindow.cpp" line="946"/>
<location filename="mainwindow.cpp" line="964"/> <location filename="mainwindow.cpp" line="961"/>
<source>Confirm</source> <source>Confirm</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="950"/> <location filename="mainwindow.cpp" line="947"/>
<location filename="mainwindow.cpp" line="958"/> <location filename="mainwindow.cpp" line="955"/>
<location filename="mainwindow.cpp" line="1158"/> <location filename="mainwindow.cpp" line="1155"/>
<source>Source file is not compiled.</source> <source>Source file is not compiled.</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="951"/> <location filename="mainwindow.cpp" line="948"/>
<location filename="mainwindow.cpp" line="1158"/> <location filename="mainwindow.cpp" line="1155"/>
<source>Compile now?</source> <source>Compile now?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="965"/> <location filename="mainwindow.cpp" line="962"/>
<location filename="mainwindow.cpp" line="1169"/> <location filename="mainwindow.cpp" line="1166"/>
<source>Source file is more recent than executable.</source> <source>Source file is more recent than executable.</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="966"/> <location filename="mainwindow.cpp" line="963"/>
<source>Recompile now?</source> <source>Recompile now?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1027"/> <location filename="mainwindow.cpp" line="1024"/>
<source>No compiler set</source> <source>No compiler set</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1028"/> <location filename="mainwindow.cpp" line="1025"/>
<source>No compiler set is configured.</source> <source>No compiler set is configured.</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1028"/> <location filename="mainwindow.cpp" line="1025"/>
<source>Can&apos;t start debugging.</source> <source>Can&apos;t start debugging.</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1043"/> <location filename="mainwindow.cpp" line="1040"/>
<location filename="mainwindow.cpp" line="1126"/> <location filename="mainwindow.cpp" line="1123"/>
<source>Enable debugging</source> <source>Enable debugging</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1044"/> <location filename="mainwindow.cpp" line="1041"/>
<location filename="mainwindow.cpp" line="1127"/> <location filename="mainwindow.cpp" line="1124"/>
<source>You have not enabled debugging info (-g3) and/or stripped it from the executable (-s) in Compiler Options.&lt;BR /&gt;&lt;BR /&gt;Do you want to correct this now?</source> <source>You have not enabled debugging info (-g3) and/or stripped it from the executable (-s) in Compiler Options.&lt;BR /&gt;&lt;BR /&gt;Do you want to correct this now?</source>
<translation>(-g3)(-s)&lt;br /&gt;&lt;br/&gt;</translation> <translation>(-g3)(-s)&lt;br /&gt;&lt;br/&gt;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1063"/> <location filename="mainwindow.cpp" line="1060"/>
<source>Project not built</source> <source>Project not built</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1064"/> <location filename="mainwindow.cpp" line="1061"/>
<source>Project hasn&apos;t been built. Build it now?</source> <source>Project hasn&apos;t been built. Build it now?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1078"/> <location filename="mainwindow.cpp" line="1075"/>
<source>Host applcation missing</source> <source>Host applcation missing</source>
<translation>宿</translation> <translation>宿</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1079"/> <location filename="mainwindow.cpp" line="1076"/>
<source>DLL project needs a host application to run.</source> <source>DLL project needs a host application to run.</source>
<translation>DLL宿</translation> <translation>DLL宿</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1081"/> <location filename="mainwindow.cpp" line="1078"/>
<source>But it&apos;s missing.</source> <source>But it&apos;s missing.</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1086"/> <location filename="mainwindow.cpp" line="1083"/>
<source>Host application not exists</source> <source>Host application not exists</source>
<translation>宿</translation> <translation>宿</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1087"/> <location filename="mainwindow.cpp" line="1084"/>
<source>Host application file &apos;%1&apos; doesn&apos;t exist.</source> <source>Host application file &apos;%1&apos; doesn&apos;t exist.</source>
<translation>宿&apos;%1&apos;</translation> <translation>宿&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1169"/> <location filename="mainwindow.cpp" line="1166"/>
<source>Recompile?</source> <source>Recompile?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1449"/> <location filename="mainwindow.cpp" line="1446"/>
<location filename="mainwindow.cpp" line="1475"/> <location filename="mainwindow.cpp" line="1472"/>
<source>Save last open info error</source> <source>Save last open info error</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1450"/> <location filename="mainwindow.cpp" line="1447"/>
<source>Can&apos;t remove old last open information file &apos;%1&apos;</source> <source>Can&apos;t remove old last open information file &apos;%1&apos;</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1476"/> <location filename="mainwindow.cpp" line="1473"/>
<source>Can&apos;t save last open info file &apos;%1&apos;</source> <source>Can&apos;t save last open info file &apos;%1&apos;</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1491"/> <location filename="mainwindow.cpp" line="1488"/>
<source>Load last open info error</source> <source>Load last open info error</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1492"/> <location filename="mainwindow.cpp" line="1489"/>
<source>Can&apos;t load last open info file &apos;%1&apos;</source> <source>Can&apos;t load last open info file &apos;%1&apos;</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1571"/> <location filename="mainwindow.cpp" line="1568"/>
<source>Copy all</source> <source>Copy all</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1584"/> <location filename="mainwindow.cpp" line="1581"/>
<source>Clear</source> <source>Clear</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1596"/> <location filename="mainwindow.cpp" line="1593"/>
<source>Remove this search</source> <source>Remove this search</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1606"/> <location filename="mainwindow.cpp" line="1603"/>
<source>Clear all searches</source> <source>Clear all searches</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1618"/> <location filename="mainwindow.cpp" line="1615"/>
<source>Breakpoint condition...</source> <source>Breakpoint condition...</source>
<translation>...</translation> <translation>...</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1630"/> <location filename="mainwindow.cpp" line="1627"/>
<source>Break point condition</source> <source>Break point condition</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1631"/> <location filename="mainwindow.cpp" line="1628"/>
<source>Enter the condition of the breakpoint:</source> <source>Enter the condition of the breakpoint:</source>
<translation>:</translation> <translation>:</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1640"/> <location filename="mainwindow.cpp" line="1637"/>
<source>Remove all breakpoints</source> <source>Remove all breakpoints</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1652"/> <location filename="mainwindow.cpp" line="1649"/>
<source>Rename File</source> <source>Rename File</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1660"/> <location filename="mainwindow.cpp" line="1657"/>
<location filename="mainwindow.cpp" line="1679"/> <location filename="mainwindow.cpp" line="1676"/>
<source>Add Folder</source> <source>Add Folder</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1676"/> <location filename="mainwindow.cpp" line="1673"/>
<source>New folder</source> <source>New folder</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1680"/> <location filename="mainwindow.cpp" line="1677"/>
<source>Folder name:</source> <source>Folder name:</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1694"/> <location filename="mainwindow.cpp" line="1691"/>
<source>Rename Folder</source> <source>Rename Folder</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1702"/> <location filename="mainwindow.cpp" line="1699"/>
<source>Remove Folder</source> <source>Remove Folder</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1727"/> <location filename="mainwindow.cpp" line="1724"/>
<source>Sort By Type</source> <source>Sort By Type</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1732"/> <location filename="mainwindow.cpp" line="1729"/>
<source>Sort alphabetically</source> <source>Sort alphabetically</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1737"/> <location filename="mainwindow.cpp" line="1734"/>
<source>Show inherited members</source> <source>Show inherited members</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1742"/> <location filename="mainwindow.cpp" line="1739"/>
<source>Goto declaration</source> <source>Goto declaration</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1745"/> <location filename="mainwindow.cpp" line="1742"/>
<source>Goto definition</source> <source>Goto definition</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="1883"/> <location filename="mainwindow.cpp" line="1821"/>
<source>Character sets</source>
<translation></translation>
</message>
<message>
<location filename="mainwindow.cpp" line="1934"/>
<source>%1 files autosaved</source> <source>%1 files autosaved</source>
<translation>%1</translation> <translation>%1</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2134"/> <location filename="mainwindow.cpp" line="2185"/>
<source>Save project</source> <source>Save project</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2135"/> <location filename="mainwindow.cpp" line="2186"/>
<source>The project &apos;%1&apos; has modifications.</source> <source>The project &apos;%1&apos; has modifications.</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2137"/> <location filename="mainwindow.cpp" line="2188"/>
<source>Do you want to save it?</source> <source>Do you want to save it?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3267"/> <location filename="mainwindow.cpp" line="3318"/>
<source>Do you really want to clear all breakpoints in this file?</source> <source>Do you really want to clear all breakpoints in this file?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3446"/> <location filename="mainwindow.cpp" line="3497"/>
<source>New project</source> <source>New project</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3447"/> <location filename="mainwindow.cpp" line="3498"/>
<source>Close %1 and start new project?</source> <source>Close %1 and start new project?</source>
<translation>&apos;%1&apos;?</translation> <translation>&apos;%1&apos;?</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3459"/> <location filename="mainwindow.cpp" line="3510"/>
<source>Folder not exist</source> <source>Folder not exist</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3460"/> <location filename="mainwindow.cpp" line="3511"/>
<source>Folder &apos;%1&apos; doesn&apos;t exist. Create it now?</source> <source>Folder &apos;%1&apos; doesn&apos;t exist. Create it now?</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3467"/> <location filename="mainwindow.cpp" line="3518"/>
<source>Can&apos;t create folder</source> <source>Can&apos;t create folder</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3468"/> <location filename="mainwindow.cpp" line="3519"/>
<source>Failed to create folder &apos;%1&apos;.</source> <source>Failed to create folder &apos;%1&apos;.</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3483"/> <location filename="mainwindow.cpp" line="3534"/>
<source>Save new project as</source> <source>Save new project as</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3485"/> <location filename="mainwindow.cpp" line="3536"/>
<source>Red panda Dev-C++ project file (*.dev)</source> <source>Red panda Dev-C++ project file (*.dev)</source>
<translation>Dev-C++ (*.dev)</translation> <translation>Dev-C++ (*.dev)</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3496"/> <location filename="mainwindow.cpp" line="3547"/>
<source>New project fail</source> <source>New project fail</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3497"/> <location filename="mainwindow.cpp" line="3548"/>
<source>Can&apos;t assign project template</source> <source>Can&apos;t assign project template</source>
<translation>使</translation> <translation>使</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3554"/> <location filename="mainwindow.cpp" line="3605"/>
<source>Add to project</source> <source>Add to project</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="739"/> <location filename="mainwindow.cpp" line="736"/>
<location filename="mainwindow.cpp" line="2221"/> <location filename="mainwindow.cpp" line="1846"/>
<location filename="mainwindow.cpp" line="2286"/> <location filename="mainwindow.cpp" line="2272"/>
<location filename="mainwindow.cpp" line="2306"/> <location filename="mainwindow.cpp" line="2337"/>
<location filename="mainwindow.cpp" line="2408"/> <location filename="mainwindow.cpp" line="2357"/>
<location filename="mainwindow.cpp" line="2420"/> <location filename="mainwindow.cpp" line="2459"/>
<location filename="mainwindow.cpp" line="2730"/> <location filename="mainwindow.cpp" line="2471"/>
<location filename="mainwindow.cpp" line="2742"/> <location filename="mainwindow.cpp" line="2781"/>
<location filename="mainwindow.cpp" line="2793"/>
<source>Error</source> <source>Error</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="112"/> <location filename="mainwindow.cpp" line="102"/>
<source>Recent Projects</source> <source>Recent Projects</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2215"/> <location filename="mainwindow.cpp" line="2266"/>
<source>File &apos;%1&apos; was changed.</source> <source>File &apos;%1&apos; was changed.</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2215"/> <location filename="mainwindow.cpp" line="2266"/>
<source>Reload its content from disk?</source> <source>Reload its content from disk?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2226"/> <location filename="mainwindow.cpp" line="2277"/>
<source>File &apos;%1&apos; was removed.</source> <source>File &apos;%1&apos; was removed.</source>
<translation>&apos;%1&apos;</translation> <translation>&apos;%1&apos;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2226"/> <location filename="mainwindow.cpp" line="2277"/>
<source>Keep it open?</source> <source>Keep it open?</source>
<translation>C++</translation> <translation>C++</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2302"/> <location filename="mainwindow.cpp" line="2353"/>
<source>Open</source> <source>Open</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2578"/> <location filename="mainwindow.cpp" line="2629"/>
<source>Compile Failed</source> <source>Compile Failed</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2583"/> <location filename="mainwindow.cpp" line="2634"/>
<source>Run Failed</source> <source>Run Failed</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2759"/> <location filename="mainwindow.cpp" line="2810"/>
<location filename="mainwindow.cpp" line="2773"/> <location filename="mainwindow.cpp" line="2824"/>
<source>Confirm Convertion</source> <source>Confirm Convertion</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2760"/> <location filename="mainwindow.cpp" line="2811"/>
<location filename="mainwindow.cpp" line="2774"/> <location filename="mainwindow.cpp" line="2825"/>
<source>The editing file will be saved using %1 encoding. &lt;br /&gt;This operation can&apos;t be reverted. &lt;br /&gt;Are you sure to continue?</source> <source>The editing file will be saved using %1 encoding. &lt;br /&gt;This operation can&apos;t be reverted. &lt;br /&gt;Are you sure to continue?</source>
<translation>使%1&lt;br /&gt;&lt;br /&gt;</translation> <translation>使%1&lt;br /&gt;&lt;br /&gt;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2940"/> <location filename="mainwindow.cpp" line="2991"/>
<source>New Watch Expression</source> <source>New Watch Expression</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2941"/> <location filename="mainwindow.cpp" line="2992"/>
<source>Enter Watch Expression (it is recommended to use &apos;this-&gt;&apos; for class members):</source> <source>Enter Watch Expression (it is recommended to use &apos;this-&gt;&apos; for class members):</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="2987"/> <location filename="mainwindow.cpp" line="3038"/>
<source>Parsing file %1 of %2: &quot;%3&quot;</source> <source>Parsing file %1 of %2: &quot;%3&quot;</source>
<translation>%1/%2&quot;%3&quot;</translation> <translation>%1/%2&quot;%3&quot;</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3009"/> <location filename="mainwindow.cpp" line="3060"/>
<location filename="mainwindow.cpp" line="3015"/> <location filename="mainwindow.cpp" line="3066"/>
<source>Done parsing %1 files in %2 seconds</source> <source>Done parsing %1 files in %2 seconds</source>
<translation>%1,%2</translation> <translation>%1,%2</translation>
</message> </message>
<message> <message>
<location filename="mainwindow.cpp" line="3012"/> <location filename="mainwindow.cpp" line="3063"/>
<source>(%1 files per second)</source> <source>(%1 files per second)</source>
<translation>(%1</translation> <translation>(%1</translation>
</message> </message>
@ -3551,32 +3671,32 @@ Are you really want to continue?</source>
<translation>- : %1</translation> <translation>- : %1</translation>
</message> </message>
<message> <message>
<location filename="compiler/projectcompiler.cpp" line="450"/> <location filename="compiler/projectcompiler.cpp" line="454"/>
<source>Compiling project changes...</source> <source>Compiling project changes...</source>
<translation>...</translation> <translation>...</translation>
</message> </message>
<message> <message>
<location filename="compiler/projectcompiler.cpp" line="452"/> <location filename="compiler/projectcompiler.cpp" line="456"/>
<source>- Project Filename: %1</source> <source>- Project Filename: %1</source>
<translation>- : %1</translation> <translation>- : %1</translation>
</message> </message>
<message> <message>
<location filename="compiler/projectcompiler.cpp" line="453"/> <location filename="compiler/projectcompiler.cpp" line="457"/>
<source>- Compiler Set Name: %1</source> <source>- Compiler Set Name: %1</source>
<translation>- : %1</translation> <translation>- : %1</translation>
</message> </message>
<message> <message>
<location filename="compiler/projectcompiler.cpp" line="474"/> <location filename="compiler/projectcompiler.cpp" line="478"/>
<source>Processing makefile:</source> <source>Processing makefile:</source>
<translation>makefile...</translation> <translation>makefile...</translation>
</message> </message>
<message> <message>
<location filename="compiler/projectcompiler.cpp" line="476"/> <location filename="compiler/projectcompiler.cpp" line="480"/>
<source>- makefile processer: %1</source> <source>- makefile processer: %1</source>
<translation>- makefile处理器: %1</translation> <translation>- makefile处理器: %1</translation>
</message> </message>
<message> <message>
<location filename="compiler/projectcompiler.cpp" line="477"/> <location filename="compiler/projectcompiler.cpp" line="481"/>
<source>- Command: %1 %2</source> <source>- Command: %1 %2</source>
<translation>- : %1 %2</translation> <translation>- : %1 %2</translation>
</message> </message>
@ -3668,32 +3788,32 @@ Are you really want to continue?</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/projectfileswidget.ui" line="60"/> <location filename="settingsdialog/projectfileswidget.ui" line="98"/>
<source>Include in linking</source> <source>Include in linking</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/projectfileswidget.ui" line="67"/> <location filename="settingsdialog/projectfileswidget.ui" line="62"/>
<source>Build Priority:</source> <source>Build Priority:</source>
<translation>:</translation> <translation>:</translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/projectfileswidget.ui" line="77"/> <location filename="settingsdialog/projectfileswidget.ui" line="91"/>
<source>Include in compilation</source> <source>Include in compilation</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/projectfileswidget.ui" line="84"/> <location filename="settingsdialog/projectfileswidget.ui" line="105"/>
<source>Compile files as C++</source> <source>Compile files as C++</source>
<translation>C++</translation> <translation>C++</translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/projectfileswidget.ui" line="91"/> <location filename="settingsdialog/projectfileswidget.ui" line="127"/>
<source>Encoding</source> <source>Encoding</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="settingsdialog/projectfileswidget.ui" line="107"/> <location filename="settingsdialog/projectfileswidget.ui" line="157"/>
<source>Override build command:</source> <source>Override build command:</source>
<translation></translation> <translation></translation>
</message> </message>
@ -4088,7 +4208,7 @@ Are you really want to continue?</source>
<context> <context>
<name>QApplication</name> <name>QApplication</name>
<message> <message>
<location filename="main.cpp" line="106"/> <location filename="main.cpp" line="108"/>
<source>Error</source> <source>Error</source>
<translation></translation> <translation></translation>
</message> </message>
@ -4142,23 +4262,23 @@ Are you really want to continue?</source>
</message> </message>
<message> <message>
<location filename="colorscheme.cpp" line="533"/> <location filename="colorscheme.cpp" line="533"/>
<location filename="main.cpp" line="36"/> <location filename="main.cpp" line="37"/>
<location filename="main.cpp" line="43"/> <location filename="main.cpp" line="44"/>
<source>Error</source> <source>Error</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="main.cpp" line="37"/> <location filename="main.cpp" line="38"/>
<source>Can&apos;t create configuration folder %1</source> <source>Can&apos;t create configuration folder %1</source>
<translation>&quot;%1&quot;</translation> <translation>&quot;%1&quot;</translation>
</message> </message>
<message> <message>
<location filename="main.cpp" line="44"/> <location filename="main.cpp" line="45"/>
<source>Can&apos;t write to configuration file %1</source> <source>Can&apos;t write to configuration file %1</source>
<translation>&quot;%1&quot;</translation> <translation>&quot;%1&quot;</translation>
</message> </message>
<message> <message>
<location filename="main.cpp" line="91"/> <location filename="main.cpp" line="93"/>
<source>Can&apos;t load autolink settings</source> <source>Can&apos;t load autolink settings</source>
<translation></translation> <translation></translation>
</message> </message>

View File

@ -1390,10 +1390,11 @@ void DebugReader::runNextCmd()
mCurrentCmd.reset(); mCurrentCmd.reset();
} }
emit cmdStarted();
PDebugCommand pCmd = mCmdQueue.dequeue(); PDebugCommand pCmd = mCmdQueue.dequeue();
mCmdRunning = true; mCmdRunning = true;
mCurrentCmd = pCmd; mCurrentCmd = pCmd;
if (mCurrentCmd->updateWatch)
emit cmdStarted();
QByteArray s; QByteArray s;
s=pCmd->command.toLocal8Bit(); s=pCmd->command.toLocal8Bit();

View File

@ -12,6 +12,7 @@
#include "project.h" #include "project.h"
#include "projecttemplate.h" #include "projecttemplate.h"
#include "widgets/newprojectdialog.h" #include "widgets/newprojectdialog.h"
#include "platform.h"
#include <QCloseEvent> #include <QCloseEvent>
#include <QComboBox> #include <QComboBox>
@ -94,19 +95,8 @@ MainWindow::MainWindow(QWidget *parent)
mMenuNew->addAction(ui->actionNew); mMenuNew->addAction(ui->actionNew);
mMenuNew->addAction(ui->actionNew_Project); mMenuNew->addAction(ui->actionNew_Project);
ui->menuFile->insertMenu(ui->actionOpen,mMenuNew); ui->menuFile->insertMenu(ui->actionOpen,mMenuNew);
mMenuEncoding = new QMenu();
mMenuEncoding->setTitle(tr("File Encoding")); buildEncodingMenu();
mMenuEncoding->addAction(ui->actionAuto_Detect);
mMenuEncoding->addAction(ui->actionEncode_in_ANSI);
mMenuEncoding->addAction(ui->actionEncode_in_UTF_8);
mMenuEncoding->addSeparator();
mMenuEncoding->addAction(ui->actionConvert_to_ANSI);
mMenuEncoding->addAction(ui->actionConvert_to_UTF_8);
ui->menuEdit->insertMenu(ui->actionFoldAll,mMenuEncoding);
ui->menuEdit->insertSeparator(ui->actionFoldAll);
ui->actionAuto_Detect->setCheckable(true);
ui->actionEncode_in_ANSI->setCheckable(true);
ui->actionEncode_in_UTF_8->setCheckable(true);
mMenuRecentProjects = new QMenu(); mMenuRecentProjects = new QMenu();
mMenuRecentProjects->setTitle(tr("Recent Projects")); mMenuRecentProjects->setTitle(tr("Recent Projects"));
@ -181,10 +171,17 @@ MainWindow::~MainWindow()
void MainWindow::updateForEncodingInfo() { void MainWindow::updateForEncodingInfo() {
Editor * editor = mEditorList->getEditor(); Editor * editor = mEditorList->getEditor();
if (editor!=NULL) { if (editor!=NULL) {
mFileEncodingStatus->setText( if (editor->encodingOption() != editor->fileEncoding()) {
QString("%1(%2)") mFileEncodingStatus->setText(
.arg(QString(editor->encodingOption()) QString("%1(%2)")
,QString(editor->fileEncoding()))); .arg(QString(editor->encodingOption())
,QString(editor->fileEncoding())));
} else {
mFileEncodingStatus->setText(
QString("%1")
.arg(QString(editor->encodingOption()))
);
}
ui->actionAuto_Detect->setChecked(editor->encodingOption() == ENCODING_AUTO_DETECT); ui->actionAuto_Detect->setChecked(editor->encodingOption() == ENCODING_AUTO_DETECT);
ui->actionEncode_in_ANSI->setChecked(editor->encodingOption() == ENCODING_SYSTEM_DEFAULT); ui->actionEncode_in_ANSI->setChecked(editor->encodingOption() == ENCODING_SYSTEM_DEFAULT);
ui->actionEncode_in_UTF_8->setChecked(editor->encodingOption() == ENCODING_UTF8); ui->actionEncode_in_UTF_8->setChecked(editor->encodingOption() == ENCODING_UTF8);
@ -312,12 +309,9 @@ void MainWindow::updateCompileActions()
ui->actionDebug->setEnabled(true); ui->actionDebug->setEnabled(true);
} }
if (!mDebugger->executing()) {
ui->actionStep_Into->setEnabled(mDebugger->executing()); disableDebugActions();
ui->actionStep_Out->setEnabled(mDebugger->executing()); }
ui->actionStep_Over->setEnabled(mDebugger->executing());
ui->actionContinue->setEnabled(mDebugger->executing());
ui->actionRun_To_Cursor->setEnabled(mDebugger->executing());
ui->actionStop_Execution->setEnabled(mCompilerManager->running() || mDebugger->executing()); ui->actionStop_Execution->setEnabled(mCompilerManager->running() || mDebugger->executing());
//it's not a compile action, but put here for convinience //it's not a compile action, but put here for convinience
@ -362,10 +356,6 @@ void MainWindow::updateEditorColorSchemes()
if (item) { if (item) {
mStatementColors->insert(StatementKind::skGlobalVariable,item->foreground()); mStatementColors->insert(StatementKind::skGlobalVariable,item->foreground());
} }
item = pColorManager->getItem(schemeName, SYNS_AttrGlobalVariable);
if (item) {
mStatementColors->insert(StatementKind::skGlobalVariable,item->foreground());
}
item = pColorManager->getItem(schemeName, SYNS_AttrPreprocessor); item = pColorManager->getItem(schemeName, SYNS_AttrPreprocessor);
if (item) { if (item) {
mStatementColors->insert(StatementKind::skPreprocessor,item->foreground()); mStatementColors->insert(StatementKind::skPreprocessor,item->foreground());
@ -1818,6 +1808,60 @@ void MainWindow::buildContextMenus()
hlayout->addStretch(); hlayout->addStretch();
} }
void MainWindow::buildEncodingMenu()
{
QMenu* menuCharsets = new QMenu();
menuCharsets->setTitle(tr("Character sets"));
QStringList languages = pCharsetInfoManager->languageNames();
foreach (const QString& langName, languages) {
QMenu* menuLang = new QMenu();
menuLang->setTitle(langName);
menuCharsets->addMenu(menuLang);
QList<PCharsetInfo> charInfos = pCharsetInfoManager->findCharsetsByLanguageName(langName);
connect(menuLang,&QMenu::aboutToShow,
[langName,menuLang,this]() {
menuLang->clear();
Editor* editor = mEditorList->getEditor();
QList<PCharsetInfo> charInfos = pCharsetInfoManager->findCharsetsByLanguageName(langName);
foreach (const PCharsetInfo& info, charInfos) {
QAction * action = new QAction(info->name);
action->setCheckable(true);
if (editor)
action->setChecked(info->name == editor->encodingOption());
connect(action, &QAction::triggered,
[info,this](){
Editor * editor = mEditorList->getEditor();
if (editor == nullptr)
return;
try {
editor->setEncodingOption(info->name);
} catch(FileError e) {
QMessageBox::critical(this,tr("Error"),e.reason());
}
});
menuLang->addAction(action);
}
});
}
mMenuEncoding = new QMenu();
mMenuEncoding->setTitle(tr("File Encoding"));
mMenuEncoding->addAction(ui->actionAuto_Detect);
mMenuEncoding->addAction(ui->actionEncode_in_ANSI);
mMenuEncoding->addAction(ui->actionEncode_in_UTF_8);
mMenuEncoding->addMenu(menuCharsets);
mMenuEncoding->addSeparator();
mMenuEncoding->addAction(ui->actionConvert_to_ANSI);
mMenuEncoding->addAction(ui->actionConvert_to_UTF_8);
ui->menuEdit->insertMenu(ui->actionFoldAll,mMenuEncoding);
ui->menuEdit->insertSeparator(ui->actionFoldAll);
ui->actionAuto_Detect->setCheckable(true);
ui->actionEncode_in_ANSI->setCheckable(true);
ui->actionEncode_in_UTF_8->setCheckable(true);
}
void MainWindow::maximizeEditor() void MainWindow::maximizeEditor()
{ {
if (mLeftPanelOpenned || mBottomPanelOpenned) { if (mLeftPanelOpenned || mBottomPanelOpenned) {
@ -2074,6 +2118,7 @@ void MainWindow::onEditorTabContextMenu(const QPoint &pos)
void MainWindow::disableDebugActions() void MainWindow::disableDebugActions()
{ {
qDebug()<<"disabled";
ui->actionStep_Into->setEnabled(false); ui->actionStep_Into->setEnabled(false);
ui->actionStep_Over->setEnabled(false); ui->actionStep_Over->setEnabled(false);
ui->actionStep_Out->setEnabled(false); ui->actionStep_Out->setEnabled(false);
@ -2084,6 +2129,7 @@ void MainWindow::disableDebugActions()
void MainWindow::enableDebugActions() void MainWindow::enableDebugActions()
{ {
qDebug()<<"enabled";
ui->actionStep_Into->setEnabled(true); ui->actionStep_Into->setEnabled(true);
ui->actionStep_Over->setEnabled(true); ui->actionStep_Over->setEnabled(true);
ui->actionStep_Out->setEnabled(true); ui->actionStep_Out->setEnabled(true);

View File

@ -149,6 +149,7 @@ private:
void prepareDebugger(); void prepareDebugger();
void doAutoSave(Editor *e); void doAutoSave(Editor *e);
void buildContextMenus(); void buildContextMenus();
void buildEncodingMenu();
void maximizeEditor(); void maximizeEditor();
void openShell(const QString& folder, const QString& shellCommand); void openShell(const QString& folder, const QString& shellCommand);
QAction* createActionFor(const QString& text, QAction* createActionFor(const QString& text,

View File

@ -3107,12 +3107,12 @@ void CppParser::internalParse(const QString &fileName)
break; break;
} }
#ifdef QT_DEBUG #ifdef QT_DEBUG
StringsToFile(mPreprocessor.result(),"f:\\preprocess.txt"); // StringsToFile(mPreprocessor.result(),"f:\\preprocess.txt");
mPreprocessor.dumpDefinesTo("f:\\defines.txt"); // mPreprocessor.dumpDefinesTo("f:\\defines.txt");
mPreprocessor.dumpIncludesListTo("f:\\includes.txt"); // mPreprocessor.dumpIncludesListTo("f:\\includes.txt");
mStatementList.dump("f:\\stats.txt"); // mStatementList.dump("f:\\stats.txt");
mTokenizer.dumpTokens("f:\\tokens.txt"); // mTokenizer.dumpTokens("f:\\tokens.txt");
mStatementList.dumpAll("f:\\all-stats.txt"); // mStatementList.dumpAll("f:\\all-stats.txt");
#endif #endif
} }
} }

View File

@ -295,6 +295,7 @@ QString CppTokenizer::getWord(bool bSkipParenthesis, bool bSkipArray, bool bSkip
} else if (bSkipArray && (*mCurrent == '[')) { } else if (bSkipArray && (*mCurrent == '[')) {
// Append array stuff // Append array stuff
while(true) { while(true) {
offset = mCurrent;
skipPair('[', ']'); skipPair('[', ']');
result += QString(offset,mCurrent-offset); result += QString(offset,mCurrent-offset);
simplifyArgs(result); simplifyArgs(result);

View File

@ -4,6 +4,7 @@
#include <QMap> #include <QMap>
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#include <QSet>
#include <windows.h> #include <windows.h>
#endif #endif
@ -31,161 +32,186 @@ PCharsetInfo CharsetInfoManager::findCharsetByCodepage(int codepage)
return PCharsetInfo(); return PCharsetInfo();
} }
QStringList CharsetInfoManager::languageNames()
{
QSet<QString> languages;
foreach (const PCharsetInfo& info, mCodePages) {
if (info->enabled)
languages.insert(info->language);
}
QStringList lst;
foreach (const QString& s, languages)
lst.append(s);
lst.sort(Qt::CaseInsensitive);
return lst;
}
QList<PCharsetInfo> CharsetInfoManager::findCharsetsByLanguageName(const QString &languageName)
{
QList<PCharsetInfo> result;
foreach (const PCharsetInfo& info, mCodePages) {
if (info->language == languageName
&& info->enabled)
result.append(info);
}
return result;
}
CharsetInfoManager::CharsetInfoManager():QObject() CharsetInfoManager::CharsetInfoManager():QObject()
{ {
mCodePages.insert(37,std::make_shared<CharsetInfo>(37,"IBM037","",false)); mCodePages.append(std::make_shared<CharsetInfo>(37,"IBM037","",false));
mCodePages.insert(437,std::make_shared<CharsetInfo>(437,"IBM437","",false)); mCodePages.append(std::make_shared<CharsetInfo>(437,"IBM437","",false));
mCodePages.insert(500,std::make_shared<CharsetInfo>(500,"IBM500","",false)); mCodePages.append(std::make_shared<CharsetInfo>(500,"IBM500","",false));
mCodePages.insert(708,std::make_shared<CharsetInfo>(708,"ASMO-708","",false)); mCodePages.append(std::make_shared<CharsetInfo>(708,"ASMO-708","",false));
mCodePages.insert(709,std::make_shared<CharsetInfo>(709,"","",false)); mCodePages.append(std::make_shared<CharsetInfo>(709,"","",false));
mCodePages.insert(710,std::make_shared<CharsetInfo>(710,"","",false)); mCodePages.append(std::make_shared<CharsetInfo>(710,"","",false));
mCodePages.insert(720,std::make_shared<CharsetInfo>(720,"DOS-720",tr("Arabic"),false)); mCodePages.append(std::make_shared<CharsetInfo>(720,"DOS-720",tr("Arabic"),false));
mCodePages.insert(737,std::make_shared<CharsetInfo>(737,"ibm737",tr("Greek"),false)); mCodePages.append(std::make_shared<CharsetInfo>(737,"ibm737",tr("Greek"),false));
mCodePages.insert(775,std::make_shared<CharsetInfo>(775,"ibm775",tr("Baltic"),false)); mCodePages.append(std::make_shared<CharsetInfo>(775,"ibm775",tr("Baltic"),false));
mCodePages.insert(850,std::make_shared<CharsetInfo>(850,"ibm850",tr("Western Europe"),false)); mCodePages.append(std::make_shared<CharsetInfo>(850,"ibm850",tr("Western Europe"),false));
mCodePages.insert(852,std::make_shared<CharsetInfo>(852,"ibm852",tr("Central Europe"),false)); mCodePages.append(std::make_shared<CharsetInfo>(852,"ibm852",tr("Central Europe"),false));
mCodePages.insert(855,std::make_shared<CharsetInfo>(855,"IBM855",tr("Cyrillic"),false)); mCodePages.append(std::make_shared<CharsetInfo>(855,"IBM855",tr("Cyrillic"),false));
mCodePages.insert(857,std::make_shared<CharsetInfo>(857,"ibm857",tr("Turkish"),false)); mCodePages.append(std::make_shared<CharsetInfo>(857,"ibm857",tr("Turkish"),false));
mCodePages.insert(858,std::make_shared<CharsetInfo>(858,"ibm858",tr("Western Europe"),false)); mCodePages.append(std::make_shared<CharsetInfo>(858,"ibm858",tr("Western Europe"),false));
mCodePages.insert(860,std::make_shared<CharsetInfo>(860,"IBM860",tr("Western Europe"),false)); mCodePages.append(std::make_shared<CharsetInfo>(860,"IBM860",tr("Western Europe"),false));
mCodePages.insert(861,std::make_shared<CharsetInfo>(861,"ibm861",tr("Northern Europe"),false)); mCodePages.append(std::make_shared<CharsetInfo>(861,"ibm861",tr("Northern Europe"),false));
mCodePages.insert(862,std::make_shared<CharsetInfo>(862,"DOS-862",tr("Hebrew"),false)); mCodePages.append(std::make_shared<CharsetInfo>(862,"DOS-862",tr("Hebrew"),false));
mCodePages.insert(863,std::make_shared<CharsetInfo>(863,"IBM863",tr("Western Europe"),false)); mCodePages.append(std::make_shared<CharsetInfo>(863,"IBM863",tr("Western Europe"),false));
mCodePages.insert(864,std::make_shared<CharsetInfo>(864,"IBM864","",false)); mCodePages.append(std::make_shared<CharsetInfo>(864,"IBM864","",false));
mCodePages.insert(865,std::make_shared<CharsetInfo>(865,"IBM865",tr("Northern Europe"),false)); mCodePages.append(std::make_shared<CharsetInfo>(865,"IBM865",tr("Northern Europe"),false));
mCodePages.insert(866,std::make_shared<CharsetInfo>(866,"cp866",tr("Cyrillic"),false)); mCodePages.append(std::make_shared<CharsetInfo>(866,"cp866",tr("Cyrillic"),false));
mCodePages.insert(869,std::make_shared<CharsetInfo>(869,"ibm869",tr("Greek"),false)); mCodePages.append(std::make_shared<CharsetInfo>(869,"ibm869",tr("Greek"),false));
mCodePages.insert(870,std::make_shared<CharsetInfo>(870,"IBM870","",false)); mCodePages.append(std::make_shared<CharsetInfo>(870,"IBM870","",false));
mCodePages.insert(874,std::make_shared<CharsetInfo>(874,"tis-620",tr("Thai"),true)); mCodePages.append(std::make_shared<CharsetInfo>(874,"tis-620",tr("Thai"),true));
mCodePages.insert(875,std::make_shared<CharsetInfo>(875,"cp875","",false)); mCodePages.append(std::make_shared<CharsetInfo>(875,"cp875","",false));
mCodePages.insert(932,std::make_shared<CharsetInfo>(932,"shift_jis",tr("Japanese"),true)); mCodePages.append(std::make_shared<CharsetInfo>(932,"shift_jis",tr("Japanese"),true));
mCodePages.insert(936,std::make_shared<CharsetInfo>(936,"gbk",tr("Chinese"),true)); mCodePages.append(std::make_shared<CharsetInfo>(936,"gbk",tr("Chinese"),true));
mCodePages.insert(949,std::make_shared<CharsetInfo>(949,"windows-949",tr("Korean"),true)); mCodePages.append(std::make_shared<CharsetInfo>(949,"windows-949",tr("Korean"),true));
mCodePages.insert(950,std::make_shared<CharsetInfo>(950,"big5",tr("Chinese"),true)); mCodePages.append(std::make_shared<CharsetInfo>(950,"big5",tr("Chinese"),true));
mCodePages.insert(1026,std::make_shared<CharsetInfo>(1026,"IBM1026","",false)); mCodePages.append(std::make_shared<CharsetInfo>(1026,"IBM1026","",false));
mCodePages.insert(1047,std::make_shared<CharsetInfo>(1047,"IBM01047","",false)); mCodePages.append(std::make_shared<CharsetInfo>(1047,"IBM01047","",false));
mCodePages.insert(1140,std::make_shared<CharsetInfo>(1140,"IBM01140","",false)); mCodePages.append(std::make_shared<CharsetInfo>(1140,"IBM01140","",false));
mCodePages.insert(1141,std::make_shared<CharsetInfo>(1141,"IBM01141","",false)); mCodePages.append(std::make_shared<CharsetInfo>(1141,"IBM01141","",false));
mCodePages.insert(1142,std::make_shared<CharsetInfo>(1142,"IBM01142","",false)); mCodePages.append(std::make_shared<CharsetInfo>(1142,"IBM01142","",false));
mCodePages.insert(1143,std::make_shared<CharsetInfo>(1143,"IBM01143","",false)); mCodePages.append(std::make_shared<CharsetInfo>(1143,"IBM01143","",false));
mCodePages.insert(1144,std::make_shared<CharsetInfo>(1144,"IBM01144","",false)); mCodePages.append(std::make_shared<CharsetInfo>(1144,"IBM01144","",false));
mCodePages.insert(1145,std::make_shared<CharsetInfo>(1145,"IBM01145","",false)); mCodePages.append(std::make_shared<CharsetInfo>(1145,"IBM01145","",false));
mCodePages.insert(1146,std::make_shared<CharsetInfo>(1146,"IBM01146","",false)); mCodePages.append(std::make_shared<CharsetInfo>(1146,"IBM01146","",false));
mCodePages.insert(1147,std::make_shared<CharsetInfo>(1147,"IBM01147","",false)); mCodePages.append(std::make_shared<CharsetInfo>(1147,"IBM01147","",false));
mCodePages.insert(1148,std::make_shared<CharsetInfo>(1148,"IBM01148","",false)); mCodePages.append(std::make_shared<CharsetInfo>(1148,"IBM01148","",false));
mCodePages.insert(1149,std::make_shared<CharsetInfo>(1149,"IBM01149","",false)); mCodePages.append(std::make_shared<CharsetInfo>(1149,"IBM01149","",false));
mCodePages.insert(1200,std::make_shared<CharsetInfo>(1200,"utf-16","",false)); mCodePages.append(std::make_shared<CharsetInfo>(1200,"utf-16","",false));
mCodePages.insert(1201,std::make_shared<CharsetInfo>(1201,"unicodeFFFE","",false)); mCodePages.append(std::make_shared<CharsetInfo>(1201,"unicodeFFFE","",false));
mCodePages.insert(1250,std::make_shared<CharsetInfo>(1250,"windows-1250",tr("Central Europe"),true)); mCodePages.append(std::make_shared<CharsetInfo>(1250,"windows-1250",tr("Central Europe"),true));
mCodePages.insert(1251,std::make_shared<CharsetInfo>(1251,"windows-1251",tr("Cyrillic"),true)); mCodePages.append(std::make_shared<CharsetInfo>(1251,"windows-1251",tr("Cyrillic"),true));
mCodePages.insert(1252,std::make_shared<CharsetInfo>(1252,"windows-1252",tr("Western Europe"),true)); mCodePages.append(std::make_shared<CharsetInfo>(1252,"windows-1252",tr("Western Europe"),true));
mCodePages.insert(1253,std::make_shared<CharsetInfo>(1253,"windows-1253",tr("Greek"),true)); mCodePages.append(std::make_shared<CharsetInfo>(1253,"windows-1253",tr("Greek"),true));
mCodePages.insert(1254,std::make_shared<CharsetInfo>(1254,"windows-1254",tr("Turkish"),true)); mCodePages.append(std::make_shared<CharsetInfo>(1254,"windows-1254",tr("Turkish"),true));
mCodePages.insert(1255,std::make_shared<CharsetInfo>(1255,"windows-1255",tr("Hebrew"),true)); mCodePages.append(std::make_shared<CharsetInfo>(1255,"windows-1255",tr("Hebrew"),true));
mCodePages.insert(1256,std::make_shared<CharsetInfo>(1256,"windows-1256",tr("Arabic"),true)); mCodePages.append(std::make_shared<CharsetInfo>(1256,"windows-1256",tr("Arabic"),true));
mCodePages.insert(1257,std::make_shared<CharsetInfo>(1257,"windows-1257",tr("Baltic"),true)); mCodePages.append(std::make_shared<CharsetInfo>(1257,"windows-1257",tr("Baltic"),true));
mCodePages.insert(1258,std::make_shared<CharsetInfo>(1258,"windows-1258",tr("Vietnamese"),true)); mCodePages.append(std::make_shared<CharsetInfo>(1258,"windows-1258",tr("Vietnamese"),true));
mCodePages.insert(1361,std::make_shared<CharsetInfo>(1361,"Johab","",false)); mCodePages.append(std::make_shared<CharsetInfo>(1361,"Johab","",false));
mCodePages.insert(10000,std::make_shared<CharsetInfo>(10000,"macintosh",tr("Cyrillic"),true)); mCodePages.append(std::make_shared<CharsetInfo>(10000,"macintosh",tr("Cyrillic"),true));
mCodePages.insert(10001,std::make_shared<CharsetInfo>(10001,"x-mac-japanese","",false)); mCodePages.append(std::make_shared<CharsetInfo>(10001,"x-mac-japanese","",false));
mCodePages.insert(10002,std::make_shared<CharsetInfo>(10002,"x-mac-chinesetrad","",false)); mCodePages.append(std::make_shared<CharsetInfo>(10002,"x-mac-chinesetrad","",false));
mCodePages.insert(10003,std::make_shared<CharsetInfo>(10003,"x-mac-korean","",false)); mCodePages.append(std::make_shared<CharsetInfo>(10003,"x-mac-korean","",false));
mCodePages.insert(10004,std::make_shared<CharsetInfo>(10004,"x-mac-arabic","",false)); mCodePages.append(std::make_shared<CharsetInfo>(10004,"x-mac-arabic","",false));
mCodePages.insert(10005,std::make_shared<CharsetInfo>(10005,"x-mac-hebrew","",false)); mCodePages.append(std::make_shared<CharsetInfo>(10005,"x-mac-hebrew","",false));
mCodePages.insert(10006,std::make_shared<CharsetInfo>(10006,"x-mac-greek","",false)); mCodePages.append(std::make_shared<CharsetInfo>(10006,"x-mac-greek","",false));
mCodePages.insert(10007,std::make_shared<CharsetInfo>(10007,"x-mac-cyrillic","",false)); mCodePages.append(std::make_shared<CharsetInfo>(10007,"x-mac-cyrillic","",false));
mCodePages.insert(10008,std::make_shared<CharsetInfo>(10008,"x-mac-chinesesimp","",false)); mCodePages.append(std::make_shared<CharsetInfo>(10008,"x-mac-chinesesimp","",false));
mCodePages.insert(10010,std::make_shared<CharsetInfo>(10010,"x-mac-romanian","",false)); mCodePages.append(std::make_shared<CharsetInfo>(10010,"x-mac-romanian","",false));
mCodePages.insert(10017,std::make_shared<CharsetInfo>(10017,"x-mac-ukrainian","",false)); mCodePages.append(std::make_shared<CharsetInfo>(10017,"x-mac-ukrainian","",false));
mCodePages.insert(10021,std::make_shared<CharsetInfo>(10021,"x-mac-thai","",false)); mCodePages.append(std::make_shared<CharsetInfo>(10021,"x-mac-thai","",false));
mCodePages.insert(10029,std::make_shared<CharsetInfo>(10029,"x-mac-ce","",false)); mCodePages.append(std::make_shared<CharsetInfo>(10029,"x-mac-ce","",false));
mCodePages.insert(10079,std::make_shared<CharsetInfo>(10079,"x-mac-icelandic","",false)); mCodePages.append(std::make_shared<CharsetInfo>(10079,"x-mac-icelandic","",false));
mCodePages.insert(10081,std::make_shared<CharsetInfo>(10081,"x-mac-turkish","",false)); mCodePages.append(std::make_shared<CharsetInfo>(10081,"x-mac-turkish","",false));
mCodePages.insert(10082,std::make_shared<CharsetInfo>(10082,"x-mac-croatian","",false)); mCodePages.append(std::make_shared<CharsetInfo>(10082,"x-mac-croatian","",false));
mCodePages.insert(12000,std::make_shared<CharsetInfo>(12000,"utf-32","",false)); mCodePages.append(std::make_shared<CharsetInfo>(12000,"utf-32","",false));
mCodePages.insert(12001,std::make_shared<CharsetInfo>(12001,"utf-32BE","",false)); mCodePages.append(std::make_shared<CharsetInfo>(12001,"utf-32BE","",false));
mCodePages.insert(20000,std::make_shared<CharsetInfo>(20000,"x-Chinese_CNS","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20000,"x-Chinese_CNS","",false));
mCodePages.insert(20001,std::make_shared<CharsetInfo>(20001,"x-cp20001","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20001,"x-cp20001","",false));
mCodePages.insert(20002,std::make_shared<CharsetInfo>(20002,"x_Chinese-Eten","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20002,"x_Chinese-Eten","",false));
mCodePages.insert(20003,std::make_shared<CharsetInfo>(20003,"x-cp20003","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20003,"x-cp20003","",false));
mCodePages.insert(20004,std::make_shared<CharsetInfo>(20004,"x-cp20004","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20004,"x-cp20004","",false));
mCodePages.insert(20005,std::make_shared<CharsetInfo>(20005,"x-cp20005","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20005,"x-cp20005","",false));
mCodePages.insert(20105,std::make_shared<CharsetInfo>(20105,"x-IA5","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20105,"x-IA5","",false));
mCodePages.insert(20106,std::make_shared<CharsetInfo>(20106,"x-IA5-German","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20106,"x-IA5-German","",false));
mCodePages.insert(20107,std::make_shared<CharsetInfo>(20107,"x-IA5-Swedish","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20107,"x-IA5-Swedish","",false));
mCodePages.insert(20108,std::make_shared<CharsetInfo>(20108,"x-IA5-Norwegian","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20108,"x-IA5-Norwegian","",false));
mCodePages.insert(20127,std::make_shared<CharsetInfo>(20127,"us-ascii","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20127,"us-ascii","",false));
mCodePages.insert(20261,std::make_shared<CharsetInfo>(20261,"x-cp20261","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20261,"x-cp20261","",false));
mCodePages.insert(20269,std::make_shared<CharsetInfo>(20269,"x-cp20269","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20269,"x-cp20269","",false));
mCodePages.insert(20273,std::make_shared<CharsetInfo>(20273,"IBM273","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20273,"IBM273","",false));
mCodePages.insert(20277,std::make_shared<CharsetInfo>(20277,"IBM277","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20277,"IBM277","",false));
mCodePages.insert(20278,std::make_shared<CharsetInfo>(20278,"IBM278","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20278,"IBM278","",false));
mCodePages.insert(20280,std::make_shared<CharsetInfo>(20280,"IBM280","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20280,"IBM280","",false));
mCodePages.insert(20284,std::make_shared<CharsetInfo>(20284,"IBM284","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20284,"IBM284","",false));
mCodePages.insert(20285,std::make_shared<CharsetInfo>(20285,"IBM285","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20285,"IBM285","",false));
mCodePages.insert(20290,std::make_shared<CharsetInfo>(20290,"IBM290","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20290,"IBM290","",false));
mCodePages.insert(20297,std::make_shared<CharsetInfo>(20297,"IBM297","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20297,"IBM297","",false));
mCodePages.insert(20420,std::make_shared<CharsetInfo>(20420,"IBM420","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20420,"IBM420","",false));
mCodePages.insert(20423,std::make_shared<CharsetInfo>(20423,"IBM423","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20423,"IBM423","",false));
mCodePages.insert(20424,std::make_shared<CharsetInfo>(20424,"IBM424","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20424,"IBM424","",false));
mCodePages.insert(20833,std::make_shared<CharsetInfo>(20833,"x-EBCDIC-KoreanExtended","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20833,"x-EBCDIC-KoreanExtended","",false));
mCodePages.insert(20838,std::make_shared<CharsetInfo>(20838,"IBM-Thai","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20838,"IBM-Thai","",false));
mCodePages.insert(20866,std::make_shared<CharsetInfo>(20866,"koi8-r",tr("Cyrillic"),true)); mCodePages.append(std::make_shared<CharsetInfo>(20866,"koi8-r",tr("Cyrillic"),true));
mCodePages.insert(20871,std::make_shared<CharsetInfo>(20871,"IBM871","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20871,"IBM871","",false));
mCodePages.insert(20880,std::make_shared<CharsetInfo>(20880,"IBM880","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20880,"IBM880","",false));
mCodePages.insert(20905,std::make_shared<CharsetInfo>(20905,"IBM905","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20905,"IBM905","",false));
mCodePages.insert(20924,std::make_shared<CharsetInfo>(20924,"IBM00924","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20924,"IBM00924","",false));
mCodePages.insert(20932,std::make_shared<CharsetInfo>(20932,"EUC-JP","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20932,"EUC-JP","",false));
mCodePages.insert(20936,std::make_shared<CharsetInfo>(20936,"x-cp20936","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20936,"x-cp20936","",false));
mCodePages.insert(20949,std::make_shared<CharsetInfo>(20949,"x-cp20949","",false)); mCodePages.append(std::make_shared<CharsetInfo>(20949,"x-cp20949","",false));
mCodePages.insert(21025,std::make_shared<CharsetInfo>(21025,"cp1025","",false)); mCodePages.append(std::make_shared<CharsetInfo>(21025,"cp1025","",false));
mCodePages.insert(21027,std::make_shared<CharsetInfo>(21027,"","",false)); mCodePages.append(std::make_shared<CharsetInfo>(21027,"","",false));
mCodePages.insert(21866,std::make_shared<CharsetInfo>(21866,"koi8-u",tr("Cyrillic"),true)); mCodePages.append(std::make_shared<CharsetInfo>(21866,"koi8-u",tr("Cyrillic"),true));
mCodePages.insert(28591,std::make_shared<CharsetInfo>(28591,"iso-8859-1",tr("Western Europe"),true)); mCodePages.append(std::make_shared<CharsetInfo>(28591,"iso-8859-1",tr("Western Europe"),true));
mCodePages.insert(28592,std::make_shared<CharsetInfo>(28592,"iso-8859-2",tr("Eastern Europe"),true)); mCodePages.append(std::make_shared<CharsetInfo>(28592,"iso-8859-2",tr("Eastern Europe"),true));
mCodePages.insert(28593,std::make_shared<CharsetInfo>(28593,"iso-8859-3",tr("Turkish"),true)); mCodePages.append(std::make_shared<CharsetInfo>(28593,"iso-8859-3",tr("Turkish"),true));
mCodePages.insert(28594,std::make_shared<CharsetInfo>(28594,"iso-8859-4",tr("Baltic"),true)); mCodePages.append(std::make_shared<CharsetInfo>(28594,"iso-8859-4",tr("Baltic"),true));
mCodePages.insert(28595,std::make_shared<CharsetInfo>(28595,"iso-8859-5",tr("Cyrillic"),true)); mCodePages.append(std::make_shared<CharsetInfo>(28595,"iso-8859-5",tr("Cyrillic"),true));
mCodePages.insert(28596,std::make_shared<CharsetInfo>(28596,"iso-8859-6",tr("Arabic"),true)); mCodePages.append(std::make_shared<CharsetInfo>(28596,"iso-8859-6",tr("Arabic"),true));
mCodePages.insert(28597,std::make_shared<CharsetInfo>(28597,"iso-8859-7",tr("Greek"),true)); mCodePages.append(std::make_shared<CharsetInfo>(28597,"iso-8859-7",tr("Greek"),true));
mCodePages.insert(28598,std::make_shared<CharsetInfo>(28598,"iso-8859-8",tr("Hebrew"),true)); mCodePages.append(std::make_shared<CharsetInfo>(28598,"iso-8859-8",tr("Hebrew"),true));
mCodePages.insert(28599,std::make_shared<CharsetInfo>(28599,"iso-8859-9",tr("Turkish"),true)); mCodePages.append(std::make_shared<CharsetInfo>(28599,"iso-8859-9",tr("Turkish"),true));
mCodePages.insert(28603,std::make_shared<CharsetInfo>(28603,"iso-8859-13",tr("Baltic"),true)); mCodePages.append(std::make_shared<CharsetInfo>(28603,"iso-8859-13",tr("Baltic"),true));
mCodePages.insert(-1,std::make_shared<CharsetInfo>(28605,"iso-8859-14",tr("Celtic"),true)); mCodePages.append(std::make_shared<CharsetInfo>(-1,"iso-8859-14",tr("Celtic"),true));
mCodePages.insert(28605,std::make_shared<CharsetInfo>(28605,"iso-8859-15",tr("Western Europe"),true)); mCodePages.append(std::make_shared<CharsetInfo>(28605,"iso-8859-15",tr("Western Europe"),true));
mCodePages.insert(29001,std::make_shared<CharsetInfo>(29001,"x-Europa","",false)); mCodePages.append(std::make_shared<CharsetInfo>(29001,"x-Europa","",false));
mCodePages.insert(38598,std::make_shared<CharsetInfo>(38598,"iso-8859-8-i","",false)); mCodePages.append(std::make_shared<CharsetInfo>(38598,"iso-8859-8-i","",false));
mCodePages.insert(50220,std::make_shared<CharsetInfo>(50220,"iso-2022-jp","",false)); mCodePages.append(std::make_shared<CharsetInfo>(50220,"iso-2022-jp","",false));
mCodePages.insert(50221,std::make_shared<CharsetInfo>(50221,"csISO2022JP","",false)); mCodePages.append(std::make_shared<CharsetInfo>(50221,"csISO2022JP","",false));
mCodePages.insert(50222,std::make_shared<CharsetInfo>(50222,"iso-2022-jp","",false)); mCodePages.append(std::make_shared<CharsetInfo>(50222,"iso-2022-jp","",false));
mCodePages.insert(50225,std::make_shared<CharsetInfo>(50225,"iso-2022-kr","",false)); mCodePages.append(std::make_shared<CharsetInfo>(50225,"iso-2022-kr","",false));
mCodePages.insert(50227,std::make_shared<CharsetInfo>(50227,"x-cp50227","",false)); mCodePages.append(std::make_shared<CharsetInfo>(50227,"x-cp50227","",false));
mCodePages.insert(50229,std::make_shared<CharsetInfo>(50229,"","",false)); mCodePages.append(std::make_shared<CharsetInfo>(50229,"","",false));
mCodePages.insert(50930,std::make_shared<CharsetInfo>(50930,"","",false)); mCodePages.append(std::make_shared<CharsetInfo>(50930,"","",false));
mCodePages.insert(50931,std::make_shared<CharsetInfo>(50931,"","",false)); mCodePages.append(std::make_shared<CharsetInfo>(50931,"","",false));
mCodePages.insert(50933,std::make_shared<CharsetInfo>(50933,"","",false)); mCodePages.append(std::make_shared<CharsetInfo>(50933,"","",false));
mCodePages.insert(50935,std::make_shared<CharsetInfo>(50935,"","",false)); mCodePages.append(std::make_shared<CharsetInfo>(50935,"","",false));
mCodePages.insert(50936,std::make_shared<CharsetInfo>(50936,"","",false)); mCodePages.append(std::make_shared<CharsetInfo>(50936,"","",false));
mCodePages.insert(50937,std::make_shared<CharsetInfo>(50937,"","",false)); mCodePages.append(std::make_shared<CharsetInfo>(50937,"","",false));
mCodePages.insert(50939,std::make_shared<CharsetInfo>(50939,"","",false)); mCodePages.append(std::make_shared<CharsetInfo>(50939,"","",false));
mCodePages.insert(51932,std::make_shared<CharsetInfo>(51932,"euc-jp",tr("Japanese"),true)); mCodePages.append(std::make_shared<CharsetInfo>(51932,"euc-jp",tr("Japanese"),true));
mCodePages.insert(51936,std::make_shared<CharsetInfo>(51936,"euc-cn","",false)); mCodePages.append(std::make_shared<CharsetInfo>(51936,"euc-cn","",false));
mCodePages.insert(51949,std::make_shared<CharsetInfo>(51949,"euc-kr",tr("Korean"),true)); mCodePages.append(std::make_shared<CharsetInfo>(51949,"euc-kr",tr("Korean"),true));
mCodePages.insert(51950,std::make_shared<CharsetInfo>(51950,"","",false)); mCodePages.append(std::make_shared<CharsetInfo>(51950,"","",false));
mCodePages.insert(52936,std::make_shared<CharsetInfo>(52936,"hz-gb-2312","",false)); mCodePages.append(std::make_shared<CharsetInfo>(52936,"hz-gb-2312","",false));
mCodePages.insert(54936,std::make_shared<CharsetInfo>(54936,"gb18030",tr("Chinese"),true)); mCodePages.append(std::make_shared<CharsetInfo>(54936,"gb18030",tr("Chinese"),true));
mCodePages.insert(57002,std::make_shared<CharsetInfo>(57002,"x-iscii-de","",false)); mCodePages.append(std::make_shared<CharsetInfo>(57002,"x-iscii-de","",false));
mCodePages.insert(57003,std::make_shared<CharsetInfo>(57003,"x-iscii-be","",false)); mCodePages.append(std::make_shared<CharsetInfo>(57003,"x-iscii-be","",false));
mCodePages.insert(57004,std::make_shared<CharsetInfo>(57004,"x-iscii-ta","",false)); mCodePages.append(std::make_shared<CharsetInfo>(57004,"x-iscii-ta","",false));
mCodePages.insert(57005,std::make_shared<CharsetInfo>(57005,"x-iscii-te","",false)); mCodePages.append(std::make_shared<CharsetInfo>(57005,"x-iscii-te","",false));
mCodePages.insert(57006,std::make_shared<CharsetInfo>(57006,"x-iscii-as","",false)); mCodePages.append(std::make_shared<CharsetInfo>(57006,"x-iscii-as","",false));
mCodePages.insert(57007,std::make_shared<CharsetInfo>(57007,"x-iscii-or","",false)); mCodePages.append(std::make_shared<CharsetInfo>(57007,"x-iscii-or","",false));
mCodePages.insert(57008,std::make_shared<CharsetInfo>(57008,"x-iscii-ka","",false)); mCodePages.append(std::make_shared<CharsetInfo>(57008,"x-iscii-ka","",false));
mCodePages.insert(57009,std::make_shared<CharsetInfo>(57009,"x-iscii-ma","",false)); mCodePages.append(std::make_shared<CharsetInfo>(57009,"x-iscii-ma","",false));
mCodePages.insert(57010,std::make_shared<CharsetInfo>(57010,"x-iscii-gu","",false)); mCodePages.append(std::make_shared<CharsetInfo>(57010,"x-iscii-gu","",false));
mCodePages.insert(57011,std::make_shared<CharsetInfo>(57011,"x-iscii-pa","",false)); mCodePages.append(std::make_shared<CharsetInfo>(57011,"x-iscii-pa","",false));
mCodePages.insert(65000,std::make_shared<CharsetInfo>(65000,"utf-7","",false)); mCodePages.append(std::make_shared<CharsetInfo>(65000,"utf-7","",false));
mCodePages.insert(65001,std::make_shared<CharsetInfo>(65001,"utf-8","",false)); mCodePages.append(std::make_shared<CharsetInfo>(65001,"utf-8","",false));
} }

View File

@ -19,7 +19,7 @@ struct CharsetInfo{
using PCharsetInfo = std::shared_ptr<CharsetInfo>; using PCharsetInfo = std::shared_ptr<CharsetInfo>;
class CharsetInfoManager: public QObject { class CharsetInfoManager: public QObject {
Q_OBJECT; Q_OBJECT
public: public:
explicit CharsetInfoManager(); explicit CharsetInfoManager();
QByteArray getDefaultSystemEncoding(); QByteArray getDefaultSystemEncoding();
@ -27,7 +27,7 @@ public:
QStringList languageNames(); QStringList languageNames();
QList<PCharsetInfo> findCharsetsByLanguageName(const QString& languageName); QList<PCharsetInfo> findCharsetsByLanguageName(const QString& languageName);
private: private:
static QList<PCharsetInfo> mCodePages; QList<PCharsetInfo> mCodePages;
}; };
using PCharsetInfoManager = std::shared_ptr<CharsetInfo>; using PCharsetInfoManager = std::shared_ptr<CharsetInfo>;

View File

@ -546,7 +546,7 @@ void SynEditStringList::LoadFromFile(const QString& filename, const QByteArray&
} }
if (realEncoding == ENCODING_SYSTEM_DEFAULT) { if (realEncoding == ENCODING_SYSTEM_DEFAULT) {
realEncoding = getDefaultSystemEncoding(); realEncoding = pCharsetInfoManager->getDefaultSystemEncoding();
} }
file.reset(); file.reset();
QTextStream textStream(&file); QTextStream textStream(&file);
@ -603,8 +603,11 @@ void SynEditStringList::SaveToFile(QFile &file, const QByteArray& encoding, QByt
if (encoding == ENCODING_AUTO_DETECT) { if (encoding == ENCODING_AUTO_DETECT) {
if (allAscii) if (allAscii)
realEncoding = ENCODING_ASCII; realEncoding = ENCODING_ASCII;
else else if (codec->name() == "System") {
realEncoding = pCharsetInfoManager->getDefaultSystemEncoding();
} else {
realEncoding = codec->name(); realEncoding = codec->name();
}
} }
} }

View File

@ -183,9 +183,10 @@ QVariant ClassBrowserModel::data(const QModelIndex &index, int role) const
return QIcon(":/icons/images/classparser/method_private.ico"); return QIcon(":/icons/images/classparser/method_private.ico");
} }
} }
case StatementKind::skGlobalVariable:
return QIcon(":/icons/images/classparser/global.ico");
case StatementKind::skVariable: case StatementKind::skVariable:
if (statement->scope == StatementScope::ssGlobal) if (statement->scope == StatementScope::ssGlobal)
return QIcon(":/icons/images/classparser/global.ico");
if (statement->isInherited) { if (statement->isInherited) {
if (statement->classScope == StatementClassScope::scsProtected) { if (statement->classScope == StatementClassScope::scsProtected) {
return QIcon(":/icons/images/classparser/var_inherited_protected.ico"); return QIcon(":/icons/images/classparser/var_inherited_protected.ico");