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

[256048] Saving a member open in Remote LPEX editor while Working Offline doesn't set the dirty property

This commit is contained in:
David McKnight 2008-11-24 21:15:55 +00:00
parent a728efdbd2
commit 5172b0a6e1
2 changed files with 34 additions and 19 deletions

View file

@ -24,6 +24,7 @@
* David McKnight (IBM) - [225747] [dstore] Trying to connect to an "Offline" system throws an NPE
* David McKnight (IBM) - [235221] Files truncated on exit of Eclipse
* David McKnight (IBM) - [251631] NullPointerException in SystemTempFileListener
* David McKnight (IBM) - [256048] Saving a member open in Remote LPEX editor while Working Offline doesn't set the dirty property
*******************************************************************************/
package org.eclipse.rse.files.ui.resources;
@ -684,8 +685,9 @@ public abstract class SystemTempFileListener implements IResourceChangeListener
}
// attempt the remote file synchronization
if (doesHandle(fs) && !fs.isOffline())
if (doesHandle(fs))
{
if (!fs.isOffline()){
// see if we're connected
try
{
@ -693,7 +695,8 @@ public abstract class SystemTempFileListener implements IResourceChangeListener
// if not, attempt to connect to it
if (!fs.isConnected())
{
fs.connect(false, null);
// make sure we connect synchronously from here
fs.connect(monitor, false);
}
}
catch (Exception e)
@ -705,6 +708,7 @@ public abstract class SystemTempFileListener implements IResourceChangeListener
properties.setDirty(true);
return;
}
}
doResourceSynchronization(fs, file, uploadPath, monitor);
}
}

View file

@ -24,6 +24,7 @@
* Kevin Doyle (IBM) - [210389] Display error dialog when setting file not read-only fails when saving
* David McKnight (IBM) - [235221] Files truncated on exit of Eclipse
* David McKnight (IBM) - [249544] Save conflict dialog appears when saving files in the editor
* David McKnight (IBM) - [256048] Saving a member open in Remote LPEX editor while Working Offline doesn't set the dirty property
********************************************************************************/
package org.eclipse.rse.files.ui.resources;
@ -140,7 +141,17 @@ public class SystemUniversalTempFileListener extends SystemTempFileListener
// make sure we're working online - not offline
if (fs.isOffline())
{
// offline mode - make sure the file stays dirty
properties.setDirty(true);
// try to reset the dirty indicator for the editor if it's open
// will only work for lpex right now
SystemEditableRemoteFile editable = null;
if (properties.getRemoteFileObject() instanceof SystemEditableRemoteFile){
editable = (SystemEditableRemoteFile)properties.getRemoteFileObject();
editable.updateDirtyIndicator();
}
return;
}
else