mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-14 20:45:22 +02:00
[197199] fix persistence when renaming profiles
This commit is contained in:
parent
3aa04bb1f4
commit
275b39c08c
2 changed files with 11 additions and 3 deletions
|
@ -13,6 +13,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* David Dykstal (IBM) - created and used RSEPreferencesManager
|
* David Dykstal (IBM) - created and used RSEPreferencesManager
|
||||||
* - moved SystemPreferencesManager to a new plugin
|
* - 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;
|
package org.eclipse.rse.internal.core.model;
|
||||||
|
@ -173,9 +174,13 @@ public class SystemProfileManager implements ISystemProfileManager {
|
||||||
boolean isActive = isSystemProfileActive(profile.getName());
|
boolean isActive = isSystemProfileActive(profile.getName());
|
||||||
String oldName = profile.getName();
|
String oldName = profile.getName();
|
||||||
profile.setName(newName);
|
profile.setName(newName);
|
||||||
if (isActive) RSEPreferencesManager.renameActiveProfile(oldName, newName);
|
if (isActive) {
|
||||||
// invalidateCache();
|
RSEPreferencesManager.renameActiveProfile(oldName, newName);
|
||||||
// FIXME RSEUIPlugin.getThePersistenceManager().save(this);
|
}
|
||||||
|
// 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)
|
/* (non-Javadoc)
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
|
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
|
||||||
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
|
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
|
||||||
* Kevin Doyle (IBM) - [163883] Multiple filter strings are disabled
|
* 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;
|
package org.eclipse.rse.internal.persistence.dom;
|
||||||
|
@ -104,6 +105,8 @@ public class RSEDOMExporter implements IRSEDOMExporter {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clean || profile.isDirty() || dom.isDirty()) {
|
if (clean || profile.isDirty() || dom.isDirty()) {
|
||||||
|
// Doing a rename requires the dom to update it's name
|
||||||
|
dom.setName(profile.getName());
|
||||||
dom.clearAttributes();
|
dom.clearAttributes();
|
||||||
dom.addAttribute(IRSEDOMConstants.ATTRIBUTE_DEFAULT_PRIVATE, getBooleanString(profile.isDefaultPrivate()));
|
dom.addAttribute(IRSEDOMConstants.ATTRIBUTE_DEFAULT_PRIVATE, getBooleanString(profile.isDefaultPrivate()));
|
||||||
dom.addAttribute(IRSEDOMConstants.ATTRIBUTE_IS_ACTIVE, getBooleanString(profile.isActive()));
|
dom.addAttribute(IRSEDOMConstants.ATTRIBUTE_IS_ACTIVE, getBooleanString(profile.isActive()));
|
||||||
|
|
Loading…
Add table
Reference in a new issue