diff options
author | Max <post@wickenrode.com> | 2014-12-13 03:01:19 +0100 |
---|---|---|
committer | Max <post@wickenrode.com> | 2014-12-13 03:04:09 +0100 |
commit | 4ad26db45b46d8267fcb5203571b81bc8949b853 (patch) | |
tree | 76c191186f4ce342964bf3c4bbf23d0fce05e063 | |
parent | 33fd38501be11213968536a0c540cee7061e42a9 (diff) | |
download | sequelpro-4ad26db45b46d8267fcb5203571b81bc8949b853.tar.gz sequelpro-4ad26db45b46d8267fcb5203571b81bc8949b853.tar.bz2 sequelpro-4ad26db45b46d8267fcb5203571b81bc8949b853.zip |
Reformatting code for modern ObjC
Replaced all [NSNumber numberWithBool:YES/NO] with the @YES/@NO literals.
Also replaced some TRUE/FALSE with their YES/NO counterparts.
25 files changed, 132 insertions, 135 deletions
diff --git a/Frameworks/PSMTabBar/PSMTabBarController.m b/Frameworks/PSMTabBar/PSMTabBarController.m index 4ab2c1ef..eddf4174 100644 --- a/Frameworks/PSMTabBar/PSMTabBarController.m +++ b/Frameworks/PSMTabBar/PSMTabBarController.m @@ -633,7 +633,7 @@ static NSInteger potentialMinimumForArray(NSArray *array, NSInteger minimum) } } - return TRUE; + return YES; } - (NSInteger)numberOfItemsInMenu:(NSMenu *)menu diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Delegate & Proxy.m b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Delegate & Proxy.m index 85b2db9b..be6d054b 100644 --- a/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Delegate & Proxy.m +++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConnection Categories/Delegate & Proxy.m @@ -111,7 +111,7 @@ // Trigger a reconnect depending on connection usage recently. If the connection has // actively been used in the last couple of minutes, trigger a full reconnection attempt. if (_elapsedSecondsSinceAbsoluteTime(lastConnectionUsedTime) < 60 * 2) { - reconnectionThread = [[[NSThread alloc] initWithTarget:self selector:@selector(_reconnectAllowingRetries:) object:[NSNumber numberWithBool:YES]] autorelease]; + reconnectionThread = [[[NSThread alloc] initWithTarget:self selector:@selector(_reconnectAllowingRetries:) object:@YES] autorelease]; [reconnectionThread setName:@"SPMySQL reconnection thread (full)"]; [reconnectionThread start]; diff --git a/Source/MGTemplateEngine.m b/Source/MGTemplateEngine.m index a6e15c2a..941a7e1b 100644 --- a/Source/MGTemplateEngine.m +++ b/Source/MGTemplateEngine.m @@ -408,12 +408,12 @@ nil], GLOBAL_ENGINE_DELIMITERS, nil] forKey:GLOBAL_ENGINE_GROUP]; - [_globals setObject:[NSNumber numberWithBool:YES] forKey:@"true"]; - [_globals setObject:[NSNumber numberWithBool:NO] forKey:@"false"]; - [_globals setObject:[NSNumber numberWithBool:YES] forKey:@"YES"]; - [_globals setObject:[NSNumber numberWithBool:NO] forKey:@"NO"]; - [_globals setObject:[NSNumber numberWithBool:YES] forKey:@"yes"]; - [_globals setObject:[NSNumber numberWithBool:NO] forKey:@"no"]; + [_globals setObject:@YES forKey:@"true"]; + [_globals setObject:@NO forKey:@"false"]; + [_globals setObject:@YES forKey:@"YES"]; + [_globals setObject:@NO forKey:@"NO"]; + [_globals setObject:@YES forKey:@"yes"]; + [_globals setObject:@NO forKey:@"no"]; _outputDisabledCount = 0; [templateContents release]; templateContents = [templateString retain]; diff --git a/Source/MGTemplateStandardMarkers.m b/Source/MGTemplateStandardMarkers.m index 3421abe3..db765aef 100644 --- a/Source/MGTemplateStandardMarkers.m +++ b/Source/MGTemplateStandardMarkers.m @@ -231,7 +231,7 @@ // Disable output for this block. *blockStarted = YES; NSMutableDictionary *stackFrame = [NSMutableDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:YES], FOR_STACK_DISABLED_OUTPUT, + @YES, FOR_STACK_DISABLED_OUTPUT, [NSValue valueWithRange:markerRange], STACK_START_MARKER_RANGE, [NSValue valueWithRange:*nextRange], STACK_START_REMAINING_RANGE, nil]; @@ -426,7 +426,7 @@ } // Note that we've now seen the else marker. - [frame setObject:[NSNumber numberWithBool:YES] forKey:IF_ELSE_SEEN]; + [frame setObject:@YES forKey:IF_ELSE_SEEN]; } } diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m index 8ae9ceac..4aaa7cad 100644 --- a/Source/SPBundleEditorController.m +++ b/Source/SPBundleEditorController.m @@ -951,7 +951,7 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; if([[saveDict description] isEqualToString:[cmdData description]]) return YES; if([cmdData objectForKey:SPBundleFileIsDefaultBundleKey]) - [saveDict setObject:[NSNumber numberWithBool:YES] forKey:SPBundleFileDefaultBundleWasModifiedKey]; + [saveDict setObject:@YES forKey:SPBundleFileDefaultBundleWasModifiedKey]; } if (cmdData) [cmdData release]; } @@ -1357,9 +1357,9 @@ static NSString *SPSaveBundleAction = @"SPSaveBundle"; //abort editing [control abortEditing]; [[NSApp mainWindow] makeFirstResponder:commandsOutlineView]; - return TRUE; + return YES; } else{ - return FALSE; + return NO; } } diff --git a/Source/SPContentFilterManager.m b/Source/SPContentFilterManager.m index 1322aa4a..9fe255ef 100644 --- a/Source/SPContentFilterManager.m +++ b/Source/SPContentFilterManager.m @@ -679,10 +679,10 @@ static NSString *SPExportFilterAction = @"SPExportFilter"; [contentFilterNameTextField setStringValue: [[contentFilters objectAtIndex:[contentFilterTableView selectedRow]] objectForKey:@"MenuLabel"]]; - return TRUE; + return YES; } - return FALSE; + return NO; } /** @@ -931,7 +931,7 @@ static NSString *SPExportFilterAction = @"SPExportFilter"; [spfdata setObject:[NSNumber numberWithInteger:1] forKey:@"version"]; [spfdata setObject:@"content filters" forKey:@"format"]; - [spfdata setObject:[NSNumber numberWithBool:NO] forKey:@"encrypted"]; + [spfdata setObject:@NO forKey:@"encrypted"]; NSIndexSet *indexes = [contentFilterTableView selectedRowIndexes]; diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index 083de5c3..acfe7eac 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -3918,7 +3918,7 @@ // Preserve the focus [[tableDocumentInstance parentWindow] makeFirstResponder:customQueryView]; - return TRUE; + return YES; } } diff --git a/Source/SPDataImport.m b/Source/SPDataImport.m index 26c56348..ed17a506 100644 --- a/Source/SPDataImport.m +++ b/Source/SPDataImport.m @@ -662,7 +662,7 @@ [tablesListInstance updateTables:self]; // Re-query the structure of all databases in the background - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; // Import finished Growl notification [[SPGrowlController sharedGrowlController] notifyWithTitle:@"Import Finished" @@ -1178,7 +1178,7 @@ [tablesListInstance performSelectorOnMainThread:@selector(updateTables:) withObject:self waitUntilDone:YES]; // Re-query the structure of all databases in the background - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; // Select the new table [tablesListInstance selectItemWithName:selectedTableTarget]; @@ -1215,7 +1215,7 @@ nil, nil, NSLocalizedString(@"Could not parse file as CSV", @"Error when we can't parse/split file as CSV") ); - return FALSE; + return YES; } // Sanity check the first row of the CSV to prevent hang loops caused by wrong line ending entry @@ -1228,7 +1228,7 @@ nil, nil, NSLocalizedString(@"The CSV was read as containing more than 512 columns, more than the maximum columns permitted for speed reasons by Sequel Pro.\n\nThis usually happens due to errors reading the CSV; please double-check the CSV to be imported and the line endings and escape characters at the bottom of the CSV selection dialog.", @"Error when CSV appears to have too many columns to import, probably due to line ending mismatch") ); - return FALSE; + return NO; } fieldMappingImportArrayIsPreview = dataIsPreviewData; @@ -1262,7 +1262,7 @@ // If the mapping was cancelled, abort the import if (fieldMapperSheetStatus == SPFieldMapperCancelled) { if (fieldMapperController) [fieldMapperController release]; - return FALSE; + return NO; } // Get mapping settings and preset some global variables @@ -1290,7 +1290,7 @@ { if(fieldMapperController) [fieldMapperController release]; NSBeep(); - return FALSE; + return NO; } // Store target table definitions diff --git a/Source/SPDataStorage.m b/Source/SPDataStorage.m index ed50c7fc..30be0644 100644 --- a/Source/SPDataStorage.m +++ b/Source/SPDataStorage.m @@ -391,7 +391,7 @@ static inline NSMutableArray* SPDataStorageGetEditedRow(NSPointerArray* rowStore if (columnIndex >= numberOfColumns) { [NSException raise:NSRangeException format:@"Invalid column set as unloaded; requested column index (%llu) beyond bounds (%llu)", (unsigned long long)columnIndex, (unsigned long long)numberOfColumns]; } - unloadedColumns[columnIndex] = true; + unloadedColumns[columnIndex] = YES; } #pragma mark - Basic information diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 654f06cd..4f09b3a8 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -552,10 +552,10 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; notificationName:@"Connected"]; // Init Custom Query editor with the stored queries in a spf file if given. - [spfDocData setObject:[NSNumber numberWithBool:NO] forKey:@"save_editor_content"]; + [spfDocData setObject:@NO forKey:@"save_editor_content"]; if (spfSession != nil && [spfSession objectForKey:@"queries"]) { - [spfDocData setObject:[NSNumber numberWithBool:YES] forKey:@"save_editor_content"]; + [spfDocData setObject:@YES forKey:@"save_editor_content"]; if ([[spfSession objectForKey:@"queries"] isKindOfClass:[NSData class]]) { NSString *q = [[NSString alloc] initWithData:[[spfSession objectForKey:@"queries"] decompress] encoding:NSUTF8StringEncoding]; [self initQueryEditorWithString:q]; @@ -1012,7 +1012,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [self _addDatabase]; // Query the structure of all databases in the background (mainly for completion) - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:databaseStructureRetrieval selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:databaseStructureRetrieval selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; } else { // Reset chooseDatabaseButton @@ -3072,7 +3072,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; } } - [fileManager createDirectoryAtPath:fileName withIntermediateDirectories:TRUE attributes:nil error:&error]; + [fileManager createDirectoryAtPath:fileName withIntermediateDirectories:YES attributes:nil error:&error]; if(error != nil) { NSAlert *errorAlert = [NSAlert alertWithError:error]; @@ -3080,7 +3080,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; return; } - [fileManager createDirectoryAtPath:[NSString stringWithFormat:@"%@/Contents", fileName] withIntermediateDirectories:TRUE attributes:nil error:&error]; + [fileManager createDirectoryAtPath:[NSString stringWithFormat:@"%@/Contents", fileName] withIntermediateDirectories:YES attributes:nil error:&error]; if(error != nil) { NSAlert *errorAlert = [NSAlert alertWithError:error]; @@ -3142,12 +3142,12 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // save it as temporary spf file inside the bundle with save panel options spfDocData_temp [doc saveDocumentWithFilePath:filePath inBackground:NO onlyPreferences:NO contextInfo:[NSDictionary dictionaryWithDictionary:spfDocData_temp]]; [doc setIsSavedInBundle:YES]; - [tabData setObject:[NSNumber numberWithBool:NO] forKey:@"isAbsolutePath"]; + [tabData setObject:@NO forKey:@"isAbsolutePath"]; [tabData setObject:newName forKey:@"path"]; } else { // save it to the original location and take the file's spfDocData [doc saveDocumentWithFilePath:[[doc fileURL] path] inBackground:YES onlyPreferences:NO contextInfo:nil]; - [tabData setObject:[NSNumber numberWithBool:YES] forKey:@"isAbsolutePath"]; + [tabData setObject:@YES forKey:@"isAbsolutePath"]; [tabData setObject:[[doc fileURL] path] forKey:@"path"]; } [tabs addObject:tabData]; @@ -3219,7 +3219,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [spfDocData_temp setObject:[NSNumber numberWithBool:([saveConnectionAutoConnect state]==NSOnState) ? YES : NO ] forKey:@"auto_connect"]; [spfDocData_temp setObject:[NSNumber numberWithBool:([saveConnectionSavePassword state]==NSOnState) ? YES : NO ] forKey:@"save_password"]; [spfDocData_temp setObject:[NSNumber numberWithBool:([saveConnectionIncludeData state]==NSOnState) ? YES : NO ] forKey:@"include_session"]; - [spfDocData_temp setObject:[NSNumber numberWithBool:NO] forKey:@"save_editor_content"]; + [spfDocData_temp setObject:@NO forKey:@"save_editor_content"]; if([[[[customQueryInstance valueForKeyPath:@"textView"] textStorage] string] length]) [spfDocData_temp setObject:[NSNumber numberWithBool:([saveConnectionIncludeQuery state]==NSOnState) ? YES : NO ] forKey:@"save_editor_content"]; @@ -3334,23 +3334,23 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // Set up the document details to store NSMutableDictionary *stateDetailsToSave = [NSMutableDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:YES], @"connection", - [NSNumber numberWithBool:YES], @"history", + @YES, @"connection", + @YES, @"history", nil]; // Include session data like selected table, view etc. ? if ([[spfDocData_temp objectForKey:@"include_session"] boolValue]) - [stateDetailsToSave setObject:[NSNumber numberWithBool:YES] forKey:@"session"]; + [stateDetailsToSave setObject:@YES forKey:@"session"]; // Include the query editor contents if asked to if ([[spfDocData_temp objectForKey:@"save_editor_content"] boolValue]) { - [stateDetailsToSave setObject:[NSNumber numberWithBool:YES] forKey:@"query"]; - [stateDetailsToSave setObject:[NSNumber numberWithBool:YES] forKey:@"enablecompression"]; + [stateDetailsToSave setObject:@YES forKey:@"query"]; + [stateDetailsToSave setObject:@YES forKey:@"enablecompression"]; } // Add passwords if asked to if ([[spfDocData_temp objectForKey:@"save_password"] boolValue]) - [stateDetailsToSave setObject:[NSNumber numberWithBool:YES] forKey:@"password"]; + [stateDetailsToSave setObject:@YES forKey:@"password"]; // Retrieve details and add to the appropriate dictionaries NSMutableDictionary *stateDetails = [NSMutableDictionary dictionaryWithDictionary:[self stateIncludingDetails:stateDetailsToSave]]; @@ -3444,16 +3444,16 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // Get the current state NSDictionary *allStateDetails = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:YES], @"connection", - [NSNumber numberWithBool:YES], @"history", - [NSNumber numberWithBool:YES], @"session", - [NSNumber numberWithBool:YES], @"query", - [NSNumber numberWithBool:YES], @"password", + @YES, @"connection", + @YES, @"history", + @YES, @"session", + @YES, @"query", + @YES, @"password", nil]; NSMutableDictionary *currentState = [NSMutableDictionary dictionaryWithDictionary:[self stateIncludingDetails:allStateDetails]]; // Ensure it's set to autoconnect, and clear the table - [currentState setObject:[NSNumber numberWithBool:YES] forKey:@"auto_connect"]; + [currentState setObject:@YES forKey:@"auto_connect"]; NSMutableDictionary *sessionDict = [NSMutableDictionary dictionaryWithDictionary:[currentState objectForKey:@"session"]]; [sessionDict removeObjectForKey:@"table"]; [currentState setObject:sessionDict forKey:@"session"]; @@ -4917,16 +4917,16 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [data setObject:[spf objectForKey:SPContentFilters] forKey:SPContentFilters]; // Ensure the encryption status is stored in the spfDocData store for future saves - [spfDocData setObject:[NSNumber numberWithBool:NO] forKey:@"encrypted"]; + [spfDocData setObject:@NO forKey:@"encrypted"]; if (encryptpw != nil) { - [spfDocData setObject:[NSNumber numberWithBool:YES] forKey:@"encrypted"]; + [spfDocData setObject:@YES forKey:@"encrypted"]; [spfDocData setObject:encryptpw forKey:@"e_string"]; } encryptpw = nil; // If session data is available, ensure it is marked for save if ([data objectForKey:@"session"]) { - [spfDocData setObject:[NSNumber numberWithBool:YES] forKey:@"include_session"]; + [spfDocData setObject:@YES forKey:@"include_session"]; } if (![self isSaveInBundle]) { @@ -4935,11 +4935,11 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; [spfDocData setObject:[NSNumber numberWithBool:([[data objectForKey:@"connection"] objectForKey:@"password"]) ? YES : NO] forKey:@"save_password"]; - [spfDocData setObject:[NSNumber numberWithBool:NO] forKey:@"auto_connect"]; + [spfDocData setObject:@NO forKey:@"auto_connect"]; if([spf objectForKey:@"auto_connect"] && [[spf valueForKey:@"auto_connect"] boolValue]) { - [spfDocData setObject:[NSNumber numberWithBool:YES] forKey:@"auto_connect"]; - [data setObject:[NSNumber numberWithBool:YES] forKey:@"auto_connect"]; + [spfDocData setObject:@YES forKey:@"auto_connect"]; + [data setObject:@YES forKey:@"auto_connect"]; } // Set the state dictionary, triggering an autoconnect if appropriate diff --git a/Source/SPExportController.m b/Source/SPExportController.m index 3fb07267..4a97ae00 100644 --- a/Source/SPExportController.m +++ b/Source/SPExportController.m @@ -191,9 +191,9 @@ static const NSString *SPSQLExportDropEnabled = @"SQLExportDropEnabled"; // Disable all tables for (NSMutableArray *table in tables) { - [table replaceObjectAtIndex:1 withObject:[NSNumber numberWithBool:NO]]; - [table replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:NO]]; - [table replaceObjectAtIndex:3 withObject:[NSNumber numberWithBool:NO]]; + [table replaceObjectAtIndex:1 withObject:@NO]; + [table replaceObjectAtIndex:2 withObject:@NO]; + [table replaceObjectAtIndex:3 withObject:@NO]; } // Select the supplied tables @@ -202,9 +202,9 @@ static const NSString *SPSQLExportDropEnabled = @"SQLExportDropEnabled"; for (NSString *exportTable in exportTables) { if ([exportTable isEqualToString:[table objectAtIndex:0]]) { - [table replaceObjectAtIndex:1 withObject:[NSNumber numberWithBool:YES]]; - [table replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:YES]]; - [table replaceObjectAtIndex:3 withObject:[NSNumber numberWithBool:YES]]; + [table replaceObjectAtIndex:1 withObject:@YES]; + [table replaceObjectAtIndex:2 withObject:@YES]; + [table replaceObjectAtIndex:3 withObject:@YES]; } } } @@ -436,9 +436,9 @@ static const NSString *SPSQLExportDropEnabled = @"SQLExportDropEnabled"; for (id itemName in tablesAndViews) { [tables addObject:[NSMutableArray arrayWithObjects: itemName, - [NSNumber numberWithBool:YES], - [NSNumber numberWithBool:YES], - [NSNumber numberWithBool:YES], + @YES, + @YES, + @YES, [NSNumber numberWithInt:SPTableTypeTable], nil]]; } @@ -451,9 +451,9 @@ static const NSString *SPSQLExportDropEnabled = @"SQLExportDropEnabled"; { [tables addObject:[NSMutableArray arrayWithObjects: procName, - [NSNumber numberWithBool:YES], - [NSNumber numberWithBool:YES], - [NSNumber numberWithBool:YES], + @YES, + @YES, + @YES, [NSNumber numberWithInt:SPTableTypeProc], nil]]; } @@ -464,9 +464,9 @@ static const NSString *SPSQLExportDropEnabled = @"SQLExportDropEnabled"; { [tables addObject:[NSMutableArray arrayWithObjects: funcName, - [NSNumber numberWithBool:YES], - [NSNumber numberWithBool:YES], - [NSNumber numberWithBool:YES], + @YES, + @YES, + @YES, [NSNumber numberWithInt:SPTableTypeFunc], nil]]; } diff --git a/Source/SPExportInitializer.m b/Source/SPExportInitializer.m index bb59dd60..9c626a53 100644 --- a/Source/SPExportInitializer.m +++ b/Source/SPExportInitializer.m @@ -126,15 +126,15 @@ // Check the overall export settings if ([[table objectAtIndex:1] boolValue] && (![exportSQLIncludeStructureCheck state])) { - [table replaceObjectAtIndex:1 withObject:[NSNumber numberWithBool:NO]]; + [table replaceObjectAtIndex:1 withObject:@NO]; } if ([[table objectAtIndex:2] boolValue] && (![exportSQLIncludeContentCheck state])) { - [table replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:NO]]; + [table replaceObjectAtIndex:2 withObject:@NO]; } if ([[table objectAtIndex:3] boolValue] && (![exportSQLIncludeDropSyntaxCheck state])) { - [table replaceObjectAtIndex:3 withObject:[NSNumber numberWithBool:NO]]; + [table replaceObjectAtIndex:3 withObject:@NO]; } [exportTables addObject:table]; diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m index 397c017f..aaa6c0bc 100644 --- a/Source/SPFieldMapperController.m +++ b/Source/SPFieldMapperController.m @@ -1120,7 +1120,7 @@ static NSUInteger SPSourceColumnTypeInteger = 1; - (IBAction)addGlobalValue:(id)sender { [fieldMappingGlobalValues addObject:@""]; - [fieldMappingGlobalValuesSQLMarked addObject:[NSNumber numberWithBool:NO]]; + [fieldMappingGlobalValuesSQLMarked addObject:@NO]; [globalValuesTableView reloadData]; [globalValuesTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:[fieldMappingGlobalValues count]-1-numberOfImportColumns] byExtendingSelection:NO]; [globalValuesTableView editColumn:1 row:[fieldMappingGlobalValues count]-1-numberOfImportColumns withEvent:nil select:YES]; @@ -1432,7 +1432,7 @@ static NSUInteger SPSourceColumnTypeInteger = 1; } // Sort the matrix according distance - NSSortDescriptor *sortByDistance = [[[NSSortDescriptor alloc] initWithKey:@"dist" ascending:TRUE] autorelease]; + NSSortDescriptor *sortByDistance = [[[NSSortDescriptor alloc] initWithKey:@"dist" ascending:YES] autorelease]; [distMatrix sortUsingDescriptors:[NSArray arrayWithObjects:sortByDistance, nil]]; NSMutableArray *matchedFile = [NSMutableArray array]; @@ -2091,10 +2091,10 @@ static NSUInteger SPSourceColumnTypeInteger = 1; // Preserve the focus [[fieldMapperTableView window] makeFirstResponder:fieldMapperTableView]; - return TRUE; + return YES; } - return FALSE; + return NO; } diff --git a/Source/SPNavigatorController.m b/Source/SPNavigatorController.m index 1a7e52fd..67070472 100644 --- a/Source/SPNavigatorController.m +++ b/Source/SPNavigatorController.m @@ -611,7 +611,7 @@ static NSComparisonResult compareStrings(NSString *s1, NSString *s2, void* conte if (![[doc getConnection] isConnected]) return; - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[doc databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[doc databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; } - (IBAction)outlineViewAction:(id)sender diff --git a/Source/SPPreferencesUpgrade.m b/Source/SPPreferencesUpgrade.m index d4a9ca84..6151f675 100644 --- a/Source/SPPreferencesUpgrade.m +++ b/Source/SPPreferencesUpgrade.m @@ -76,7 +76,7 @@ void SPApplyRevisionChanges(void) } // Inform SPAppController to check installed default Bundles for available updates - [prefs setObject:[NSNumber numberWithBool:YES] forKey:@"doBundleUpdate"]; + [prefs setObject:@YES forKey:@"doBundleUpdate"]; // For versions prior to r336 (0.9.4), where column widths have been saved, walk through them and remove // any table widths set to 15 or less (fix for mangled columns caused by Issue #140) diff --git a/Source/SPQueryController.m b/Source/SPQueryController.m index 718a5ff3..3e33b533 100644 --- a/Source/SPQueryController.m +++ b/Source/SPQueryController.m @@ -458,7 +458,7 @@ static SPQueryController *sharedQueryController = nil; [progressIndicator startAnimation:self]; // Don't allow clearing the console while filtering its content - [self _allowFilterClearOrSave:[NSNumber numberWithBool:NO]]; + [self _allowFilterClearOrSave:@NO]; [messagesFilteredSet removeAllObjects]; @@ -470,7 +470,7 @@ static SPQueryController *sharedQueryController = nil; [consoleTableView reloadData]; [consoleTableView scrollRowToVisible:([messagesVisibleSet count] - 1)]; - [self _allowFilterClearOrSave:[NSNumber numberWithBool:YES]]; + [self _allowFilterClearOrSave:@YES]; [saveConsoleButton setTitle:NSLocalizedString(@"Save As...", @"save as button title")]; @@ -502,7 +502,7 @@ static SPQueryController *sharedQueryController = nil; [consoleTableView scrollRowToVisible:([messagesVisibleSet count] - 1)]; if ([messagesVisibleSet count] > 0) { - [self _allowFilterClearOrSave:[NSNumber numberWithBool:YES]]; + [self _allowFilterClearOrSave:@YES]; } [saveConsoleButton setTitle:NSLocalizedString(@"Save View As...", @"save view as button title")]; @@ -623,7 +623,7 @@ static SPQueryController *sharedQueryController = nil; && [self _messageMatchesCurrentFilters:[consoleMessage message]]) { [messagesFilteredSet addObject:[messagesFullSet lastObject]]; - [self performSelectorOnMainThread:@selector(_allowFilterClearOrSave:) withObject:[NSNumber numberWithBool:YES] waitUntilDone:NO]; + [self performSelectorOnMainThread:@selector(_allowFilterClearOrSave:) withObject:@YES waitUntilDone:NO]; } // Reload the table and scroll to the new message if it's visible (for speed) diff --git a/Source/SPQueryFavoriteManager.m b/Source/SPQueryFavoriteManager.m index 97f7790b..a7147646 100644 --- a/Source/SPQueryFavoriteManager.m +++ b/Source/SPQueryFavoriteManager.m @@ -422,7 +422,7 @@ // Identify the tab completion index NSRange snippetNumberRange = [queryString rangeOfRegex:snipRegex options:RKLNoOptions inRange:matchedRange capture:1L error:NULL]; NSInteger snippetNumber = [[queryString substringWithRange:snippetNumberRange] integerValue]; - [snippetNumbers setObject:[NSNumber numberWithBool:YES] forKey:[NSNumber numberWithInteger:snippetNumber]]; + [snippetNumbers setObject:@YES forKey:[NSNumber numberWithInteger:snippetNumber]]; rangeStart = matchedRange.location + matchedRange.length; } @@ -919,7 +919,7 @@ [spfdata setObject:[NSNumber numberWithInteger:1] forKey:@"version"]; [spfdata setObject:@"query favorites" forKey:@"format"]; - [spfdata setObject:[NSNumber numberWithBool:NO] forKey:@"encrypted"]; + [spfdata setObject:@NO forKey:@"encrypted"]; NSIndexSet *indexes = [favoritesTableView selectedRowIndexes]; diff --git a/Source/SPSSHTunnel.m b/Source/SPSSHTunnel.m index ff220318..20f1aa43 100644 --- a/Source/SPSSHTunnel.m +++ b/Source/SPSSHTunnel.m @@ -116,7 +116,7 @@ delegate = theDelegate; stateChangeSelector = theStateChangeSelector; - return true; + return YES; } /* diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 892fe30f..9e190cb2 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -3851,7 +3851,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper NSUInteger indexCount = [selectedRowIndexes getIndexes:indexBuffer maxCount:[selectedRowIndexes count] inIndexRange:NULL]; NSMutableDictionary *selectedRowLookupTable = [NSMutableDictionary dictionaryWithCapacity:indexCount]; - NSNumber *trueNumber = [NSNumber numberWithBool:YES]; + NSNumber *trueNumber = @YES; for (NSUInteger i = 0; i < indexCount; i++) { // For single-column primary keys, use the cell value as a dictionary key for fast lookups diff --git a/Source/SPTableData.m b/Source/SPTableData.m index 5158d4be..00de39da 100644 --- a/Source/SPTableData.m +++ b/Source/SPTableData.m @@ -390,7 +390,7 @@ // The table information fetch may have already unlocked the data lock. pthread_mutex_trylock(&dataProcessingLock); pthread_mutex_unlock(&dataProcessingLock); - return FALSE; + return NO; } [columns addObjectsFromArray:[tableData objectForKey:@"columns"]]; @@ -408,7 +408,7 @@ pthread_mutex_unlock(&dataProcessingLock); - return TRUE; + return YES; } /** @@ -431,7 +431,7 @@ [columnNames removeAllObjects]; [constraints removeAllObjects]; pthread_mutex_unlock(&dataProcessingLock); - return FALSE; + return NO; } [columns addObjectsFromArray:[viewData objectForKey:@"columns"]]; @@ -448,7 +448,7 @@ pthread_mutex_unlock(&dataProcessingLock); - return TRUE; + return YES; } /** @@ -915,9 +915,9 @@ // If there's a null column, use the details from it if ([resultRow objectForKey:@"Null"]) { if ([[[resultRow objectForKey:@"Null"] uppercaseString] isEqualToString:@"NO"]) { - [tableColumn setValue:[NSNumber numberWithBool:NO] forKey:@"null"]; + [tableColumn setValue:@NO forKey:@"null"]; } else { - [tableColumn setValue:[NSNumber numberWithBool:YES] forKey:@"null"]; + [tableColumn setValue:@YES forKey:@"null"]; } } @@ -957,7 +957,7 @@ // Catch unselected tables and return false if (![tableListInstance tableName]) { pthread_mutex_unlock(&dataProcessingLock); - return FALSE; + return NO; } // Ensure queries are run as UTF8 @@ -1004,7 +1004,7 @@ if (changeEncoding) [mySQLConnection restoreStoredEncoding]; } pthread_mutex_unlock(&dataProcessingLock); - return FALSE; + return NO; } // Retrieve the status as a dictionary and set as the cache @@ -1022,7 +1022,7 @@ [status setDictionary:[NSDictionary dictionaryWithObjectsAndKeys:@"Error", @"Engine", [NSString stringWithFormat:NSLocalizedString(@"An error occurred retrieving table information. MySQL said: %@", @"MySQL table info retrieval error message"), [status objectForKey:@"Comment"]], @"Comment", [tableListInstance tableName], @"Name", nil]]; if (changeEncoding) [mySQLConnection restoreStoredEncoding]; pthread_mutex_unlock(&dataProcessingLock); - return FALSE; + return NO; } // Add a note for whether the row count is accurate or not - only for MyISAM @@ -1058,7 +1058,7 @@ pthread_mutex_unlock(&dataProcessingLock); - return TRUE; + return YES; } /** @@ -1267,16 +1267,13 @@ [detailString release]; - NSNumber *boolYES = [NSNumber numberWithBool:YES]; - NSNumber *boolNO = [NSNumber numberWithBool:NO]; - // Set up some column defaults for all columns - [fieldDetails setValue:boolYES forKey:@"null"]; - [fieldDetails setValue:boolNO forKey:@"unsigned"]; - [fieldDetails setValue:boolNO forKey:@"binary"]; - [fieldDetails setValue:boolNO forKey:@"zerofill"]; - [fieldDetails setValue:boolNO forKey:@"autoincrement"]; - [fieldDetails setValue:boolNO forKey:@"onupdatetimestamp"]; + [fieldDetails setValue:@YES forKey:@"null"]; + [fieldDetails setValue:@NO forKey:@"unsigned"]; + [fieldDetails setValue:@NO forKey:@"binary"]; + [fieldDetails setValue:@NO forKey:@"zerofill"]; + [fieldDetails setValue:@NO forKey:@"autoincrement"]; + [fieldDetails setValue:@NO forKey:@"onupdatetimestamp"]; [fieldDetails setValue:@"" forKey:@"comment"]; [fieldDetails setValue:[NSMutableString string] forKey:@"unparsed"]; @@ -1288,15 +1285,15 @@ // Whether numeric fields are unsigned if ([detailString isEqualToString:@"UNSIGNED"]) { - [fieldDetails setValue:boolYES forKey:@"unsigned"]; + [fieldDetails setValue:@YES forKey:@"unsigned"]; // Whether numeric fields are zerofill } else if ([detailString isEqualToString:@"ZEROFILL"]) { - [fieldDetails setValue:boolYES forKey:@"zerofill"]; + [fieldDetails setValue:@YES forKey:@"zerofill"]; // Whether text types are binary } else if ([detailString isEqualToString:@"BINARY"]) { - [fieldDetails setValue:boolYES forKey:@"binary"]; + [fieldDetails setValue:@YES forKey:@"binary"]; // Whether text types have a different encoding to the table } else if ([detailString isEqualToString:@"CHARSET"] && (definitionPartsIndex + 1 < partsArrayLength)) { @@ -1321,16 +1318,16 @@ // Whether fields are NOT NULL } else if ([detailString isEqualToString:@"NOT"] && (definitionPartsIndex + 1 < partsArrayLength) && [[NSArrayObjectAtIndex(definitionParts, definitionPartsIndex+1) uppercaseString] isEqualToString:@"NULL"]) { - [fieldDetails setValue:boolNO forKey:@"null"]; + [fieldDetails setValue:@NO forKey:@"null"]; definitionPartsIndex++; // Whether fields are NULL } else if ([detailString isEqualToString:@"NULL"]) { - [fieldDetails setValue:boolYES forKey:@"null"]; + [fieldDetails setValue:@YES forKey:@"null"]; // Whether fields should auto-increment } else if ([detailString isEqualToString:@"AUTO_INCREMENT"]) { - [fieldDetails setValue:boolYES forKey:@"autoincrement"]; + [fieldDetails setValue:@YES forKey:@"autoincrement"]; tableHasAutoIncrementField = YES; // Field defaults @@ -1347,7 +1344,7 @@ } else if ([detailString isEqualToString:@"ON"] && (definitionPartsIndex + 2 < partsArrayLength) && [[NSArrayObjectAtIndex(definitionParts, definitionPartsIndex+1) uppercaseString] isEqualToString:@"UPDATE"] && [[NSArrayObjectAtIndex(definitionParts, definitionPartsIndex+2) uppercaseString] isEqualToString:@"CURRENT_TIMESTAMP"]) { - [fieldDetails setValue:boolYES forKey:@"onupdatetimestamp"]; + [fieldDetails setValue:@YES forKey:@"onupdatetimestamp"]; definitionPartsIndex += 2; // Column comments diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m index 05bf1186..310af941 100644 --- a/Source/SPTableStructure.m +++ b/Source/SPTableStructure.m @@ -964,7 +964,7 @@ static NSString *SPRemoveFieldAndForeignKey = @"SPRemoveFieldAndForeignKey"; [tableDocumentInstance setContentRequiresReload:YES]; // Query the structure of all databases in the background - [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", selectedTable, @"affectedItem", [NSNumber numberWithInteger:[tablesListInstance tableType]], @"affectedItemType", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", selectedTable, @"affectedItem", [NSNumber numberWithInteger:[tablesListInstance tableType]], @"affectedItemType", nil]]; return YES; } @@ -1059,7 +1059,7 @@ static NSString *SPRemoveFieldAndForeignKey = @"SPRemoveFieldAndForeignKey"; // on the main thread ensures the timer fires on the main thread. if (![errorDictionary objectForKey:@"delayed"]) { NSMutableDictionary *delayedErrorDictionary = [NSMutableDictionary dictionaryWithDictionary:errorDictionary]; - [delayedErrorDictionary setObject:[NSNumber numberWithBool:YES] forKey:@"delayed"]; + [delayedErrorDictionary setObject:@YES forKey:@"delayed"]; [self performSelector:@selector(showErrorSheetWith:) withObject:delayedErrorDictionary afterDelay:0.3]; return; } diff --git a/Source/SPTableStructureLoading.m b/Source/SPTableStructureLoading.m index 9e9edd5c..a2a90f40 100644 --- a/Source/SPTableStructureLoading.m +++ b/Source/SPTableStructureLoading.m @@ -290,7 +290,7 @@ [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) - object:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; + object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; [self loadTable:selectedTable]; } diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m index fdabd3af..458389c2 100644 --- a/Source/SPTablesList.m +++ b/Source/SPTablesList.m @@ -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:[NSNumber numberWithBool:YES], @"forceUpdate", [NSNumber numberWithBool:YES], @"cancelQuerying", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", @YES, @"cancelQuerying", nil]]; } /** @@ -705,16 +705,16 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; { // Get the state of the document NSDictionary *allStateDetails = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:YES], @"connection", - [NSNumber numberWithBool:YES], @"history", - [NSNumber numberWithBool:YES], @"session", - [NSNumber numberWithBool:YES], @"query", - [NSNumber numberWithBool:YES], @"password", + @YES, @"connection", + @YES, @"history", + @YES, @"session", + @YES, @"query", + @YES, @"password", nil]; NSMutableDictionary *documentState = [NSMutableDictionary dictionaryWithDictionary:[tableDocumentInstance stateIncludingDetails:allStateDetails]]; // Ensure it's set to autoconnect - [documentState setObject:[NSNumber numberWithBool:YES] forKey:@"auto_connect"]; + [documentState setObject:@YES forKey:@"auto_connect"]; // Set the connection on the new tab [[[NSApp delegate] frontDocument] setState:documentState]; @@ -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:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; } #ifndef SP_CODA @@ -1637,7 +1637,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; // When enter/return is used, save the row. if ( [textView methodForSelector:command] == [textView methodForSelector:@selector(insertNewline:)] ) { [[control window] makeFirstResponder:control]; - return TRUE; + return YES; // When the escape key is used, abort the rename. } else if ( [[control window] methodForSelector:command] == [[control window] methodForSelector:@selector(cancelOperation:)] || @@ -1646,9 +1646,9 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; [control abortEditing]; [[NSApp mainWindow] makeFirstResponder:tablesListView]; - return TRUE; + return YES; } else{ - return FALSE; + return NO; } } #endif @@ -2279,7 +2279,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) - object:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; + object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; } #ifndef SP_CODA /* operations performed on whole tables */ @@ -2430,7 +2430,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) - object:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; + object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; } 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:[NSNumber numberWithBool:YES], @"forceUpdate", nil]]; + [NSThread detachNewThreadWithName:@"SPNavigatorController database structure querier" target:[tableDocumentInstance databaseStructureRetrieval] selector:@selector(queryDbStructureWithUserInfo:) object:[NSDictionary dictionaryWithObjectsAndKeys:@YES, @"forceUpdate", nil]]; } } } diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m index 3ac9e5de..917c73ae 100644 --- a/Source/SPUserManager.m +++ b/Source/SPUserManager.m @@ -183,7 +183,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn"; [privKey replaceOccurrencesOfString:@" " withString:@"_" options:NSLiteralSearch range:NSMakeRange(0, [privKey length])]; [privKey appendString:@"_priv"]; - [[self privsSupportedByServer] setValue:[NSNumber numberWithBool:YES] forKey:privKey]; + [[self privsSupportedByServer] setValue:@YES forKey:privKey]; } } // If that fails, base privilege support on the mysql.users columns @@ -200,7 +200,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn"; if ([privColumnToGrantMap objectForKey:privKey]) privKey = [privColumnToGrantMap objectForKey:privKey]; - [[self privsSupportedByServer] setValue:[NSNumber numberWithBool:YES] forKey:[privKey lowercaseString]]; + [[self privsSupportedByServer] setValue:@YES forKey:[privKey lowercaseString]]; } } @@ -580,7 +580,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn"; // Perform the change in a try/catch check to avoid exceptions for unhandled privs NS_DURING - [selectedUser setValue:[NSNumber numberWithBool:YES] forKey:key]; + [selectedUser setValue:@YES forKey:key]; NS_HANDLER NS_ENDHANDLER } @@ -600,7 +600,7 @@ static NSString * const SPTableViewNameColumnID = @"NameColumn"; // Perform the change in a try/catch check to avoid exceptions for unhandled privs NS_DURING - [selectedUser setValue:[NSNumber numberWithBool:NO] forKey:key]; + [selectedUser setValue:@NO forKey:key]; NS_HANDLER NS_ENDHANDLER } diff --git a/Source/SPWindowManagement.m b/Source/SPWindowManagement.m index 000bbe3f..022ad7fa 100644 --- a/Source/SPWindowManagement.m +++ b/Source/SPWindowManagement.m @@ -117,17 +117,17 @@ // Get the state of the previously-frontmost document NSDictionary *allStateDetails = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:YES], @"connection", - [NSNumber numberWithBool:YES], @"history", - [NSNumber numberWithBool:YES], @"session", - [NSNumber numberWithBool:YES], @"query", - [NSNumber numberWithBool:YES], @"password", + @YES, @"connection", + @YES, @"history", + @YES, @"session", + @YES, @"query", + @YES, @"password", nil]; NSMutableDictionary *frontState = [NSMutableDictionary dictionaryWithDictionary:[theFrontDocument stateIncludingDetails:allStateDetails]]; // Ensure it's set to autoconnect - [frontState setObject:[NSNumber numberWithBool:YES] forKey:@"auto_connect"]; + [frontState setObject:@YES forKey:@"auto_connect"]; // Set the connection on the new tab [[self frontDocument] setState:frontState]; |