1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-03-28 14:56:28 +01:00

fix(908): fix for the cmake tool chain removal function. (#909)

Resolves that the calculated ID in the removal function was different than the one in the add

Fixes #908
This commit is contained in:
Ali Azam Rana 2024-10-08 17:02:41 +02:00 committed by GitHub
parent 84b5a4c3ea
commit f680907cab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -156,20 +156,18 @@ public class CMakeToolChainManager implements ICMakeToolChainManager {
public void removeToolChainFile(ICMakeToolChainFile file) {
init();
fireEvent(new CMakeToolChainEvent(CMakeToolChainEvent.REMOVED, file));
String tcId = makeToolChainId(file.getProperty(CMakeBuildConfiguration.TOOLCHAIN_TYPE),
file.getProperty(CMakeBuildConfiguration.TOOLCHAIN_ID));
filesByToolChain.remove(tcId);
String n = ((CMakeToolChainFile) file).n;
if (n != null) {
Preferences prefs = getPreferences();
Preferences tcNode = prefs.node(n);
try {
try {
String tcId = makeToolChainId(file.getToolChain());
filesByToolChain.remove(tcId);
String n = ((CMakeToolChainFile) file).n;
if (n != null) {
Preferences prefs = getPreferences();
Preferences tcNode = prefs.node(n);
tcNode.removeNode();
prefs.flush();
} catch (BackingStoreException e) {
Activator.log(e);
}
} catch (CoreException | BackingStoreException e) {
Activator.log(e);
}
}