mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-13 12:05:21 +02:00
[191284] Confusing behaviour when editing a Readonly file.
This commit is contained in:
parent
ac14404a1f
commit
9d19f6ecb4
1 changed files with 10 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (c) 2002, 2008 IBM Corporation and others. All rights reserved.
|
* Copyright (c) 2002, 2010 IBM Corporation and others. All rights reserved.
|
||||||
* This program and the accompanying materials are made available under the terms
|
* This program and the accompanying materials are made available under the terms
|
||||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
@ -25,6 +25,7 @@
|
||||||
* David McKnight (IBM) - [235221] Files truncated on exit of Eclipse
|
* 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) - [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
|
* David McKnight (IBM) - [256048] Saving a member open in Remote LPEX editor while Working Offline doesn't set the dirty property
|
||||||
|
* David McKnight (IBM) - [191284] Confusing behaviour when editing a Readonly file.
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.files.ui.resources;
|
package org.eclipse.rse.files.ui.resources;
|
||||||
|
@ -199,8 +200,14 @@ public class SystemUniversalTempFileListener extends SystemTempFileListener
|
||||||
// If remote file is read-only make it writable as the local
|
// If remote file is read-only make it writable as the local
|
||||||
// copy has changed to be writable
|
// copy has changed to be writable
|
||||||
if (remoteFile.exists() && !remoteFile.canWrite() && !tempFile.isReadOnly()) {
|
if (remoteFile.exists() && !remoteFile.canWrite() && !tempFile.isReadOnly()) {
|
||||||
remoteFile.getParentRemoteFileSubSystem().setReadOnly(
|
IRemoteFileSubSystem ss = remoteFile.getParentRemoteFileSubSystem();
|
||||||
remoteFile, false, new NullProgressMonitor());
|
ss.setReadOnly(remoteFile, false, monitor);
|
||||||
|
|
||||||
|
// the remote file is still marked read-only, we need to requery the file (i.e. for SSH and FTP)
|
||||||
|
if (!remoteFile.canWrite()){
|
||||||
|
remoteFile.markStale(true);
|
||||||
|
remoteFile = ss.getRemoteFileObject(remoteFile.getAbsolutePath(), monitor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean openEditorAfterUpload = false;
|
boolean openEditorAfterUpload = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue