I'm not fully understand the patch, it looks like all the Parser instance will share the same "option".
If you set a breakpoint(BP) in the file: parser.cpp, in the function body: void Parser::WriteOptions()
Then do something like below:
1, start C::B, this will hit the BP
2, when you open a project, the BP will hit again, at this time, "ReadOptions()" will be called, and returned without writing to the configure file.
3, when you change the classbrowser's option, from current "project" to "everything", the BP will hit again, and "ReadOptions()" will be called again, but still not write to the configure file.
From my point of view, this is not correct.
As Tim said, we should use "../xxxxx.h" include directive, thanks.
I can't find a "Class browser's option. Where is that?
I can possible make those options "always write" if I could figure out where that is.
As it is with the patch:
If no changes were ever made to settings, why should anything be written to the .conf?
The write to .conf takes place when a user changes an item in MainMenu>settings>CodeCompletion.
@parser.cpp void Parser::WriteOptions()
WriteOptions take place on CB startup but changes nothing because active parser is null and m_pOptsChangerProject is null.
Any change made while no project is active gets written to .conf
When a project is loaded nothing has changed in .conf, so no write options need to be done.
If changes are made to settings (OnApply is entered), the active parser that made the changes
is recorded by OnApply().
Those changes are then written to the .conf, and only the settings made by that
active project are written to the .conf. all other projects read those settings.
If no user setting are made via settings, no need to care about writing the .conf.]
ActiveProject OnAppy project ActiveProject != OnApplyProject action
-------------- -------------- ------------------------------- ----------
nullptr nullptr False, will write .conf written at startup
nullptr nullptr False, will write no projects,.option changed, .conf wrtten
Nullptr Not null Does not happen Can't happen, no project to record
Not null nullptr True, no write no setting changed, no writes
Not null not null False, will write option changed, .conf written
nullptr nullptr False, will write project closed but no options change, no write
nullptr not null True, no write project closed, .conf written for matching project
Writes to the .conf take place only when there is no project or when a project changes options.
when a project changes options, only that project is allow to write the .conf