mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 05:10:58 +00:00
Bugfix storing incorrect defaults values.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14964 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
57d4133012
commit
faafdba8e7
2 changed files with 19 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2002-11-09 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSDocumentController.m: Don't try to store NSURL objects in
|
||||||
|
defaults system.
|
||||||
|
|
||||||
2002-11-08 Adam Fedor <fedor@gnu.org>
|
2002-11-08 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
* Source/NSSavePanel.m ([NSSavePanel -_shouldShowExtension:isDir:]):
|
* Source/NSSavePanel.m ([NSSavePanel -_shouldShowExtension:isDir:]):
|
||||||
|
|
|
@ -101,7 +101,7 @@ static NSDictionary *TypeInfoForName (NSArray *types, NSString *typeName)
|
||||||
<p>
|
<p>
|
||||||
You can use NSDocumentController to get a list of all open
|
You can use NSDocumentController to get a list of all open
|
||||||
documents, the current document (The one whose window is Key) and
|
documents, the current document (The one whose window is Key) and
|
||||||
other information about these documents. It also remebers the most
|
other information about these documents. It also remembers the most
|
||||||
recently opened documents (through the user default key
|
recently opened documents (through the user default key
|
||||||
NSRecentDocuments). .
|
NSRecentDocuments). .
|
||||||
</p>
|
</p>
|
||||||
|
@ -729,7 +729,7 @@ static NSDictionary *TypeInfoForName (NSArray *types, NSString *typeName)
|
||||||
// The number of remembered recent documents
|
// The number of remembered recent documents
|
||||||
#define MAX_DOCS 5
|
#define MAX_DOCS 5
|
||||||
|
|
||||||
- (void)noteNewRecentDocument:(NSDocument *)aDocument
|
- (void) noteNewRecentDocument: (NSDocument *)aDocument
|
||||||
{
|
{
|
||||||
NSString *fileName = [aDocument fileName];
|
NSString *fileName = [aDocument fileName];
|
||||||
NSURL *anURL = [NSURL fileURLWithPath: fileName];
|
NSURL *anURL = [NSURL fileURLWithPath: fileName];
|
||||||
|
@ -741,6 +741,7 @@ static NSDictionary *TypeInfoForName (NSArray *types, NSString *typeName)
|
||||||
- (void) noteNewRecentDocumentURL: (NSURL *)anURL
|
- (void) noteNewRecentDocumentURL: (NSURL *)anURL
|
||||||
{
|
{
|
||||||
unsigned index = [_recentDocuments indexOfObject: anURL];
|
unsigned index = [_recentDocuments indexOfObject: anURL];
|
||||||
|
NSMutableArray *a;
|
||||||
|
|
||||||
if (index != NSNotFound)
|
if (index != NSNotFound)
|
||||||
{
|
{
|
||||||
|
@ -753,13 +754,22 @@ static NSDictionary *TypeInfoForName (NSArray *types, NSString *typeName)
|
||||||
}
|
}
|
||||||
|
|
||||||
[_recentDocuments addObject: anURL];
|
[_recentDocuments addObject: anURL];
|
||||||
|
|
||||||
|
a = [_recentDocuments mutableCopy];
|
||||||
|
index = [a count];
|
||||||
|
while (index-- > 0)
|
||||||
|
{
|
||||||
|
[a replaceObjectAtIndex: index withObject:
|
||||||
|
[[a objectAtIndex: index] absoluteString]];
|
||||||
|
}
|
||||||
[[NSUserDefaults standardUserDefaults]
|
[[NSUserDefaults standardUserDefaults]
|
||||||
setObject: _recentDocuments forKey: NSRecentDocuments];
|
setObject: a forKey: NSRecentDocuments];
|
||||||
|
RELEASE(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSArray *) recentDocumentURLs
|
- (NSArray *) recentDocumentURLs
|
||||||
{
|
{
|
||||||
return _recentDocuments;
|
return _recentDocuments;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue