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:
parent
1f6a0f97e1
commit
ea5018aece
1 changed files with 13 additions and 3 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue