mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Fix for writing plists to URLs
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@10852 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ddd9a6e299
commit
e5f80777d1
3 changed files with 41 additions and 4 deletions
|
@ -3,8 +3,9 @@
|
||||||
* Source/GSCompatibility.m: GSXMLPlMake() unused argument removed.
|
* Source/GSCompatibility.m: GSXMLPlMake() unused argument removed.
|
||||||
* Source/NSData.m: Unused and commented out XML plist code removed.
|
* Source/NSData.m: Unused and commented out XML plist code removed.
|
||||||
* Source/NSString.m: ditto
|
* Source/NSString.m: ditto
|
||||||
* Source/NSArray.m: Generate XML plists only when writing to file,
|
* Source/NSArray.m: Generate XML plists only when writing to file
|
||||||
not for the -description... methods. This is what MacOS-X does.
|
or to URL, not for the -description... methods.
|
||||||
|
This is what MacOS-X does.
|
||||||
* Source/NSDictionary.m: ditto
|
* Source/NSDictionary.m: ditto
|
||||||
|
|
||||||
2001-09-05 Adam Fedor <fedor@gnu.org>
|
2001-09-05 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
|
@ -859,11 +859,29 @@ static NSString *indentStrings[] = {
|
||||||
|
|
||||||
- (BOOL) writeToURL: (NSURL *)url atomically: (BOOL)useAuxiliaryFile
|
- (BOOL) writeToURL: (NSURL *)url atomically: (BOOL)useAuxiliaryFile
|
||||||
{
|
{
|
||||||
|
extern BOOL GSMacOSXCompatiblePropertyLists();
|
||||||
NSDictionary *loc;
|
NSDictionary *loc;
|
||||||
NSString *desc;
|
NSString *desc;
|
||||||
|
|
||||||
loc = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation];
|
loc = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation];
|
||||||
desc = [self descriptionWithLocale: loc indent: 0];
|
|
||||||
|
if (GSMacOSXCompatiblePropertyLists() == YES)
|
||||||
|
{
|
||||||
|
extern NSString *GSXMLPlMake(id obj, NSDictionary *loc);
|
||||||
|
|
||||||
|
desc = GSXMLPlMake(self, loc);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NSMutableString *result;
|
||||||
|
|
||||||
|
result = [[NSMutableString alloc] initWithCapacity: 20*[self count]];
|
||||||
|
result = AUTORELEASE(result);
|
||||||
|
[self descriptionWithLocale: loc
|
||||||
|
indent: 0
|
||||||
|
to: (id<GNUDescriptionDestination>)result];
|
||||||
|
desc = result;
|
||||||
|
}
|
||||||
|
|
||||||
return [desc writeToURL: url atomically: useAuxiliaryFile];
|
return [desc writeToURL: url atomically: useAuxiliaryFile];
|
||||||
}
|
}
|
||||||
|
|
|
@ -651,11 +651,29 @@ compareIt(id o1, id o2, void* context)
|
||||||
|
|
||||||
- (BOOL) writeToURL: (NSURL *)url atomically: (BOOL)useAuxiliaryFile
|
- (BOOL) writeToURL: (NSURL *)url atomically: (BOOL)useAuxiliaryFile
|
||||||
{
|
{
|
||||||
|
extern BOOL GSMacOSXCompatiblePropertyLists();
|
||||||
NSDictionary *loc;
|
NSDictionary *loc;
|
||||||
NSString *desc;
|
NSString *desc;
|
||||||
|
|
||||||
loc = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation];
|
loc = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation];
|
||||||
desc = [self descriptionWithLocale: loc indent: 0];
|
|
||||||
|
if (GSMacOSXCompatiblePropertyLists() == YES)
|
||||||
|
{
|
||||||
|
extern NSString *GSXMLPlMake(id obj, NSDictionary *loc);
|
||||||
|
|
||||||
|
desc = GSXMLPlMake(self, loc);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NSMutableString *result;
|
||||||
|
|
||||||
|
result = AUTORELEASE([[NSMutableString alloc] initWithCapacity:
|
||||||
|
20*[self count]]);
|
||||||
|
[self descriptionWithLocale: loc
|
||||||
|
indent: 0
|
||||||
|
to: (id<GNUDescriptionDestination>)result];
|
||||||
|
desc = result;
|
||||||
|
}
|
||||||
|
|
||||||
return [desc writeToURL: url atomically: useAuxiliaryFile];
|
return [desc writeToURL: url atomically: useAuxiliaryFile];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue