1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Fix deletion of project local preferences.

This commit is contained in:
Markus Schorn 2007-07-04 14:44:27 +00:00
parent 1f6a0f97e1
commit ea5018aece

View file

@ -96,13 +96,22 @@ public class LocalProjectScope implements IScopeContext {
Preferences target= getPPP(movedTo.lastSegment());
copyPrefs(prefs, target);
}
Preferences parent= prefs.parent();
prefs.removeNode();
parent.flush();
deletePrefs(prefs);
} catch (BackingStoreException e) {
}
}
private static void deletePrefs(Preferences prefs) throws BackingStoreException {
prefs.clear();
String[] children= prefs.childrenNames();
for (int i = 0; i < children.length; i++) {
String child = children[i];
prefs.node(child).removeNode();
}
prefs.flush();
prefs.removeNode();
}
private static void copyPrefs(Preferences prefs, Preferences target) throws BackingStoreException {
String[] keys= prefs.keys();
for (int i = 0; i < keys.length; i++) {
@ -117,5 +126,6 @@ public class LocalProjectScope implements IScopeContext {
String child = children[i];
copyPrefs(prefs.node(child), target.node(child));
}
target.flush();
}
}