A little recap
Starting this analysis with the old code before the changes of today.
From the GUI where you can add the types you want and you can select a line type :
In a combo box : Type :
Info
Warning
Error
so I guess the SaveRegexDetail : rs.lt = (CompilerLineType)wxComboBox:GetSelection() would return for the above entries
0
1
2
Now when we look at the enum :
enum CompilerLineType
{
cltNormal
cltWarning,
cltError
};
We see that info line types were mapped to cltNormal (0), and warning to cltWarning (1), and the error to cltError (2).
So all is well.
However if we want to treat the info separate from normal in the code, we should expand the enum. And because the number value of the enum is in the default.conf file for the compilers, we should expand it at the end. Not insertion, because that will cause a shift and things will be misinterpreted.
So we get :
enum CompilerLineType
{
cltNormal
cltWarning,
cltError,
cltInfo,
};
Now we need to adjust also the gui part. There we have to make sure that an info line (type) ends up being a cltInfo.
However it used to map onto a cltNormal. So here we surely change things and some first side effects in certain configurations might become visible.
Question here is : do we also add Normal to the combo box (?), so 4 choices, reflecting the 4 values of the enum. And if we want to do it with a simple cast like the original code, we need something like this :
<content>
<item>Normal</item>
<item>Warning</item>
<item>Error</item>
<item>Info</item>
Let's do that for now. One might ask why add a regex if I want it to be just normal (normal things --> don't do anything specific in the code for those ...).
But on the other hand, we have a better match then.
Consequence : people already having "info entries" which were treated as "normal line types" will continue to see them in the GUI of the advanced settings as Normal and no longer as Info. So if you really want those to be treated as Info (whatever that means : see below) will have to change this through the gui.
So moving on to the next big question. How to deal with info's, now we conider them to be different from 'Normal'.
We have a and continue to have :
1) errors are shown in red and show up in the build messages
2) warnings are shown in blue and show up in the build messages
3) normal shown in black and don't show up in the build messages.
Now what is an info ?? For example in the Windriver compiler, an info is actually more of a warning. Maybe a less severe warning, but I have to say some of that compilers infos were pure warnings for other compilers, and that's the same opinion I had with those I cam across.
Todays changes had put the info in +- category 3) .
I feel they should be treated as warnings. Code should be error free, warning free, and info free ;-)
But let's keep the changes made today for mow. Feel free to tell your opinion bout this.
So we should change a ew more lines of code (compiler.gcc) :
- log to the build messages as long as the type isn't normal (AddOutputLine)
- but show it in the build messages in the system color for text (+- black) (like normal line type) (LogWarningOrError)
- in the log file (html) choose a correct colored font for it (LogMessage) ==> here the code was +- okin the past but certainly not correct, because a font tag was opened for error/warning or when forceErrorColour BUT it was only closed when it was not of type 'normal'. Obvious that when forceErrorColour was true and it was of type normal, that the tag would never be closed.
The line should have said, and should now, since info is treated colorwise as normal : close the font tag if 'error or warning or forcedErrorColour'.
So i will commit because of this story :
- xrc with the resynched entries
- compilergcc.cpp for that font tag closing