mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +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
94c17965b4
commit
b89db86a92
2 changed files with 21 additions and 4 deletions
|
@ -1,6 +1,10 @@
|
|||
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.
|
||||
|
||||
2010-01-11 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
|
|
@ -868,15 +868,28 @@ withContentsOfURL: (NSURL *)url
|
|||
|
||||
if (OVERRIDDEN(writeWithBackupToFile:ofType:saveOperation:))
|
||||
{
|
||||
BOOL isAutosave = NO;
|
||||
|
||||
if (op == NSAutosaveOperation)
|
||||
{
|
||||
op = NSSaveToOperation;
|
||||
isAutosave = YES;
|
||||
}
|
||||
|
||||
*error = nil;
|
||||
return [self writeWithBackupToFile: [url path]
|
||||
ofType: type
|
||||
saveOperation: op];
|
||||
if (![self writeWithBackupToFile: [url path]
|
||||
ofType: type
|
||||
saveOperation: op])
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
if (isAutosave)
|
||||
{
|
||||
[self setAutosavedContentsFileURL: url];
|
||||
[self updateChangeCount: NSChangeAutosaved];
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
if (!isNativeType || (url == nil))
|
||||
|
|
Loading…
Reference in a new issue