Hi, Pecan, thanks for your hard work!
I debugged your patch yesterday. I think this patch is simple, but it still has some errors. Let me describe the issue again. I think in our code, we just "write" or "read" from the .conf file too much. I think every Parser instance's option is valid, so I don't think there is some "stale" option.
The problem is that we have several Parser instances. For example, we have ParserA, ParserB, ParserTemp. When there is no cbp opened, the ParserTemp always exists. I think when every Parser instance get constructed, it will "read" the options from the .conf file, that's OK.
+----------+
+------------------------|Parser A |
| +----------+
+-------|------+
|Parse option | +----------+
|Browser option|-----------------|Parser B |
+-------|------+ +----------+
|
| +-----------+
+------------------------|Parser Temp|
+-----------+
1, When the Parser object get constructed, all the option should be copied from the .conf file to the object.
2, When the user open a editor->CodeCompletion option dialog, and edit some options, and click the "OK" button (in the OnApply function), I think all the options will be saved.
3, When we switch the Parser object(for example, the active project is switched from A to B, or from A to Temp), when switching, we don't need to "read all the options from the .conf file", because different Parser maintain its own option.
4, When user tweak the ClassBrowser option, I think it should save to the .conf file immediately after changing the ClassBrowser option.
5, When a Parser get closed, I think we don't need to "save" its option to the .conf file", because those options were either saved in the above "2" and "4" steps.