Update the document controller's recent document list when NSDocument

saves a document. This means that the user will	find her fresh
documents in that list the next time.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31184 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2010-08-19 16:47:27 +00:00
parent b9b154d6bf
commit 20abd629f9
2 changed files with 30 additions and 4 deletions

View file

@ -1,3 +1,10 @@
2010-08-19 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSDocument.m (-svaveToFile:saveOperation:delegate:...,
-saveToURLofType:forSaveOperation:...): Update the document
controller's recent document list. This means that the user will
find her fresh documents in that list after saving them.
2010-08-16 Wolfgang Lux <wolfgang.lux@gmail.com>
* Headers/AppKit/NSDocument.h:

View file

@ -1554,6 +1554,13 @@ originalContentsURL: (NSURL *)orig
saved = [self writeWithBackupToFile: fileName
ofType: [self fileTypeFromLastRunSavePanel]
saveOperation: saveOperation];
if (saved &&
(saveOperation == NSSaveOperation ||
saveOperation == NSSaveAsOperation))
{
[[NSDocumentController sharedDocumentController]
noteNewRecentDocument: self];
}
}
if (delegate != nil && didSaveSelector != NULL)
@ -1571,10 +1578,17 @@ originalContentsURL: (NSURL *)orig
forSaveOperation: (NSSaveOperationType)op
error: (NSError **)error
{
return [self writeSafelyToURL: url
ofType: type
forSaveOperation: op
error: error];
BOOL saved =
[self writeSafelyToURL: url
ofType: type
forSaveOperation: op
error: error];
if (saved && (op == NSSaveOperation || op == NSSaveAsOperation))
{
[[NSDocumentController sharedDocumentController]
noteNewRecentDocument: self];
}
return saved;
}
- (void) saveToURL: (NSURL *)url
@ -1595,6 +1609,11 @@ originalContentsURL: (NSURL *)orig
{
[self presentError: error];
}
else if (op == NSSaveOperation || op == NSSaveAsOperation)
{
[[NSDocumentController sharedDocumentController]
noteNewRecentDocument: self];
}
if (delegate != nil && didSaveSelector != NULL)
{