summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOtavio Pontes 2011-10-25 20:46:30 (EDT)
committerMarc-Andre Laperle2012-01-07 22:56:08 (EST)
commit9e260b1c8d7eddc0d6e01621fb5ebdad1ccbaad4 (patch)
tree1ecb2818299409911c8d5363ee6da99c20e7ba56
parentf68309419da253c804fc9862fbf37c6bc3e37eaa (diff)
downloadorg.eclipse.cdt-9e260b1c8d7eddc0d6e01621fb5ebdad1ccbaad4.zip
org.eclipse.cdt-9e260b1c8d7eddc0d6e01621fb5ebdad1ccbaad4.tar.gz
org.eclipse.cdt-9e260b1c8d7eddc0d6e01621fb5ebdad1ccbaad4.tar.bz2
Bug 345614 - restore default button in codan preferences
-rw-r--r--codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java
index a695635..fb2396a 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java
@@ -13,6 +13,7 @@ package org.eclipse.cdt.codan.internal.ui.preferences;
import java.text.MessageFormat;
+import org.eclipse.cdt.codan.core.CodanRuntime;
import org.eclipse.cdt.codan.core.PreferenceConstants;
import org.eclipse.cdt.codan.core.model.CodanSeverity;
import org.eclipse.cdt.codan.core.model.IProblem;
@@ -332,16 +333,18 @@ public class ProblemsTreeEditor extends CheckedTreeEditor {
@Override
protected void doLoadDefault() {
if (getTreeControl() != null) {
+ CodanPreferencesLoader defaultPreferences = new CodanPreferencesLoader(CodanRuntime.getInstance().getCheckersRegistry().getDefaultProfile());
IProblem[] probs = codanPreferencesLoader.getProblems();
for (int i = 0; i < probs.length; i++) {
String id = probs[i].getId();
String s = getPreferenceStore().getDefaultString(id);
if (s == null || s.length() == 0) {
- s = codanPreferencesLoader.getProperty(id);
+ s = defaultPreferences.getProperty(id);
}
codanPreferencesLoader.setProperty(id, s);
}
getViewer().setInput(codanPreferencesLoader.getInput());
+ setPresentsDefaultValue(true);
}
}