Lines 20-25
Link Here
|
20 |
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType |
20 |
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType |
21 |
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods |
21 |
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods |
22 |
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() |
22 |
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() |
|
|
23 |
* Kevin Doyle (IBM) - [203365] Profile should not be saved as a result of file transfer |
23 |
********************************************************************************/ |
24 |
********************************************************************************/ |
24 |
|
25 |
|
25 |
package org.eclipse.rse.core.model; |
26 |
package org.eclipse.rse.core.model; |
Lines 555-561
Link Here
|
555 |
* @see org.eclipse.rse.core.model.IHost#setDefaultEncoding(java.lang.String, boolean) |
556 |
* @see org.eclipse.rse.core.model.IHost#setDefaultEncoding(java.lang.String, boolean) |
556 |
*/ |
557 |
*/ |
557 |
public void setDefaultEncoding(String encoding, boolean fromRemote) { |
558 |
public void setDefaultEncoding(String encoding, boolean fromRemote) { |
558 |
|
559 |
boolean commit = false; |
559 |
IPropertySet encPropertySet = getPropertySet(ENCODING_PROPERTY_SET); |
560 |
IPropertySet encPropertySet = getPropertySet(ENCODING_PROPERTY_SET); |
560 |
|
561 |
|
561 |
if (encPropertySet == null) { |
562 |
if (encPropertySet == null) { |
Lines 563-589
Link Here
|
563 |
} |
564 |
} |
564 |
|
565 |
|
565 |
if (encPropertySet != null) { |
566 |
if (encPropertySet != null) { |
|
|
567 |
String savedNonRemoteEncoding = encPropertySet.getPropertyValue(ENCODING_NON_REMOTE_PROPERTY_KEY); |
568 |
String savedRemoteEncoding = encPropertySet.getPropertyValue(ENCODING_REMOTE_PROPERTY_KEY); |
566 |
|
569 |
|
567 |
if (encoding != null) { |
570 |
if (encoding != null) { |
568 |
|
571 |
|
569 |
if (!fromRemote) { |
572 |
if (!fromRemote && !encoding.equals(savedNonRemoteEncoding)) { |
570 |
encPropertySet.addProperty(ENCODING_NON_REMOTE_PROPERTY_KEY, encoding); |
573 |
encPropertySet.addProperty(ENCODING_NON_REMOTE_PROPERTY_KEY, encoding); |
|
|
574 |
commit = true; |
571 |
} |
575 |
} |
572 |
else { |
576 |
else if (fromRemote && !encoding.equals(savedRemoteEncoding)) { |
573 |
encPropertySet.addProperty(ENCODING_REMOTE_PROPERTY_KEY, encoding); |
577 |
encPropertySet.addProperty(ENCODING_REMOTE_PROPERTY_KEY, encoding); |
|
|
578 |
commit = true; |
574 |
} |
579 |
} |
575 |
} |
580 |
} |
576 |
else { |
581 |
else { |
577 |
|
582 |
|
578 |
if (!fromRemote) { |
583 |
if (!fromRemote && savedNonRemoteEncoding != null) { |
579 |
encPropertySet.removeProperty(ENCODING_NON_REMOTE_PROPERTY_KEY); |
584 |
encPropertySet.removeProperty(ENCODING_NON_REMOTE_PROPERTY_KEY); |
|
|
585 |
commit = true; |
580 |
} |
586 |
} |
581 |
else { |
587 |
else if (fromRemote && savedRemoteEncoding != null) { |
582 |
encPropertySet.removeProperty(ENCODING_REMOTE_PROPERTY_KEY); |
588 |
encPropertySet.removeProperty(ENCODING_REMOTE_PROPERTY_KEY); |
|
|
589 |
commit = true; |
583 |
} |
590 |
} |
584 |
} |
591 |
} |
585 |
} |
592 |
} |
586 |
|
593 |
// Only commit if the encoding has changed |
587 |
commit(); |
594 |
if (commit) { |
|
|
595 |
commit(); |
596 |
} |
588 |
} |
597 |
} |
589 |
} |
598 |
} |