diff options
author | Max <post@wickenrode.com> | 2014-12-13 19:48:41 +0100 |
---|---|---|
committer | Max <post@wickenrode.com> | 2014-12-13 19:48:41 +0100 |
commit | 3b251b8e3d4dc9a694ef76562b388ab07da54785 (patch) | |
tree | 8ce5a4c4c637bab883ed7e6667bff7b5b74adbc3 /Source/SPTablesList.m | |
parent | 876dde21d97897ad4ee98aa0d6b11898282982ce (diff) | |
download | sequelpro-3b251b8e3d4dc9a694ef76562b388ab07da54785.tar.gz sequelpro-3b251b8e3d4dc9a694ef76562b388ab07da54785.tar.bz2 sequelpro-3b251b8e3d4dc9a694ef76562b388ab07da54785.zip |
Replace some NSDictionaries with literals
* [NSDictionary dictionary] → @{}
* [NSDictionary dictionaryWithObject:forKey:] can safely be replaced. object==nil would have already thrown a NPE in the past.
* Also replaced some (hopefully safe) NSArray initializers (ie. their objects should always exist).
Diffstat (limited to 'Source/SPTablesList.m')
-rw-r--r-- | Source/SPTablesList.m | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m index 8d455b58..952d4868 100644 --- a/Source/SPTablesList.m +++ b/Source/SPTablesList.m @@ -168,7 +168,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; object:tableDocumentInstance]; #ifndef SP_CODA - [tablesListView registerForDraggedTypes:[NSArray arrayWithObjects:SPNavigatorTableDataPasteboardDragType, nil]]; + [tablesListView registerForDraggedTypes:@[SPNavigatorTableDataPasteboardDragType]]; #endif //create the charset helper @@ -360,7 +360,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:nil]; else // User press refresh button ergo force update - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", @YES, @"cancelQuerying", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:@{@"forceUpdate" : @YES, @"cancelQuerying" : @YES}]; } /** @@ -704,13 +704,13 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; - (void)_duplicateConnectionToFrontTab { // Get the state of the document - NSDictionary *allStateDetails = [NSDictionary dictionaryWithObjectsAndKeys: - @YES, @"connection", - @YES, @"history", - @YES, @"session", - @YES, @"query", - @YES, @"password", - nil]; + NSDictionary *allStateDetails = @{ + @"connection" : @YES, + @"history" : @YES, + @"session" : @YES, + @"query" : @YES, + @"password" : @YES + }; NSMutableDictionary *documentState = [NSMutableDictionary dictionaryWithDictionary:[tableDocumentInstance stateIncludingDetails:allStateDetails]]; // Ensure it's set to autoconnect @@ -1621,7 +1621,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; #endif // Query the structure of all databases in the background (mainly for completion) - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:@{@"forceUpdate" : @YES}]; } #ifndef SP_CODA @@ -2276,10 +2276,10 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; #endif // Query the structure of all databases in the background (mainly for completion) - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" - target:[tableDocumentInstance databaseStructureRetrieval] - selector:@selector(queryDbStructureWithUserInfo:) - object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" + target:[tableDocumentInstance databaseStructureRetrieval] + selector:@selector(queryDbStructureWithUserInfo:) + object:@{@"forceUpdate" : @YES}]; } #ifndef SP_CODA /* operations performed on whole tables */ @@ -2428,9 +2428,9 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; // Query the structure of all databases in the background (mainly for completion) [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" - target:[tableDocumentInstance databaseStructureRetrieval] + target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) - object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; + object:@{@"forceUpdate" : @YES}]; } else { // Error while creating new table @@ -2637,7 +2637,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; [tableDocumentInstance loadTable:selectedTableName ofType:selectedTableType]; // Query the structure of all databases in the background (mainly for completion) - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:@{@"forceUpdate" : @YES}]; } } } |