mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-05 07:15:39 +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());
|
Preferences target= getPPP(movedTo.lastSegment());
|
||||||
copyPrefs(prefs, target);
|
copyPrefs(prefs, target);
|
||||||
}
|
}
|
||||||
Preferences parent= prefs.parent();
|
deletePrefs(prefs);
|
||||||
prefs.removeNode();
|
|
||||||
parent.flush();
|
|
||||||
} catch (BackingStoreException e) {
|
} 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 {
|
private static void copyPrefs(Preferences prefs, Preferences target) throws BackingStoreException {
|
||||||
String[] keys= prefs.keys();
|
String[] keys= prefs.keys();
|
||||||
for (int i = 0; i < keys.length; i++) {
|
for (int i = 0; i < keys.length; i++) {
|
||||||
|
@ -117,5 +126,6 @@ public class LocalProjectScope implements IScopeContext {
|
||||||
String child = children[i];
|
String child = children[i];
|
||||||
copyPrefs(prefs.node(child), target.node(child));
|
copyPrefs(prefs.node(child), target.node(child));
|
||||||
}
|
}
|
||||||
|
target.flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue