Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Getting Code Analysis preferences of a project

On 14-02-20 11:34 AM, Roberto Oliveira wrote:

> In the project's preferences,C/C++ General > Code Analysis, there are two options for CODAN. One is  "Use workspace
> Settings" and the other is "Use project Settings". (like in picture bellow)
> project-pref
> 
> Is there a way to programmatically  get what option is selected for a specific project?if is selected "use workspace
> settings" or "use project settings" ?

Based on the code in CheckersRegistry.getResourceProfile, I think you want to do:

	IProject project;
	Preferences projectNode = CodanPreferencesLoader.getProjectNode(project);
	boolean useProjectPrefs
		=  projectNode != null
		&& !projectNode.getBoolean(PreferenceConstants.P_USE_PARENT, true));

I.e., is looks like the ProjectScope preferences store a boolean preference "useParentScope" when the project-specific
settings should be ignored.

-Andrew


Back to the top