1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-15 04:55:22 +02:00

[203365] Profile should not be saved as a result of file transfer

This commit is contained in:
David McKnight 2007-09-14 15:52:45 +00:00
parent 04c5b9b705
commit 47f6dfad3c

View file

@ -20,6 +20,7 @@
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty()
* Kevin Doyle (IBM) - [203365] Profile should not be saved as a result of file transfer
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core.model; package org.eclipse.rse.core.model;
@ -555,7 +556,7 @@ public class Host extends RSEModelObject implements IHost {
* @see org.eclipse.rse.core.model.IHost#setDefaultEncoding(java.lang.String, boolean) * @see org.eclipse.rse.core.model.IHost#setDefaultEncoding(java.lang.String, boolean)
*/ */
public void setDefaultEncoding(String encoding, boolean fromRemote) { public void setDefaultEncoding(String encoding, boolean fromRemote) {
boolean commit = false;
IPropertySet encPropertySet = getPropertySet(ENCODING_PROPERTY_SET); IPropertySet encPropertySet = getPropertySet(ENCODING_PROPERTY_SET);
if (encPropertySet == null) { if (encPropertySet == null) {
@ -563,27 +564,35 @@ public class Host extends RSEModelObject implements IHost {
} }
if (encPropertySet != null) { if (encPropertySet != null) {
String savedNonRemoteEncoding = encPropertySet.getPropertyValue(ENCODING_NON_REMOTE_PROPERTY_KEY);
String savedRemoteEncoding = encPropertySet.getPropertyValue(ENCODING_REMOTE_PROPERTY_KEY);
if (encoding != null) { if (encoding != null) {
if (!fromRemote) { if (!fromRemote && !encoding.equals(savedNonRemoteEncoding)) {
encPropertySet.addProperty(ENCODING_NON_REMOTE_PROPERTY_KEY, encoding); encPropertySet.addProperty(ENCODING_NON_REMOTE_PROPERTY_KEY, encoding);
commit = true;
} }
else { else if (fromRemote && !encoding.equals(savedRemoteEncoding)) {
encPropertySet.addProperty(ENCODING_REMOTE_PROPERTY_KEY, encoding); encPropertySet.addProperty(ENCODING_REMOTE_PROPERTY_KEY, encoding);
commit = true;
} }
} }
else { else {
if (!fromRemote) { if (!fromRemote && savedNonRemoteEncoding != null) {
encPropertySet.removeProperty(ENCODING_NON_REMOTE_PROPERTY_KEY); encPropertySet.removeProperty(ENCODING_NON_REMOTE_PROPERTY_KEY);
commit = true;
} }
else { else if (fromRemote && savedRemoteEncoding != null) {
encPropertySet.removeProperty(ENCODING_REMOTE_PROPERTY_KEY); encPropertySet.removeProperty(ENCODING_REMOTE_PROPERTY_KEY);
commit = true;
} }
} }
} }
// Only commit if the encoding has changed
commit(); if (commit) {
commit();
}
} }
} }