mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 12:11:00 +00:00
Ensure proper working of autosaving for NSDocument subclasses that
override -writeWithBackupToFile:ofType:saveOperation. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29267 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
31586c0e6f
commit
5736f119e9
2 changed files with 21 additions and 4 deletions
|
@ -1,6 +1,10 @@
|
||||||
2010-01-11 Wolfgang Lux <wolfgang.lux@gmail.com>
|
2010-01-11 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||||
|
|
||||||
* Source/NSProgressIndicator.m (-setDisplayedWhenStopped): Fix
|
* Source/NSDocument.m (-writeSafelyToURL:ofType:...): Ensure
|
||||||
|
proper working of autosaving for subclasses that override
|
||||||
|
-writeWithBackupToFile:ofType:saveOperation.
|
||||||
|
|
||||||
|
* Source/NSProgressIndicator.m (-setDisplayedWhenStopped:): Fix
|
||||||
incorrect assignment which made this method a no-op.
|
incorrect assignment which made this method a no-op.
|
||||||
|
|
||||||
2010-01-11 Fred Kiefer <FredKiefer@gmx.de>
|
2010-01-11 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
|
@ -868,15 +868,28 @@ withContentsOfURL: (NSURL *)url
|
||||||
|
|
||||||
if (OVERRIDDEN(writeWithBackupToFile:ofType:saveOperation:))
|
if (OVERRIDDEN(writeWithBackupToFile:ofType:saveOperation:))
|
||||||
{
|
{
|
||||||
|
BOOL isAutosave = NO;
|
||||||
|
|
||||||
if (op == NSAutosaveOperation)
|
if (op == NSAutosaveOperation)
|
||||||
{
|
{
|
||||||
op = NSSaveToOperation;
|
op = NSSaveToOperation;
|
||||||
|
isAutosave = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
*error = nil;
|
*error = nil;
|
||||||
return [self writeWithBackupToFile: [url path]
|
if (![self writeWithBackupToFile: [url path]
|
||||||
ofType: type
|
ofType: type
|
||||||
saveOperation: op];
|
saveOperation: op])
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isAutosave)
|
||||||
|
{
|
||||||
|
[self setAutosavedContentsFileURL: url];
|
||||||
|
[self updateChangeCount: NSChangeAutosaved];
|
||||||
|
}
|
||||||
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isNativeType || (url == nil))
|
if (!isNativeType || (url == nil))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue