1) How do I hide unused compilers from the dropdown list... (I find it massively annoying have to go through 20+ entries with only 2 compilers installed)
I am sorry that this is not a solution, but at least an explanation. Maybe helping someone to take another step forward on this.
The compilers are defined by several things
* hard coded classes. They are added in the file
source/plugins/compilerhcc/compilergcc.cpp
in the class
in the method
compilergcGCC::DoRegisterCompilers
. This adds the following hard coded classes to a CompoilerFactoryArray: MSVC/MSVC8/MSVC10/OW/CYGWIN/LCC/KeilC51/KeilCX51/IAR8051/IAR-ARM/ICC/GDC/GNUFortran/G95. Some are only added on Windows systems.
* global XML list.
* user XML list
All these are added to the compiler list used to display in the Settings/Compiler dialog and also in a dialog used to select the default compiler on program start. The global and user XML list are both part of the "default.conf", the users profile file which is a big XML list. In Windows in user/AppData/Roaming/CodeBlocks and in Linux .config/codeblocks.
Also The hardcoded compilers have named XML files in the program directory in the Compliler Plugin (as Zipfile in the Windows installations in the plugins folder). Thats the reason that deleting the XML sections in the default.conf files does not really help. It does help, to delete any user defined compiler data, because thats the only place where user defined compiler data is stored.
But the annoying part of the list are the predefined compilers and they are defined in the default.conf list, the hardcoded classes and the XML data in the plugin- Zip file.
So there are only two ways to get rid of the long list
a) remove the hardcoded items in the code and recompile the source.
b) remove (or move) the XML files in the compiler plugin. This will only shorten a few (XML generated) compilers from the list but it will pop up error messages for each hardcoded compiler. I think by only removing those not producing an error, the list can be shortened without error messages. By removing all except the used compiler XMLs in Windows I could bring the list down to a lengh that the scroll bar disappeared which would be a help already. But I am not sure if that its possible without error pop-ups, but it might - did not try.
Looking at the code, I can not really understand why those compilers were hardcoded. The code for reading compilers from XML is fully there and some compilers are read from XML lists already. To move the hardcoded class data (which is mostly empty anyway) to an own XML that is kept with the compiler plugin ZIP file would be much more flexible and easier. That might even be possible without a lot of redesign beside defining the file and moving the data.
In that case any advanced user can got into the plugin and delete compilers that surely will never ever by used from the list altogether.
However, there might be good arguments for this hardcoded apporach which I am not aware. Some of the regulars might be able to judge better.
Better of course would be a compiler management dialog to enable/disable/copy/duplicate/rename compilers but that obviously is quite a massive undertaking for little effect.
However, may this help anyone who is able to compile CodeBlocks to get some relief for item 1).