Skip to main content
summaryrefslogtreecommitdiffstats
path: root/codan
diff options
context:
space:
mode:
authorSergey Prigogin2011-05-13 18:31:04 -0400
committerSergey Prigogin2011-05-13 18:31:04 -0400
commit67e7fae70784c4f5ecc243d550573b4bfa91c3d0 (patch)
treed66e8e4ca53ad7f59bdd715cedb048c403d60734 /codan
parent4bd2d6a68de958cbafe4eeb1d38df1a4911403d3 (diff)
downloadorg.eclipse.cdt-67e7fae70784c4f5ecc243d550573b4bfa91c3d0.tar.gz
org.eclipse.cdt-67e7fae70784c4f5ecc243d550573b4bfa91c3d0.tar.xz
org.eclipse.cdt-67e7fae70784c4f5ecc243d550573b4bfa91c3d0.zip
Bug 345793 - Codan checkers run even when disabled.
Diffstat (limited to 'codan')
-rw-r--r--codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegistry.java2
-rw-r--r--codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java9
-rw-r--r--codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/PreferenceInitializer.java2
3 files changed, 8 insertions, 5 deletions
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegistry.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegistry.java
index 6f6f111ed6..da25cbcfb7 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegistry.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegistry.java
@@ -381,7 +381,7 @@ public class CheckersRegistry implements Iterable<IChecker>, ICheckersRegistry {
// load default values
CodanPreferencesLoader loader = new CodanPreferencesLoader(prof);
Preferences projectNode = CodanPreferencesLoader.getProjectNode((IProject) element);
- boolean useWorkspace = projectNode.getBoolean(PreferenceConstants.P_USE_PARENT, false);
+ boolean useWorkspace = projectNode.getBoolean(PreferenceConstants.P_USE_PARENT, true);
if (!useWorkspace) {
loader.load(projectNode);
}
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java
index 5729df0761..fe7dcc7f3e 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java
@@ -220,8 +220,9 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
});
// Set workspace/project radio buttons
try {
- Boolean useWorkspace = getPreferenceStore().getBoolean(PreferenceConstants.P_USE_PARENT);
- if (useWorkspace) {
+ IPreferenceStore preferences = getPreferenceStore();
+ if (!preferences.contains(PreferenceConstants.P_USE_PARENT) ||
+ preferences.getBoolean(PreferenceConstants.P_USE_PARENT)) {
useWorkspaceSettingsButton.setSelection(true);
} else {
useProjectSettingsButton.setSelection(true);
@@ -303,8 +304,8 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
public boolean performOk() {
boolean result = super.performOk();
if (result && isPropertyPage()) {
- // Save state of radiobuttons in project properties
- getPreferenceStore().setValue(PreferenceConstants.P_USE_PARENT, !useProjectSettingsButton.getSelection());
+ // Save state of radio buttons in project properties
+ getPreferenceStore().setValue(PreferenceConstants.P_USE_PARENT, useWorkspaceSettingsButton.getSelection());
}
return result;
}
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/PreferenceInitializer.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/PreferenceInitializer.java
index a51029397d..2c733536b4 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/PreferenceInitializer.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/PreferenceInitializer.java
@@ -25,9 +25,11 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
* @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#
* initializeDefaultPreferences()
*/
+ @Override
public void initializeDefaultPreferences() {
IPreferenceStore store = CodanUIActivator.getDefault().getPreferenceStore();
store.setDefault(PreferenceConstants.P_RUN_ON_BUILD, false);
store.setDefault(PreferenceConstants.P_RUN_IN_EDITOR, true);
+ store.setDefault(PreferenceConstants.P_USE_PARENT, true);
}
}

Back to the top