Improve code readability with dictionary literals.

This commit is contained in:
Alexander Ljungberg
2013-02-25 17:02:36 +00:00
parent 472848da91
commit 8bcbeb0aa9
43 changed files with 88 additions and 86 deletions
+1 -1
View File
@@ -1358,7 +1358,7 @@ var _CPAppBootstrapperActions = nil;
if (mainCibFile)
{
[mainBundle loadCibFile:mainCibFile
externalNameTable:[CPDictionary dictionaryWithObject:CPApp forKey:CPCibOwner]
externalNameTable:@{ CPCibOwner: CPApp }
loadDelegate:self];
return YES;
+2 -2
View File
@@ -73,11 +73,11 @@
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithJSObject:{
return @{
@"image-control-resize": [CPNull null],
@"image-control-leaf": [CPNull null],
@"image-control-leaf-pressed": [CPNull null]
}];
};
}
- (id)initWithFrame:(CGRect)aFrame
+1 -1
View File
@@ -129,7 +129,7 @@ var CPDocumentUntitledCount = 0;
if (self)
{
_windowControllers = [];
_viewControllersForWindowControllers = [CPDictionary dictionary];
_viewControllersForWindowControllers = @{};
_hasUndoManager = YES;
_changeCount = 0;
+1 -1
View File
@@ -148,7 +148,7 @@ var CPSharedDocumentController = nil;
{
var type = [self typeForContentsOfURL:anAbsoluteURL error:anError];
result = [self makeDocumentWithContentsOfURL:anAbsoluteURL ofType:type delegate:self didReadSelector:@selector(document:didRead:contextInfo:) contextInfo:[CPDictionary dictionaryWithObject:shouldDisplay forKey:@"shouldDisplay"]];
result = [self makeDocumentWithContentsOfURL:anAbsoluteURL ofType:type delegate:self didReadSelector:@selector(document:didRead:contextInfo:) contextInfo:@{ @"shouldDisplay": shouldDisplay }];
[self addDocument:result];
+1 -1
View File
@@ -248,7 +248,7 @@ var CPDraggingSource_draggedImage_movedTo_ = 1 << 0,
_draggingUpdateTimer = [CPTimer scheduledTimerWithTimeInterval:CPDragServerPeriodicUpdateInterval
target:self
selector:@selector(_sendPeriodicDraggingUpdate:)
userInfo:[CPDictionary dictionaryWithJSObject:{platformWindow:aPlatformWindow, location:aLocation}]
userInfo:@{ "platformWindow":aPlatformWindow, "location":aLocation }
repeats:NO];
var scrollView = [_draggingDestination isKindOfClass:[CPView class]] ? [_draggingDestination enclosingScrollView] : nil;
+2 -2
View File
@@ -107,7 +107,7 @@ var IEFlashCLSID = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
varString = [varString stringByAppendingFormat:@"&%@=%@", key, [aDictionary objectForKey:key]];
if (!_params)
_params = [CPDictionary dictionary];
_params = @{};
[_params setObject:varString forKey:@"flashvars"];
[self setParameters:_params];
@@ -137,7 +137,7 @@ var IEFlashCLSID = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
#if PLATFORM(DOM)
if (!CPBrowserIsEngine(CPInternetExplorerBrowserEngine))
{
_paramElements = [CPDictionary dictionary];
_paramElements = @{};
var enumerator = [_params keyEnumerator],
key;
+1 -1
View File
@@ -208,7 +208,7 @@ var CPSharedFontManager = nil,
- (@action)addFontTrait:(id)sender
{
_activeChange = [CPDictionary dictionaryWithObject:[sender tag] forKey:@"addTraits"];
_activeChange = @{ @"addTraits": [sender tag] };
[self sendAction];
}
+3 -3
View File
@@ -32,8 +32,8 @@
@class CPButton
var exposedBindingsMap = [CPDictionary new],
bindingsMap = [CPDictionary new];
var exposedBindingsMap = @{},
bindingsMap = @{};
var CPBindingOperationAnd = 0,
CPBindingOperationOr = 1;
@@ -145,7 +145,7 @@ var CPBindingOperationAnd = 0,
if (!bindings)
{
bindings = [CPDictionary new];
bindings = @{};
[bindingsMap setObject:bindings forKey:[_source UID]];
}
+1 -1
View File
@@ -77,7 +77,7 @@ var _CPMenuBarVisible = NO,
if (self !== [CPMenu class])
return;
[[self class] setMenuBarAttributes:[CPDictionary dictionary]];
[[self class] setMenuBarAttributes:@{}];
}
+ (BOOL)menuBarVisible
+1 -1
View File
@@ -667,7 +667,7 @@ var CPObjectControllerContentKey = @"CPObjectControllerCo
{
if (self = [super init])
{
_cachedValues = [CPDictionary dictionary];
_cachedValues = @{};
_observationProxies = [CPArray array];
_controller = aController;
_observedObjectsByKeyPath = {};
+1 -1
View File
@@ -1441,7 +1441,7 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0,
[[CPNotificationCenter defaultCenter]
postNotificationName:CPOutlineViewItemWillExpandNotification
object:self
userInfo:[CPDictionary dictionaryWithObject:item forKey:"CPObject"]];
userInfo:@{ "CPObject": item }];
}
/*!
+5 -5
View File
@@ -79,7 +79,7 @@ var CPPasteboards = nil,
[self setVersion:1.0];
CPPasteboards = [CPDictionary dictionary];
CPPasteboards = @{};
if (typeof window.cpPasteboardWithName !== "undefined")
supportsNativePasteboard = YES;
@@ -121,8 +121,8 @@ var CPPasteboards = nil,
// _name = aName;
_types = [];
_owners = [CPDictionary dictionary];
_provided = [CPDictionary dictionary];
_owners = @{};
_provided = @{};
_changeCount = 0;
@@ -188,8 +188,8 @@ var CPPasteboards = nil,
{
[_types setArray:types];
_owners = [CPDictionary dictionary];
_provided = [CPDictionary dictionary];
_owners = @{};
_provided = @{};
var count = _types.length;
+2 -2
View File
@@ -791,7 +791,7 @@ TODO: implement
*/
- (CPPredicate)predicateForRow:(CPInteger)aRow
{
var predicateParts = [CPDictionary dictionary],
var predicateParts = @{},
items = [self criteriaForRow:aRow],
count = [items count],
predicate,
@@ -1771,7 +1771,7 @@ TODO: implement
if (animate)
{
var animation = [CPDictionary dictionary];
var animation = @{};
[animation setObject:aslice forKey:CPViewAnimationTargetKey];
[animation setObject:startRect forKey:CPViewAnimationStartFrameKey];
[animation setObject:targetRect forKey:CPViewAnimationEndFrameKey];
+1 -1
View File
@@ -59,7 +59,7 @@ var LocalizerStringsRegex = new RegExp("\"(.+)\"\\s*=\\s*\"(.+)\"\\s*;\\s*(//.+)
- (void)loadContent:(CPString)aContent
{
var dict = [CPDictionary dictionary],
var dict = @{},
lines = [aContent componentsSeparatedByString:"\n"],
count = [lines count];
+6 -6
View File
@@ -85,7 +85,7 @@ var CPThemesByName = { },
if (self)
{
_name = aName;
_attributes = [CPDictionary dictionary];
_attributes = @{};
CPThemesByName[_name] = self;
}
@@ -270,7 +270,7 @@ var CPThemesByName = { },
if (!attributes)
{
attributes = [CPDictionary dictionary];
attributes = @{};
[_attributes setObject:attributes forKey:aClass];
}
@@ -443,7 +443,7 @@ CPThemeStateKeyWindow = CPThemeState("keyWindow");
_cache = { };
_name = aName;
_defaultValue = aDefaultValue;
_values = [CPDictionary dictionary];
_values = @{};
}
return self;
@@ -474,7 +474,7 @@ CPThemeStateKeyWindow = CPThemeState("keyWindow");
_cache = {};
if (aValue === undefined || aValue === nil)
_values = [CPDictionary dictionary];
_values = @{};
else
_values = [CPDictionary dictionaryWithObject:aValue forKey:String(CPThemeStateNormal)];
}
@@ -585,7 +585,7 @@ CPThemeStateKeyWindow = CPThemeState("keyWindow");
_name = [aCoder decodeObjectForKey:@"name"];
_defaultValue = [aCoder decodeObjectForKey:@"defaultValue"];
_values = [CPDictionary dictionary];
_values = @{};
if ([aCoder containsValueForKey:@"value"])
{
@@ -633,7 +633,7 @@ CPThemeStateKeyWindow = CPThemeState("keyWindow");
}
else
{
var encodedValues = [CPDictionary dictionary];
var encodedValues = @{};
while (count--)
{
+2 -2
View File
@@ -118,8 +118,8 @@ var CPToolbarsByIdentifier = nil,
if (self !== [CPToolbar class])
return;
CPToolbarsByIdentifier = [CPDictionary dictionary];
CPToolbarConfigurationsByIdentifier = [CPDictionary dictionary];
CPToolbarsByIdentifier = @{};
CPToolbarConfigurationsByIdentifier = @{};
}
/* @ignore */
+1 -1
View File
@@ -2821,7 +2821,7 @@ setBoundsOrigin:
- (CPDictionary)_themeAttributeDictionary
{
var dictionary = [CPDictionary dictionary];
var dictionary = @{};
if (_themeAttributes)
{
+1 -1
View File
@@ -85,7 +85,7 @@ var CPViewControllerCachedCibs;
if (self !== [CPViewController class])
return;
CPViewControllerCachedCibs = [CPDictionary dictionary];
CPViewControllerCachedCibs = @{};
}
/*!
+1 -1
View File
@@ -44,7 +44,7 @@ var CAMediaNamedTimingFunctions = nil;
{
if (!CAMediaNamedTimingFunctions)
{
CAMediaNamedTimingFunctions = [CPDictionary dictionary];
CAMediaNamedTimingFunctions = @{};
[CAMediaNamedTimingFunctions setObject:[CAMediaTimingFunction functionWithControlPoints:0.0 :0.0 :1.0 :1.0] forKey:kCAMediaTimingFunctionLinear];
[CAMediaNamedTimingFunctions setObject:[CAMediaTimingFunction functionWithControlPoints:0.42 :0.0 :1.0 :1.0] forKey:kCAMediaTimingFunctionEaseIn];
+1 -1
View File
@@ -110,7 +110,7 @@ var PrimaryPlatformWindow = NULL;
#if PLATFORM(DOM)
_windowLevels = [];
_windowLayers = [CPDictionary dictionary];
_windowLayers = @{};
_charCodes = {};
#endif
+1 -1
View File
@@ -213,7 +213,7 @@ var resizeTimer = nil;
_contentRect = _CGRectMakeZero();
_windowLevels = [];
_windowLayers = [CPDictionary dictionary];
_windowLayers = @{};
[self registerDOMWindow];
[self updateFromNativeContentRect];
+4 -2
View File
@@ -33,8 +33,10 @@
+ (id)themeAttributes
{
return [CPDictionary dictionaryWithObjects:[[CPNull null], [CPNull null]]
forKeys:[@"background-color", @"divider-color"]];
return @{
@"background-color": [CPNull null],
@"divider-color": [CPNull null],
};
}
- (void)drawRect:(CGRect)aRect
+1 -1
View File
@@ -89,7 +89,7 @@
if (self)
{
if (!attributes)
attributes = [CPDictionary dictionary];
attributes = @{};
_string = ""+aString;
_rangeEntries = [makeRangeEntry(CPMakeRange(0, _string.length), attributes)];
+1 -1
View File
@@ -144,7 +144,7 @@ var CPObjectAccessorsForClassKey = @"$CPObjectAccessorsForClassKey",
{
var index = 0,
count = keys.length,
dictionary = [CPDictionary dictionary];
dictionary = @{};
for (; index < count; ++index)
{
+1 -1
View File
@@ -755,7 +755,7 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOpti
if (!observers)
{
observers = [CPDictionary dictionary];
observers = @{};
_observersForKey[aPath] = observers;
_observersForKeyLength++;
}
+10 -10
View File
@@ -172,12 +172,12 @@ var _CPKeyedArchiverStringClass = Nil,
_objects = [];
_UIDs = [CPDictionary dictionary];
_conditionalUIDs = [CPDictionary dictionary];
_UIDs = @{};
_conditionalUIDs = @{};
_replacementObjects = [CPDictionary dictionary];
_replacementObjects = @{};
_plistObject = [CPDictionary dictionary];
_plistObject = @{};
_plistObjects = [CPArray arrayWithObject:_CPKeyedArchiverNullString];
}
@@ -212,7 +212,7 @@ var _CPKeyedArchiverStringClass = Nil,
[_delegate archiver:self didEncodeObject:object];
}
_plistObject = [CPDictionary dictionary];
_plistObject = @{};
[_plistObject setObject:topObject forKey:_CPKeyedArchiverTopKey];
[_plistObject setObject:_plistObjects forKey:_CPKeyedArchiverObjectsKey];
@@ -395,7 +395,7 @@ var _CPKeyedArchiverStringClass = Nil,
{
var key,
keys = [aDictionary keyEnumerator],
references = [CPDictionary dictionary];
references = @{};
while ((key = [keys nextObject]) !== nil)
[references setObject:_CPKeyedArchiverEncodeObject(self, [aDictionary objectForKey:key], NO) forKey:key];
@@ -414,7 +414,7 @@ var _CPKeyedArchiverStringClass = Nil,
+ (void)setClassName:(CPString)aClassName forClass:(Class)aClass
{
if (!CPArchiverReplacementClassNames)
CPArchiverReplacementClassNames = [CPDictionary dictionary];
CPArchiverReplacementClassNames = @{};
[CPArchiverReplacementClassNames setObject:aClassName forKey:CPStringFromClass(aClass)];
}
@@ -446,7 +446,7 @@ var _CPKeyedArchiverStringClass = Nil,
- (void)setClassName:(CPString)aClassName forClass:(Class)aClass
{
if (!_replacementClassNames)
_replacementClassNames = [CPDictionary dictionary];
_replacementClassNames = @{};
[_replacementClassNames setObject:aClassName forKey:CPStringFromClass(aClass)];
}
@@ -541,7 +541,7 @@ var _CPKeyedArchiverEncodeObject = function(self, anObject, isConditional)
else
{
// Only actually encode the object and create a plist representation if it is not a simple type.
plistObject = [CPDictionary dictionary];
plistObject = @{};
[self._objects addObject:object];
@@ -559,7 +559,7 @@ var _CPKeyedArchiverEncodeObject = function(self, anObject, isConditional)
if (!classUID)
{
var plistClass = [CPDictionary dictionary],
var plistClass = @{},
hierarchy = [];
[plistClass setObject:className forKey:_CPKeyedArchiverClassNameKey];
+2 -2
View File
@@ -65,7 +65,7 @@ var CPNotificationDefaultCenter = nil;
if (self)
{
_namedRegistries = [CPDictionary dictionary];
_namedRegistries = @{};
_unnamedRegistry = [[_CPNotificationRegistry alloc] init];
}
return self;
@@ -189,7 +189,7 @@ var _CPNotificationCenterPostNotification = function(/* CPNotificationCenter */
if (self)
{
_objectObservers = [CPDictionary dictionary];
_objectObservers = @{};
}
return self;
+1 -1
View File
@@ -77,7 +77,7 @@
_HTTPBody = @"";
_HTTPMethod = @"GET";
_HTTPHeaderFields = [CPDictionary dictionary];
_HTTPHeaderFields = @{};
[self setValue:"Thu, 01 Jan 1970 00:00:00 GMT" forHTTPHeaderField:"If-Modified-Since"];
[self setValue:"no-cache" forHTTPHeaderField:"Cache-Control"];
+4 -4
View File
@@ -105,12 +105,12 @@ var StandardUserDefaults;
if (self)
{
_domains = [CPDictionary dictionary];
_domains = @{};
[self _setupArgumentsDomain];
var defaultStore = [CPUserDefaultsLocalStore supportsLocalStorage] ? CPUserDefaultsLocalStore : CPUserDefaultsCookieStore;
_stores = [CPDictionary dictionary];
_stores = @{};
[self setPersistentStoreClass:defaultStore forDomain:CPGlobalDomain reloadData:YES];
[self setPersistentStoreClass:defaultStore forDomain:CPApplicationDomain reloadData:YES];
}
@@ -182,7 +182,7 @@ var StandardUserDefaults;
var domain = [_domains objectForKey:aDomain];
if (!domain)
{
domain = [CPDictionary dictionary];
domain = @{};
[_domains setObject:domain forKey:aDomain];
}
@@ -264,7 +264,7 @@ var StandardUserDefaults;
count = [dicts count],
i = 0;
_searchList = [CPDictionary dictionary];
_searchList = @{};
for (; i < count; i++)
{
+1 -1
View File
@@ -31,7 +31,7 @@
@import "CPNumber.j"
@import "CPObject.j"
var transformerMap = [CPDictionary dictionary];
var transformerMap = @{};
@implementation CPValueTransformer : CPObject
{
+3 -3
View File
@@ -65,7 +65,7 @@ CPWebDAVManagerNonCollectionResourceType = 0;
self = [super init];
if (self)
_blocksForConnections = [CPDictionary dictionary];
_blocksForConnections = @{};
return self;
}
@@ -198,7 +198,7 @@ var parsePROPFINDResponse = function(anXMLString)
responses = XMLDocument.getElementsByTagNameNS("*", "response"),
responseIndex = 0,
responseCount = responses.length,
propertiesForURLs = [CPDictionary dictionary];
propertiesForURLs = @{};
for (; responseIndex < responseCount; ++responseIndex)
{
@@ -206,7 +206,7 @@ var parsePROPFINDResponse = function(anXMLString)
elements = response.getElementsByTagNameNS("*", "prop").item(0).childNodes,
index = 0,
count = elements.length,
properties = [CPDictionary dictionary];
properties = @{};
for (; index < count; ++index)
{
+1 -1
View File
@@ -49,7 +49,7 @@
var bindTesterA = [BindingTestWithBool new],
bindTesterB = [BindingTestWithBool new];
[bindTesterB bind:@"stringValue" toObject:bindTesterA withKeyPath:@"stringValue" options:[CPDictionary dictionary]];
[bindTesterB bind:@"stringValue" toObject:bindTesterA withKeyPath:@"stringValue" options:@{}];
[self assert:nil equals:[bindTesterA stringValue] message:"initial A value unchanged"];
[self assert:nil equals:[bindTesterB stringValue] message:"initial B value unchanged"];
+2 -2
View File
@@ -165,7 +165,7 @@
- (void)testBindingSelectedTag
{
var dict = [CPDictionary dictionary],
var dict = @{},
item = nil;
item = [[CPMenuItem alloc] initWithTitle:@"Mouse" action:nil keyEquivalent:nil];
@@ -412,7 +412,7 @@
[arrayController setContent:menuObjects];
[button bind:CPContentBinding toObject:arrayController withKeyPath:@"arrangedObjects" options:nil];
var options = [CPDictionary dictionary];
var options = @{};
[options setObject:[ContentValuesTransformer new] forKey:CPValueTransformerBindingOption];
[button bind:CPContentValuesBinding toObject:arrayController withKeyPath:@"arrangedObjects.name" options:options];
+2 -2
View File
@@ -55,7 +55,7 @@ var sharedObject = [CPObject new];
- (void)testIinitWithString_attributes
{
var string = [[CPAttributedString alloc] initWithString:@"hi there" attributes:[CPDictionary dictionary]];
var string = [[CPAttributedString alloc] initWithString:@"hi there" attributes:@{}];
[self assertTrue:([string string] === @"hi there")
message:"testIinitWithString_attributes: expected:" + @"hi there" + " actual:" + [string string]];
@@ -370,7 +370,7 @@ var sharedObject = [CPObject new];
{
var string = [self stringForTesting];
[string setAttributes:[CPDictionary dictionary] range:CPMakeRange(0, [string length])];
[string setAttributes:@{} range:CPMakeRange(0, [string length])];
testAttributesAtIndexWithValues(string, 10, {a:undefined, b:undefined, c:undefined, d:undefined, e:undefined, f:undefined}, self);
+1 -1
View File
@@ -352,7 +352,7 @@
- (void)testEnumerateKeysAndObjectsUsingBlock_
{
var input0 = [CPDictionary dictionary],
var input0 = @{},
input1 = [CPDictionary dictionaryWithJSObject:{a: 1, b: 3, c: "b"}],
output = [CPMutableDictionary dictionary],
outputFunction = function(aKey, anObject)
+2 -2
View File
@@ -454,14 +454,14 @@ var accessIVARS = YES;
- (void)testIfValueForKeyAccessesObjectForKey
{
var testDictionary = [CPDictionary dictionary];
var testDictionary = @{};
[testDictionary setObject:kvcTestObject forKey:@"testKey"];
[self assert: kvcTestObject same: [testDictionary valueForKey: @"testKey"]];
}
- (void)testIfSetValueForKeyModifiesObjectForKey
{
var testDictionary = [CPDictionary dictionary];
var testDictionary = @{};
[testDictionary setValue:kvcTestObject forKey:@"testKey"];
[self assert: kvcTestObject same: [testDictionary objectForKey: @"testKey"]];
}
@@ -96,14 +96,14 @@ CPLogRegister(CPLogConsole);
[totalCountField bind:CPValueBinding toObject:arrayController
withKeyPath:@"selectedObjects.@sum.price" options:nil];
var bindingOptions = [CPDictionary dictionary];
var bindingOptions = @{};
//[bindingOptions setObject:@"No Name" forKey:@"NSNullPlaceholder"];
[selectedNameField bind:CPValueBinding toObject:arrayController
withKeyPath:@"selection.name" options:bindingOptions];
// binding for "name" column
var tableColumn = [tableView tableColumnWithIdentifier:@"name"],
bindingOptions = [CPDictionary dictionary];
bindingOptions = @{};
[tableColumn bind:CPValueBinding toObject:arrayController
withKeyPath:@"arrangedObjects.name" options:bindingOptions];
@@ -111,7 +111,7 @@ CPLogRegister(CPLogConsole);
// binding options for "price"
// no need for placeholder as overridden by formatters
bindingOptions = [CPDictionary dictionary];
bindingOptions = @{};
//[bindingOptions removeObjectForKey:@"NSNullPlaceholder"];
//[bindingOptions setObject:YES
// forKey:CPValidatesImmediatelyBindingOption];
@@ -120,7 +120,7 @@ CPLogRegister(CPLogConsole);
// binding for "price" column
tableColumn = [tableView tableColumnWithIdentifier:@"price"];
bindingOptions = [CPDictionary dictionary];
bindingOptions = @{};
[tableColumn bind:CPValueBinding toObject:arrayController
withKeyPath:@"arrangedObjects.price" options:bindingOptions];
+2 -2
View File
@@ -25,11 +25,11 @@
// note:
// if both flashParams and flashVars are used flashParams must be setup first
var flashParameters = [CPDictionary dictionary];
var flashParameters = @{};
[flashVars setObject:@"SampleParam" forKey:"SampleParamKey"];
[flashView setParameters:flashParameters];
var flashVars = [CPDictionary dictionary];
var flashVars = @{};
[flashVars setObject:@"SampleVar" forKey:"SampleVarKey"];
[flashView setFlashVars:flashVars];
@@ -91,8 +91,8 @@ var CPRuleEditorCustomControlClass = @"CPRuleEditorCustomControlClass";
control = [[custom_class alloc] initWithFrame:CGRectMake(0, 0, 100, 18)];
[criterion setObject:control forKey:("control_"+row)];
}
return control;
return control;
}
return [criterion objectForKey:@"valeur"];
@@ -100,7 +100,7 @@ var CPRuleEditorCustomControlClass = @"CPRuleEditorCustomControlClass";
- (CPDictionary)ruleEditor:(CPRuleEditor)editor predicatePartsForCriterion:(id)criterion withDisplayValue:(id)value inRow:(int)row
{
var predicatePartsForCriterion = [CPDictionary dictionary];
var predicatePartsForCriterion = @{};
if ([editor rowTypeForRow:row] == CPRuleEditorRowTypeCompound)
{
+1 -1
View File
@@ -494,7 +494,7 @@ SCKit = (function() {
if (argsArray.length === 0)
return template;
argsDict = [CPDictionary dictionary];
argsDict = @{};
for (var i = 0; i < argsArray.length; ++i)
[argsDict setObject:argsArray[i] forKey:String(i, 10)];
+3 -3
View File
@@ -24,7 +24,7 @@ var DefaultDictionary = nil,
if (self !== [Configuration class])
return;
DefaultDictionary = [CPDictionary dictionary];
DefaultDictionary = @{};
[DefaultDictionary setObject:@"You" forKey:@"user.name"];
[DefaultDictionary setObject:@"you@yourcompany.com" forKey:@"user.email"];
@@ -63,14 +63,14 @@ var DefaultDictionary = nil,
if (self)
{
path = aPath;
temporaryDictionary = [CPDictionary dictionary];
temporaryDictionary = @{};
if (path && FILE.isReadable(path))
dictionary = CFPropertyList.readPropertyListFromFile(path);
// readPlist will return nil if the file is empty
if (!dictionary)
dictionary = [CPDictionary dictionary];
dictionary = @{};
}
return self;
+1 -1
View File
@@ -132,7 +132,7 @@ var NSTransformers = [CPSet setWithObjects:
_binding = [aCoder decodeObjectForKey:@"NSBinding"];
_keyPath = [aCoder decodeObjectForKey:@"NSKeyPath"];
_options = [CPDictionary dictionary];
_options = @{};
var NSOptions = [aCoder decodeObjectForKey:@"NSOptions"],
keyEnumerator = [NSOptions keyEnumerator],
+2 -2
View File
@@ -67,7 +67,7 @@ var FILE = require("file"),
nibInfo = {};
appDirectory = @"";
resourcesDirectory = @"";
infoPlist = [CPDictionary dictionary];
infoPlist = @{};
userNSClasses = [];
}
@@ -139,7 +139,7 @@ var FILE = require("file"),
[CPFont setSystemFontSize:parseFloat(systemFontSize, 10)];
}
else
infoPlist = [CPDictionary dictionary];
infoPlist = @{};
var themeList = [self getThemeList:options],
themes = [self loadThemesFromList:themeList];