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

[197199] fix persistence when renaming profiles

This commit is contained in:
David Dykstal 2007-08-30 19:42:39 +00:00
parent 3aa04bb1f4
commit 275b39c08c
2 changed files with 11 additions and 3 deletions

View file

@ -13,6 +13,7 @@
* Contributors:
* David Dykstal (IBM) - created and used RSEPreferencesManager
* - moved SystemPreferencesManager to a new plugin
* Kevin Doyle (IBM) - [197199] Renaming a Profile doesn't cause a save
********************************************************************************/
package org.eclipse.rse.internal.core.model;
@ -173,9 +174,13 @@ public class SystemProfileManager implements ISystemProfileManager {
boolean isActive = isSystemProfileActive(profile.getName());
String oldName = profile.getName();
profile.setName(newName);
if (isActive) RSEPreferencesManager.renameActiveProfile(oldName, newName);
// invalidateCache();
// FIXME RSEUIPlugin.getThePersistenceManager().save(this);
if (isActive) {
RSEPreferencesManager.renameActiveProfile(oldName, newName);
}
// Commit the profile to reflect the name change
RSECorePlugin.getThePersistenceManager().commitProfile(profile, 5000);
// Delete the profile by the old name, which is done in a separate job.
RSECorePlugin.getThePersistenceManager().deleteProfile(profile.getPersistenceProvider(), oldName);
}
/* (non-Javadoc)

View file

@ -14,6 +14,7 @@
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Kevin Doyle (IBM) - [163883] Multiple filter strings are disabled
* Kevin Doyle (IBM) - [197199] Renaming a Profile doesn't cause a save
********************************************************************************/
package org.eclipse.rse.internal.persistence.dom;
@ -104,6 +105,8 @@ public class RSEDOMExporter implements IRSEDOMExporter {
}
if (clean || profile.isDirty() || dom.isDirty()) {
// Doing a rename requires the dom to update it's name
dom.setName(profile.getName());
dom.clearAttributes();
dom.addAttribute(IRSEDOMConstants.ATTRIBUTE_DEFAULT_PRIVATE, getBooleanString(profile.isDefaultPrivate()));
dom.addAttribute(IRSEDOMConstants.ATTRIBUTE_IS_ACTIVE, getBooleanString(profile.isActive()));