diff options
author | Max <post@wickenrode.com> | 2014-12-13 03:12:41 +0100 |
---|---|---|
committer | Max <post@wickenrode.com> | 2014-12-13 03:44:31 +0100 |
commit | 3cf0254e55d558565775e6cb20d36ea7e54beca1 (patch) | |
tree | 38842cf51bdfd2b28c74dba86646bc6523c767fc /Source | |
parent | 4ad26db45b46d8267fcb5203571b81bc8949b853 (diff) | |
download | sequelpro-3cf0254e55d558565775e6cb20d36ea7e54beca1.tar.gz sequelpro-3cf0254e55d558565775e6cb20d36ea7e54beca1.tar.bz2 sequelpro-3cf0254e55d558565775e6cb20d36ea7e54beca1.zip |
Replace boxed integers in code with @ literals
Diffstat (limited to 'Source')
-rw-r--r-- | Source/GeneratePreviewForURL.m | 2 | ||||
-rw-r--r-- | Source/MGTemplateStandardMarkers.m | 2 | ||||
-rw-r--r-- | Source/SPAppController.m | 12 | ||||
-rw-r--r-- | Source/SPConnectionController.m | 4 | ||||
-rw-r--r-- | Source/SPContentFilterManager.m | 2 | ||||
-rw-r--r-- | Source/SPCustomQuery.m | 14 | ||||
-rw-r--r-- | Source/SPDatabaseDocument.m | 18 | ||||
-rw-r--r-- | Source/SPFieldMapperController.m | 10 | ||||
-rw-r--r-- | Source/SPNavigatorController.m | 20 | ||||
-rw-r--r-- | Source/SPPreferencesUpgrade.m | 8 | ||||
-rw-r--r-- | Source/SPPrintController.m | 2 | ||||
-rw-r--r-- | Source/SPQueryFavoriteManager.m | 2 | ||||
-rw-r--r-- | Source/SPTableContent.m | 14 | ||||
-rw-r--r-- | Source/SPTableData.m | 4 | ||||
-rw-r--r-- | Source/SPTableInfo.m | 4 | ||||
-rw-r--r-- | Source/SPTableStructure.m | 4 | ||||
-rw-r--r-- | Source/SPTableStructureDelegate.m | 6 | ||||
-rw-r--r-- | Source/SPTableStructureLoading.m | 2 |
18 files changed, 65 insertions, 65 deletions
diff --git a/Source/GeneratePreviewForURL.m b/Source/GeneratePreviewForURL.m index 2e0fc0cb..034d7bd1 100644 --- a/Source/GeneratePreviewForURL.m +++ b/Source/GeneratePreviewForURL.m @@ -488,7 +488,7 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, imgProps = [[NSMutableDictionary alloc] initWithCapacity:2]; [props setObject:[NSNumber numberWithInteger:previewHeight] forKey:(NSString *)kQLPreviewPropertyHeightKey]; - [props setObject:[NSNumber numberWithInt:600] forKey:(NSString *)kQLPreviewPropertyWidthKey]; + [props setObject:@600 forKey:(NSString *) kQLPreviewPropertyWidthKey]; if(image) { [imgProps setObject:@"image/tiff" forKey:(NSString *)kQLPreviewPropertyMIMETypeKey]; diff --git a/Source/MGTemplateStandardMarkers.m b/Source/MGTemplateStandardMarkers.m index db765aef..543d16a7 100644 --- a/Source/MGTemplateStandardMarkers.m +++ b/Source/MGTemplateStandardMarkers.m @@ -522,7 +522,7 @@ } else { // New cycle. Create and output appropriately. cycle = [NSMutableDictionary dictionaryWithCapacity:2]; - [cycle setObject:[NSNumber numberWithInteger:0] forKey:CYCLE_INDEX]; + [cycle setObject:@0 forKey:CYCLE_INDEX]; [cycle setObject:args forKey:CYCLE_VALUES]; [cycles setObject:cycle forKey:rangeKey]; return [args objectAtIndex:0]; diff --git a/Source/SPAppController.m b/Source/SPAppController.m index 44f3513d..ba9c6cab 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -1243,12 +1243,12 @@ SPDatabaseDocument* frontMostDoc = [self frontDocument]; if(frontMostDoc) { if([runningActivitiesArray count] || [[frontMostDoc runningActivities] count]) - [frontMostDoc performSelector:@selector(setActivityPaneHidden:) withObject:[NSNumber numberWithInteger:0] afterDelay:1.0]; + [frontMostDoc performSelector:@selector(setActivityPaneHidden:) withObject:@0 afterDelay:1.0]; else { [NSObject cancelPreviousPerformRequestsWithTarget:frontMostDoc selector:@selector(setActivityPaneHidden:) - object:[NSNumber numberWithInteger:0]]; - [frontMostDoc setActivityPaneHidden:[NSNumber numberWithInteger:1]]; + object:@0]; + [frontMostDoc setActivityPaneHidden:@1]; } } @@ -1268,12 +1268,12 @@ SPDatabaseDocument* frontMostDoc = [self frontDocument]; if(frontMostDoc) { if([runningActivitiesArray count] || [[frontMostDoc runningActivities] count]) - [frontMostDoc performSelector:@selector(setActivityPaneHidden:) withObject:[NSNumber numberWithInteger:0] afterDelay:1.0]; + [frontMostDoc performSelector:@selector(setActivityPaneHidden:) withObject:@0 afterDelay:1.0]; else { [NSObject cancelPreviousPerformRequestsWithTarget:frontMostDoc selector:@selector(setActivityPaneHidden:) - object:[NSNumber numberWithInteger:0]]; - [frontMostDoc setActivityPaneHidden:[NSNumber numberWithInteger:1]]; + object:@0]; + [frontMostDoc setActivityPaneHidden:@1]; } } } diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index a91f6929..905975dc 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -781,11 +781,11 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, NSArray *objects = [NSArray arrayWithObjects: NSLocalizedString(@"New Favorite", @"new favorite name"), - [NSNumber numberWithInteger:0], + @0, @"", @"", @"", - [NSNumber numberWithInteger:-1], + @(-1), @"", [NSNumber numberWithInt:NSOffState], [NSNumber numberWithInt:NSOffState], diff --git a/Source/SPContentFilterManager.m b/Source/SPContentFilterManager.m index 9fe255ef..c08e84b9 100644 --- a/Source/SPContentFilterManager.m +++ b/Source/SPContentFilterManager.m @@ -929,7 +929,7 @@ static NSString *SPExportFilterAction = @"SPExportFilter"; NSMutableArray *filterData = [NSMutableArray array]; - [spfdata setObject:[NSNumber numberWithInteger:1] forKey:@"version"]; + [spfdata setObject:@1 forKey:@"version"]; [spfdata setObject:@"content filters" forKey:@"format"]; [spfdata setObject:@NO forKey:@"encrypted"]; diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index acfe7eac..ba053dbf 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -1808,7 +1808,7 @@ NSDictionary *columnDefinition = [NSDictionary dictionaryWithDictionary:[cqColumnDefinition objectAtIndex:[[[[customQueryView tableColumns] objectAtIndex:columnIndex] identifier] integerValue]]]; if(!columnDefinition) - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-2], @"", nil]; + return [NSArray arrayWithObjects:@(-2), @"", nil]; // Resolve the original table name for current column if AS was used NSString *tableForColumn = [columnDefinition objectForKey:@"org_table"]; @@ -1819,13 +1819,13 @@ // No table/database name found indicates that the field's column contains data from more than one table as for UNION // or the field data are not bound to any table as in SELECT 1 or if column database is unset if(!tableForColumn || ![tableForColumn length] || !dbForColumn || ![dbForColumn length]) - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; // if table and database name are given check if field can be identified unambiguously // first without blob data NSString *fieldIDQueryStr = [self argumentForRow:rowIndex ofTable:tableForColumn andDatabase:[columnDefinition objectForKey:@"db"] includeBlobs:NO]; if(!fieldIDQueryStr) - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; [tableDocumentInstance startTaskWithDescription:NSLocalizedString(@"Checking field data for editing...", @"checking field data for editing task description")]; @@ -1837,7 +1837,7 @@ if ([mySQLConnection queryErrored]) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; } NSArray *tempRow = [tempResult getRowAsArray]; @@ -1847,7 +1847,7 @@ fieldIDQueryStr = [self argumentForRow:rowIndex ofTable:tableForColumn andDatabase:[columnDefinition objectForKey:@"db"] includeBlobs:YES]; if(!fieldIDQueryStr) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; } tempResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SELECT COUNT(1) FROM %@.%@ %@", @@ -1857,14 +1857,14 @@ if ([mySQLConnection queryErrored]) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; } tempRow = [tempResult getRowAsArray]; if([tempRow count] && [[tempRow objectAtIndex:0] integerValue] < 1) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; } } diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 4f09b3a8..a377a8ec 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -330,7 +330,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [tableTabView setTabViewType:NSNoTabsNoBorder]; // Hide the activity list - [self setActivityPaneHidden:[NSNumber numberWithInteger:1]]; + [self setActivityPaneHidden:@1]; // Load additional nibs, keeping track of the top-level objects to allow correct release NSArray *connectionDialogTopLevelObjects = nil; @@ -3114,7 +3114,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [info setObject:[NSNumber numberWithBool:[[spfDocData_temp objectForKey:@"save_password"] boolValue]] forKey:@"save_password"]; [info setObject:[NSNumber numberWithBool:[[spfDocData_temp objectForKey:@"include_session"] boolValue]] forKey:@"include_session"]; [info setObject:[NSNumber numberWithBool:[[spfDocData_temp objectForKey:@"save_editor_content"] boolValue]] forKey:@"save_editor_content"]; - [info setObject:[NSNumber numberWithInteger:1] forKey:@"version"]; + [info setObject:@1 forKey:@"version"]; [info setObject:@"connection bundle" forKey:@"format"]; // Loop through all windows @@ -3323,7 +3323,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; NSMutableDictionary *spfData = [NSMutableDictionary dictionary]; // Add basic details - [spfStructure setObject:[NSNumber numberWithInteger:1] forKey:@"version"]; + [spfStructure setObject:@1 forKey:@"version"]; [spfStructure setObject:@"connection" forKey:@"format"]; [spfStructure setObject:@"mysql" forKey:@"rdbms_type"]; if([self mySQLVersion]) @@ -5592,12 +5592,12 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:SPActivitiesUpdateNotification object:self]; if([runningActivitiesArray count] || [[[NSApp delegate] runningActivities] count]) - [self performSelector:@selector(setActivityPaneHidden:) withObject:[NSNumber numberWithInteger:0] afterDelay:1.0]; + [self performSelector:@selector(setActivityPaneHidden:) withObject:@0 afterDelay:1.0]; else { [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(setActivityPaneHidden:) - object:[NSNumber numberWithInteger:0]]; - [self setActivityPaneHidden:[NSNumber numberWithInteger:1]]; + object:@0]; + [self setActivityPaneHidden:@1]; } } @@ -5613,12 +5613,12 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; } if([runningActivitiesArray count] || [[[NSApp delegate] runningActivities] count]) - [self performSelector:@selector(setActivityPaneHidden:) withObject:[NSNumber numberWithInteger:0] afterDelay:1.0]; + [self performSelector:@selector(setActivityPaneHidden:) withObject:@0 afterDelay:1.0]; else { [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(setActivityPaneHidden:) - object:[NSNumber numberWithInteger:0]]; - [self setActivityPaneHidden:[NSNumber numberWithInteger:1]]; + object:@0]; + [self setActivityPaneHidden:@1]; } [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:SPActivitiesUpdateNotification object:self]; diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m index aaa6c0bc..52b799d0 100644 --- a/Source/SPFieldMapperController.m +++ b/Source/SPFieldMapperController.m @@ -83,11 +83,11 @@ static NSUInteger SPSourceColumnTypeInteger = 1; fieldMappingGlobalValuesSQLMarked = [[NSMutableArray alloc] init]; fieldMappingArray = nil; - lastDisabledCSVFieldcolumn = [NSNumber numberWithInteger:0]; + lastDisabledCSVFieldcolumn = @0; - doImport = [NSNumber numberWithInteger:0]; - doNotImport = [NSNumber numberWithInteger:1]; - isEqual = [NSNumber numberWithInteger:2]; + doImport = @0; + doNotImport = @1; + isEqual = @2; doImportString = @"―"; doNotImportString = @" "; isEqualString = @"="; @@ -1936,7 +1936,7 @@ static NSUInteger SPSourceColumnTypeInteger = 1; // If anObject contains $1 etc. enable SQL checkbox if([anObject isMatchedByRegex:@"(?<!\\\\)\\$\\d+"]) - [fieldMappingGlobalValuesSQLMarked replaceObjectAtIndex:(numberOfImportColumns + rowIndex) withObject:[NSNumber numberWithInteger:1]]; + [fieldMappingGlobalValuesSQLMarked replaceObjectAtIndex:(numberOfImportColumns + rowIndex) withObject:@1]; // Store anObject as recent global value if it's new NSMutableArray *recents = [NSMutableArray array]; diff --git a/Source/SPNavigatorController.m b/Source/SPNavigatorController.m index 67070472..379cdc18 100644 --- a/Source/SPNavigatorController.m +++ b/Source/SPNavigatorController.m @@ -547,12 +547,12 @@ static NSComparisonResult compareStrings(NSString *s1, NSString *s2, void* conte } } - if([result count] < 1 ) return [NSArray arrayWithObjects:[NSNumber numberWithInt:0], @"", nil]; + if([result count] < 1 ) return [NSArray arrayWithObjects:@0, @"", nil]; if([result count] == 1) { NSArray *split = [[result objectAtIndex:0] componentsSeparatedByString:SPUniqueSchemaDelimiter]; - if([split count] == 2 ) return [NSArray arrayWithObjects:[NSNumber numberWithInt:1], [split lastObject], nil]; - if([split count] == 3 ) return [NSArray arrayWithObjects:[NSNumber numberWithInt:2], [split lastObject], nil]; - return [NSArray arrayWithObjects:[NSNumber numberWithInt:0], @"", nil]; + if([split count] == 2 ) return [NSArray arrayWithObjects:@1, [split lastObject], nil]; + if([split count] == 3 ) return [NSArray arrayWithObjects:@2, [split lastObject], nil]; + return [NSArray arrayWithObjects:@0, @"", nil]; } // case if field is equal to a table or db name NSMutableArray *arr = [NSMutableArray array]; @@ -560,14 +560,14 @@ static NSComparisonResult compareStrings(NSString *s1, NSString *s2, void* conte if([[item componentsSeparatedByString:SPUniqueSchemaDelimiter] count] < 4) [arr addObject:item]; } - if([arr count] < 1 ) [NSArray arrayWithObjects:[NSNumber numberWithInt:0], @"", nil]; + if([arr count] < 1 ) [NSArray arrayWithObjects:@0, @"", nil]; if([arr count] == 1) { NSArray *split = [[arr objectAtIndex:0] componentsSeparatedByString:SPUniqueSchemaDelimiter]; - if([split count] == 2 ) [NSArray arrayWithObjects:[NSNumber numberWithInt:1], [split lastObject], nil]; - if([split count] == 3 ) [NSArray arrayWithObjects:[NSNumber numberWithInt:2], [split lastObject], nil]; - return [NSArray arrayWithObjects:[NSNumber numberWithInt:0], @"", nil]; + if([split count] == 2 ) [NSArray arrayWithObjects:@1, [split lastObject], nil]; + if([split count] == 3 ) [NSArray arrayWithObjects:@2, [split lastObject], nil]; + return [NSArray arrayWithObjects:@0, @"", nil]; } - return [NSArray arrayWithObjects:[NSNumber numberWithInt:0], @"", nil]; + return [NSArray arrayWithObjects:@0, @"", nil]; } #ifndef SP_CODA @@ -694,7 +694,7 @@ static NSComparisonResult compareStrings(NSString *s1, NSString *s2, void* conte [[[[schemaData objectForKey:connectionID] objectForKey:db_id] objectForKey:table_id] objectForKey:@" struct_type "] forKey:@" struct_type "]; else [[[[structure valueForKey:connectionID] valueForKey:db_id] valueForKey:table_id] setObject: - [NSNumber numberWithInt:0] forKey:@" struct_type "]; + @0 forKey:@" struct_type "]; if([a count] > 3) { NSString *field_id = [NSString stringWithFormat:@"%@%@%@", table_id,SPUniqueSchemaDelimiter,[a objectAtIndex:3]]; diff --git a/Source/SPPreferencesUpgrade.m b/Source/SPPreferencesUpgrade.m index 6151f675..a412088c 100644 --- a/Source/SPPreferencesUpgrade.m +++ b/Source/SPPreferencesUpgrade.m @@ -214,17 +214,17 @@ void SPApplyRevisionChanges(void) if ([[favorite objectForKey:@"host"] isEqualToString:@"localhost"] || ([favorite objectForKey:@"socket"] && [(NSString *)[favorite objectForKey:@"socket"] length])) { - [favorite setObject:[NSNumber numberWithInteger:1] forKey:@"type"]; + [favorite setObject:@1 forKey:@"type"]; // If SSH details are set, set to tunnel connection } else if ([favorite objectForKey:@"useSSH"] && [[favorite objectForKey:@"useSSH"] integerValue]) { - [favorite setObject:[NSNumber numberWithInteger:2] forKey:@"type"]; + [favorite setObject:@2 forKey:@"type"]; // Default to TCP/IP } else { - [favorite setObject:[NSNumber numberWithInteger:0] forKey:@"type"]; + [favorite setObject:@0 forKey:@"type"]; } // Remove SSH tunnel flag - no longer required @@ -311,7 +311,7 @@ void SPApplyRevisionChanges(void) NSNumber *newMappedValue = [encodingMap valueForKey:[prefs objectForKey:SPOldDefaultEncodingKey]]; - if (newMappedValue == nil) newMappedValue = [NSNumber numberWithInt:0]; + if (newMappedValue == nil) newMappedValue = @0; [prefs setObject:newMappedValue forKey:@"DefaultEncodingTag"]; } diff --git a/Source/SPPrintController.m b/Source/SPPrintController.m index 0b8d78c9..70f5662b 100644 --- a/Source/SPPrintController.m +++ b/Source/SPPrintController.m @@ -251,7 +251,7 @@ [printData setObject:indexes forKey:@"indexes"]; [printData setObject:indexColumns forKey:@"indexColumns"]; - if ([indexes count]) [printData setObject:[NSNumber numberWithInteger:1] forKey:@"hasIndexes"]; + if ([indexes count]) [printData setObject:@1 forKey:@"hasIndexes"]; [rows release]; [indexes release]; diff --git a/Source/SPQueryFavoriteManager.m b/Source/SPQueryFavoriteManager.m index a7147646..9f96d98a 100644 --- a/Source/SPQueryFavoriteManager.m +++ b/Source/SPQueryFavoriteManager.m @@ -917,7 +917,7 @@ NSMutableArray *favoriteData = [NSMutableArray array]; - [spfdata setObject:[NSNumber numberWithInteger:1] forKey:@"version"]; + [spfdata setObject:@1 forKey:@"version"]; [spfdata setObject:@"query favorites" forKey:@"format"]; [spfdata setObject:@NO forKey:@"encrypted"]; diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 9e190cb2..ae49c772 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -3333,7 +3333,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper NSDictionary *columnDefinition = [NSDictionary dictionaryWithDictionary:[cqColumnDefinition objectAtIndex:[[[[tableContentView tableColumns] objectAtIndex:columnIndex] identifier] integerValue]]]; if(!columnDefinition) - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-2], @"", nil]; + return [NSArray arrayWithObjects:@(-2), @"", nil]; // Resolve the original table name for current column if AS was used NSString *tableForColumn = [columnDefinition objectForKey:@"org_table"]; @@ -3344,13 +3344,13 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper // No table/database name found indicates that the field's column contains data from more than one table as for UNION // or the field data are not bound to any table as in SELECT 1 or if column database is unset if(!tableForColumn || ![tableForColumn length] || !dbForColumn || ![dbForColumn length]) - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; // if table and database name are given check if field can be identified unambiguously // first without blob data NSString *fieldIDQueryStr = [self argumentForRow:rowIndex ofTable:tableForColumn andDatabase:[columnDefinition objectForKey:@"db"] includeBlobs:NO]; if(!fieldIDQueryStr) - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; [tableDocumentInstance startTaskWithDescription:NSLocalizedString(@"Checking field data for editing...", @"checking field data for editing task description")]; @@ -3362,7 +3362,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper if ([mySQLConnection queryErrored]) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; } NSArray *tempRow = [tempResult getRowAsArray]; @@ -3372,7 +3372,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper fieldIDQueryStr = [self argumentForRow:rowIndex ofTable:tableForColumn andDatabase:[columnDefinition objectForKey:@"db"] includeBlobs:YES]; if(!fieldIDQueryStr) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; } tempResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SELECT COUNT(1) FROM %@.%@ %@", @@ -3382,14 +3382,14 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper if ([mySQLConnection queryErrored]) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; } tempRow = [tempResult getRowAsArray]; if([tempRow count] && [[tempRow objectAtIndex:0] integerValue] < 1) { [tableDocumentInstance endTask]; - return [NSArray arrayWithObjects:[NSNumber numberWithInteger:-1], @"", nil]; + return [NSArray arrayWithObjects:@(-1), @"", nil]; } } diff --git a/Source/SPTableData.m b/Source/SPTableData.m index 00de39da..9d875555 100644 --- a/Source/SPTableData.m +++ b/Source/SPTableData.m @@ -743,7 +743,7 @@ [primaryKeyFields addObject:primaryFieldName]; for (NSMutableDictionary *theTableColumn in tableColumns) { if ([[theTableColumn objectForKey:@"name"] isEqualToString:primaryFieldName]) { - [theTableColumn setObject:[NSNumber numberWithInteger:1] forKey:@"isprimarykey"]; + [theTableColumn setObject:@1 forKey:@"isprimarykey"]; break; } } @@ -761,7 +761,7 @@ NSString *uniqueFieldName = [[SPSQLParser stringWithString:quotedUniqueKey] unquotedString]; for (NSMutableDictionary *theTableColumn in tableColumns) { if ([[theTableColumn objectForKey:@"name"] isEqualToString:uniqueFieldName]) { - [theTableColumn setObject:[NSNumber numberWithInteger:1] forKey:@"unique"]; + [theTableColumn setObject:@1 forKey:@"unique"]; break; } } diff --git a/Source/SPTableInfo.m b/Source/SPTableInfo.m index 38d06b3e..4bed0226 100644 --- a/Source/SPTableInfo.m +++ b/Source/SPTableInfo.m @@ -388,11 +388,11 @@ if (rowIndex > 0) return NO; if (![tableInfoScrollView isHidden]) { - [tableDocumentInstance setActivityPaneHidden:[NSNumber numberWithInteger:0]]; + [tableDocumentInstance setActivityPaneHidden:@0]; [[NSApp mainWindow] makeFirstResponder:activitiesTable]; } else { - [tableDocumentInstance setActivityPaneHidden:[NSNumber numberWithInteger:1]]; + [tableDocumentInstance setActivityPaneHidden:@1]; [[NSApp mainWindow] makeFirstResponder:infoTable]; } diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m index 310af941..1b922683 100644 --- a/Source/SPTableStructure.m +++ b/Source/SPTableStructure.m @@ -253,12 +253,12 @@ static NSString *SPRemoveFieldAndForeignKey = @"SPRemoveFieldAndForeignKey"; BOOL allowNull = [[[tableDataInstance statusValueForKey:@"Engine"] uppercaseString] isEqualToString:@"CSV"] ? NO : [prefs boolForKey:SPNewFieldsAllowNulls]; [tableFields insertObject:[NSMutableDictionary - dictionaryWithObjects:[NSArray arrayWithObjects:@"", @"INT", @"", @"0", @"0", @"0", allowNull ? @"1" : @"0", @"", [prefs stringForKey:SPNullValue], @"None", @"", [NSNumber numberWithInt:0], [NSNumber numberWithInt:0], nil] + dictionaryWithObjects:[NSArray arrayWithObjects:@"", @"INT", @"", @"0", @"0", @"0", allowNull ? @"1" : @"0", @"", [prefs stringForKey:SPNullValue], @"None", @"", @0, @0, nil] forKeys:[NSArray arrayWithObjects:@"name", @"type", @"length", @"unsigned", @"zerofill", @"binary", @"null", @"Key", @"default", @"Extra", @"comment", @"encoding", @"collation", nil]] atIndex:insertIndex]; #else [tableFields insertObject:[NSMutableDictionary - dictionaryWithObjects:[NSArray arrayWithObjects:@"", @"INT", @"", @"0", @"0", @"0", @"1", @"", @"NULL", @"None", @"", [NSNumber numberWithInt:0], [NSNumber numberWithInt:0], nil] + dictionaryWithObjects:[NSArray arrayWithObjects:@"", @"INT", @"", @"0", @"0", @"0", @"1", @"", @"NULL", @"None", @"", @0, @0, nil] forKeys:[NSArray arrayWithObjects:@"name", @"type", @"length", @"unsigned", @"zerofill", @"binary", @"null", @"Key", @"default", @"Extra", @"comment", @"encoding", @"collation", nil]] atIndex:insertIndex]; #endif diff --git a/Source/SPTableStructureDelegate.m b/Source/SPTableStructureDelegate.m index aebb0f18..4d2f580c 100644 --- a/Source/SPTableStructureDelegate.m +++ b/Source/SPTableStructureDelegate.m @@ -145,14 +145,14 @@ // Reset collation if encoding was changed if ([[aTableColumn identifier] isEqualToString:@"encoding"]) { if ([[currentRow objectForKey:@"encoding"] integerValue] != [anObject integerValue]) { - [currentRow setObject:[NSNumber numberWithInteger:0] forKey:@"collation"]; + [currentRow setObject:@0 forKey:@"collation"]; [tableSourceView reloadData]; } } // Reset collation if BINARY was set changed, as enabling BINARY sets collation to *_bin else if ([[aTableColumn identifier] isEqualToString:@"binary"]) { if ([[currentRow objectForKey:@"binary"] integerValue] != [anObject integerValue]) { - [currentRow setObject:[NSNumber numberWithInteger:0] forKey:@"collation"]; + [currentRow setObject:@0 forKey:@"collation"]; [tableSourceView reloadData]; } @@ -164,7 +164,7 @@ isCurrentExtraAutoIncrement = [[[anObject stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] uppercaseString] isEqualToString:@"AUTO_INCREMENT"]; if (isCurrentExtraAutoIncrement) { - [currentRow setObject:[NSNumber numberWithInteger:0] forKey:@"null"]; + [currentRow setObject:@0 forKey:@"null"]; // Asks the user to add an index to query if AUTO_INCREMENT is set and field isn't indexed if ((![currentRow objectForKey:@"Key"] || [[currentRow objectForKey:@"Key"] isEqualToString:@""])) { diff --git a/Source/SPTableStructureLoading.m b/Source/SPTableStructureLoading.m index a2a90f40..4c4e8c37 100644 --- a/Source/SPTableStructureLoading.m +++ b/Source/SPTableStructureLoading.m @@ -212,7 +212,7 @@ // Set BINARY if collation ends with _bin for convenience if ([[col objectForKey:@"COLLATION_NAME"] hasSuffix:@"_bin"]) { - [theField setObject:[NSNumber numberWithInt:1] forKey:@"binary"]; + [theField setObject:@1 forKey:@"binary"]; } break; |