1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-25 09:55:29 +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,28 +685,31 @@ public abstract class SystemTempFileListener implements IResourceChangeListener
}
// attempt the remote file synchronization
if (doesHandle(fs) && !fs.isOffline())
if (doesHandle(fs))
{
// see if we're connected
try
{
// check that the remote file system is connected
// if not, attempt to connect to it
if (!fs.isConnected())
if (!fs.isOffline()){
// see if we're connected
try
{
fs.connect(false, null);
// check that the remote file system is connected
// if not, attempt to connect to it
if (!fs.isConnected())
{
// make sure we connect synchronously from here
fs.connect(monitor, false);
}
}
catch (Exception e)
{
// unable to connect to the remote server
// do not attempt synchronization
// instead, defer synchronization to later but allow user to edit
// set the dirty flag to indicate that this file needs resynchronization
properties.setDirty(true);
return;
}
}
catch (Exception e)
{
// unable to connect to the remote server
// do not attempt synchronization
// instead, defer synchronization to later but allow user to edit
// set the dirty flag to indicate that this file needs resynchronization
properties.setDirty(true);
return;
}
doResourceSynchronization(fs, file, uploadPath, monitor);
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())
{
properties.setDirty(true);
// 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