mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
remove preference read/saving not needed
This commit is contained in:
parent
a5e90c433e
commit
0e9cc685a8
1 changed files with 8 additions and 15 deletions
|
@ -28,6 +28,8 @@ public class ErrorParserManager extends OutputStream {
|
|||
|
||||
private int nOpens;
|
||||
|
||||
private static String PREF_ERROR_PARSER = "errorOutputParser";
|
||||
|
||||
private IProject fProject;
|
||||
private IMarkerGenerator fMarkerGenerator;
|
||||
private Map fFilesInProject;
|
||||
|
@ -56,8 +58,7 @@ public class ErrorParserManager extends OutputStream {
|
|||
public ErrorParserManager(IProject project, IMarkerGenerator markerGenerator, String[] parsersIDs) {
|
||||
fProject = project;
|
||||
if (parsersIDs == null) {
|
||||
fErrorParsers = new HashMap();
|
||||
readPreferences();
|
||||
enableAllParsers();
|
||||
} else {
|
||||
fErrorParsers = new HashMap(parsersIDs.length);
|
||||
for (int i = 0; i < parsersIDs.length; i++) {
|
||||
|
@ -128,19 +129,20 @@ public class ErrorParserManager extends OutputStream {
|
|||
return fDirectoryStack.size();
|
||||
}
|
||||
|
||||
private void readPreferences() {
|
||||
fErrorParsers.clear();
|
||||
String[] parserIDs = CCorePlugin.getDefault().getPreferenceErrorParserIDs();
|
||||
private void enableAllParsers() {
|
||||
fErrorParsers = new HashMap();
|
||||
String[] parserIDs = CCorePlugin.getDefault().getAllErrorParsersIDs();
|
||||
for (int i = 0; i < parserIDs.length; i++) {
|
||||
IErrorParser[] parsers = CCorePlugin.getDefault().getErrorParser(parserIDs[i]);
|
||||
fErrorParsers.put(parserIDs[i], parsers);
|
||||
}
|
||||
if (fErrorParsers.size() == 0) {
|
||||
initErrorParsersMap();
|
||||
savePreferences();
|
||||
CCorePlugin.getDefault().getPluginPreferences().setValue(PREF_ERROR_PARSER, ""); // remove old prefs
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void initErrorParsersMap() {
|
||||
String[] parserIDs = CCorePlugin.getDefault().getAllErrorParsersIDs();
|
||||
for (int i = 0; i < parserIDs.length; i++) {
|
||||
|
@ -149,15 +151,6 @@ public class ErrorParserManager extends OutputStream {
|
|||
}
|
||||
}
|
||||
|
||||
private void savePreferences() {
|
||||
String[] parserIDs = new String[fErrorParsers.size()];
|
||||
Iterator items = fErrorParsers.keySet().iterator();
|
||||
for (int i = 0; items.hasNext(); i++) {
|
||||
parserIDs[i] = (String) items.next();
|
||||
}
|
||||
CCorePlugin.getDefault().setPreferenceErrorParser(parserIDs);
|
||||
}
|
||||
|
||||
protected void collectFiles(IContainer parent, List result) {
|
||||
try {
|
||||
IResource[] resources = parent.members();
|
||||
|
|
Loading…
Add table
Reference in a new issue