1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 18:26:01 +02:00

Fix for not persisting the configuration removal

This commit is contained in:
Mikhail Sennikovsky 2007-03-30 16:58:26 +00:00
parent 627efcaeb6
commit edd4b98198
3 changed files with 24 additions and 0 deletions

View file

@ -402,6 +402,11 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
// } catch (CoreException e) { // } catch (CoreException e) {
// } // }
try {
getSpecSettings().removeConfiguration();
} catch (CoreException e) {
CCorePlugin.log(e);
}
((CProjectDescription)getProjectDescription()).configurationRemoved(this); ((CProjectDescription)getProjectDescription()).configurationRemoved(this);
remove(); remove();
} }

View file

@ -262,6 +262,9 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{
return fRootStorageElement; return fRootStorageElement;
} }
void removeConfiguration() throws CoreException{
CProjectDescriptionManager.getInstance().removeStorage(fCfg.getProjectDescription(), fCfg.getId());
}
private CStorage getStorageBase() throws CoreException{ private CStorage getStorageBase() throws CoreException{
if(fStorage == null){ if(fStorage == null){
fStorage = new CStorage((InternalXmlStorageElement)getRootStorageElement()); fStorage = new CStorage((InternalXmlStorageElement)getRootStorageElement());

View file

@ -1477,6 +1477,22 @@ public class CProjectDescriptionManager {
return element; return element;
} }
void removeStorage(ICSettingsStorage storage, String cfgId) throws CoreException{
ICStorageElement rootElement = storage.getStorage(MODULE_ID, false);
if(rootElement != null){
ICStorageElement children[] = rootElement.getChildren();
for(int i = 0; i < children.length; i++){
if(CONFIGURATION.equals(children[i].getName())
&& cfgId.equals(children[i].getAttribute(CConfigurationSpecSettings.ID))){
rootElement.removeChild(children[i]);
break;
}
}
}
}
CConfigurationData loadData(ICConfigurationDescription des, IProgressMonitor monitor) throws CoreException{ CConfigurationData loadData(ICConfigurationDescription des, IProgressMonitor monitor) throws CoreException{
if(monitor == null) if(monitor == null)
monitor = new NullProgressMonitor(); monitor = new NullProgressMonitor();