diff options
author | Abhi Beckert <abhi@abhibeckert.com> | 2016-04-03 10:06:33 +1000 |
---|---|---|
committer | Abhi Beckert <abhi@abhibeckert.com> | 2016-04-03 10:06:41 +1000 |
commit | 6672e0d55810a7447fd06ef1113ad88473ba7538 (patch) | |
tree | 841c95ecacd2f1d7b34211e95490b130985e2535 /Source | |
parent | 128add6d3e731a83d813ad69ee1e773776bb8e69 (diff) | |
download | sequelpro-6672e0d55810a7447fd06ef1113ad88473ba7538.tar.gz sequelpro-6672e0d55810a7447fd06ef1113ad88473ba7538.tar.bz2 sequelpro-6672e0d55810a7447fd06ef1113ad88473ba7538.zip |
fix various compile warnings
Diffstat (limited to 'Source')
30 files changed, 95 insertions, 80 deletions
diff --git a/Source/GeneratePreviewForURL.m b/Source/GeneratePreviewForURL.m index 53087eb0..9dce1011 100644 --- a/Source/GeneratePreviewForURL.m +++ b/Source/GeneratePreviewForURL.m @@ -97,13 +97,13 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, if(!iconImages || [iconImages count] < 1) iconImages = @[[NSImage imageNamed:NSImageNameStopProgressTemplate]]; -#warning Shouldn't that be "> 1"? - if([iconImages count] > 0) + if([iconImages count] > 1) iconImage = [iconImages objectAtIndex:1]; else iconImage = [iconImages objectAtIndex:0]; #warning This can cause a runtime error: "This application is assuming that a particular image contains an NSBitmapImageRep, which is not a good assumption. We are instantiating a bitmap so that whatever this is keeps working, but please do not do this. (...) This may break in the future." + // TODO: draw the image into a bitmap context and grab the jpeg representation? NSData *image = [iconImage TIFFRepresentation]; NSMutableDictionary *props = [[NSMutableDictionary alloc] initWithCapacity:6]; diff --git a/Source/SPAppController.m b/Source/SPAppController.m index a0f4865f..4f985133 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -286,7 +286,7 @@ [filePaths addObject:[obj path]]; }]; - [self application:nil openFiles:filePaths]; + [self application:NSApp openFiles:filePaths]; } }]; } @@ -301,7 +301,7 @@ [filePaths addObject:[obj path]]; }]; - [self application:nil openFiles:filePaths]; + [self application:NSApp openFiles:filePaths]; } } diff --git a/Source/SPBundleHTMLOutputController.m b/Source/SPBundleHTMLOutputController.m index ee4b5286..ecf16faa 100644 --- a/Source/SPBundleHTMLOutputController.m +++ b/Source/SPBundleHTMLOutputController.m @@ -355,7 +355,7 @@ static NSString *SPSaveDocumentAction = @"SPSaveDocument"; } // sp-reveal-file://a_file_path reveals the file in Finder else if([[[request URL] scheme] isEqualToString:@"sp-reveal-file"] && navigationType == WebNavigationTypeLinkClicked) { - [[NSWorkspace sharedWorkspace] selectFile:[[[request mainDocumentURL] absoluteString] substringFromIndex:16] inFileViewerRootedAtPath:nil]; + [[NSWorkspace sharedWorkspace] selectFile:[[[request mainDocumentURL] absoluteString] substringFromIndex:16] inFileViewerRootedAtPath:@""]; [listener ignore]; } // sp-open-file://a_file_path opens the file with the default diff --git a/Source/SPConnectionController.h b/Source/SPConnectionController.h index 59a83740..dd7ac6e5 100644 --- a/Source/SPConnectionController.h +++ b/Source/SPConnectionController.h @@ -29,6 +29,7 @@ // More info at <https://github.com/sequelpro/sequelpro> #import "SPConnectionControllerDelegateProtocol.h" +#import "SPFavoritesExportProtocol.h" #import <SPMySQL/SPMySQL.h> @@ -47,7 +48,7 @@ #endif ; -@interface SPConnectionController : NSViewController <SPMySQLConnectionDelegate, NSOpenSavePanelDelegate> +@interface SPConnectionController : NSViewController <SPMySQLConnectionDelegate, NSOpenSavePanelDelegate, SPFavoritesExportProtocol, NSSplitViewDelegate> { id <SPConnectionControllerDelegateProtocol, NSObject> delegate; diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index 91629bf3..25dc8c1b 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -1167,7 +1167,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, if (returnCode == NSOKButton) { SPFavoritesExporter *exporter = [[[SPFavoritesExporter alloc] init] autorelease]; - [exporter setDelegate:(NSObject<SPFavoritesExportProtocol> *)self]; + [exporter setDelegate:self]; [exporter writeFavorites:[self selectedFavoriteNodes] toFile:[[savePanel URL] path]]; } diff --git a/Source/SPConstants.h b/Source/SPConstants.h index db51b462..26fdc1ab 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -684,7 +684,7 @@ typedef NSUInteger NSCellHitResult; #define SPLog(fmt, ...) NSLog((@"%s:%d: " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__) // See http://stackoverflow.com/questions/4415524 -#define COUNT_OF(x) ((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x]))))) +#define COUNT_OF(x) (NSInteger)((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x]))))) // This definition is mostly for legibility #ifndef ESUCCESS diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index 3a04d1d5..2aeaacb6 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -3921,9 +3921,9 @@ // Send moveDown/Up to the popup menu NSEvent *arrowEvent; if(command == @selector(moveDown:)) - arrowEvent = [NSEvent keyEventWithType:NSKeyDown location:NSMakePoint(0,0) modifierFlags:0 timestamp:0 windowNumber:[[tableDocumentInstance parentWindow] windowNumber] context:[NSGraphicsContext currentContext] characters:nil charactersIgnoringModifiers:nil isARepeat:NO keyCode:0x7D]; + arrowEvent = [NSEvent keyEventWithType:NSKeyDown location:NSMakePoint(0,0) modifierFlags:0 timestamp:0 windowNumber:[[tableDocumentInstance parentWindow] windowNumber] context:[NSGraphicsContext currentContext] characters:@"" charactersIgnoringModifiers:@"" isARepeat:NO keyCode:0x7D]; else - arrowEvent = [NSEvent keyEventWithType:NSKeyDown location:NSMakePoint(0,0) modifierFlags:0 timestamp:0 windowNumber:[[tableDocumentInstance parentWindow] windowNumber] context:[NSGraphicsContext currentContext] characters:nil charactersIgnoringModifiers:nil isARepeat:NO keyCode:0x7E]; + arrowEvent = [NSEvent keyEventWithType:NSKeyDown location:NSMakePoint(0,0) modifierFlags:0 timestamp:0 windowNumber:[[tableDocumentInstance parentWindow] windowNumber] context:[NSGraphicsContext currentContext] characters:@"" charactersIgnoringModifiers:@"" isARepeat:NO keyCode:0x7E]; [NSApp postEvent:arrowEvent atStart:NO]; return YES; diff --git a/Source/SPDataImport.m b/Source/SPDataImport.m index c29f3b23..1f619070 100644 --- a/Source/SPDataImport.m +++ b/Source/SPDataImport.m @@ -1598,18 +1598,18 @@ cleanup: /** * Called when the selection within an open/save panel changes. */ -- (void)panelSelectionDidChange:(id)sender +- (void)panelSelectionDidChange:(NSOpenPanel *)sender { - NSArray *selectedFilenames = [sender filenames]; + NSArray *selectedUrls = sender.URLs; NSString *pathExtension; // If a single file is selected and the extension is recognised, change the format dropdown automatically - if ( [selectedFilenames count] != 1 ) return; - pathExtension = [[[selectedFilenames objectAtIndex:0] pathExtension] uppercaseString]; + if ( selectedUrls.count != 1 ) return; + pathExtension = [[selectedUrls[0] pathExtension] uppercaseString]; // If the file has an extension '.gz' or '.bz2' indicating gzip or bzip2 compression, fetch the next extension if ([pathExtension isEqualToString:@"GZ"] || [pathExtension isEqualToString:@"BZ2"]) { - NSMutableString *pathString = [NSMutableString stringWithString:[selectedFilenames objectAtIndex:0]]; + NSMutableString *pathString = [NSMutableString stringWithString:[selectedUrls[0] path]]; BOOL isGzip = [pathExtension isEqualToString:@"GZ"]; @@ -1637,7 +1637,7 @@ cleanup: NSPipe *filePipe = [[NSPipe alloc] init]; [fileTask setLaunchPath:@"/usr/bin/file"]; - [fileTask setArguments:[NSArray arrayWithObjects:@"-L", @"-b", [selectedFilenames objectAtIndex:0], nil]]; + [fileTask setArguments:[NSArray arrayWithObjects:@"-L", @"-b", [selectedUrls[0] path], nil]]; [fileTask setStandardOutput:filePipe]; NSFileHandle *fileHandle = [filePipe fileHandleForReading]; diff --git a/Source/SPDatabaseDocument.h b/Source/SPDatabaseDocument.h index 62aa11d7..c708cd9f 100644 --- a/Source/SPDatabaseDocument.h +++ b/Source/SPDatabaseDocument.h @@ -67,7 +67,7 @@ /** * The SPDatabaseDocument class controls the primary database view window. */ -@interface SPDatabaseDocument : NSObject <SPConnectionControllerDelegateProtocol, SPMySQLConnectionDelegate, NSTextFieldDelegate, NSToolbarDelegate, SPCountedObject> +@interface SPDatabaseDocument : NSObject <SPConnectionControllerDelegateProtocol, SPMySQLConnectionDelegate, NSTextFieldDelegate, NSToolbarDelegate, SPCountedObject, WebFrameLoadDelegate> { #ifdef SP_CODA /* patch */ id delegate; diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index ab7f2a5d..bd4233ae 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -5752,7 +5752,7 @@ static int64_t SPDatabaseDocumentInstanceCounter = 0; - (void)setActivityPaneHidden:(NSNumber*)hide { - if(![hide integerValue] == 1) { + if(hide.boolValue) { [tableInfoScrollView setHidden:YES]; [documentActivityScrollView setHidden:NO]; } else { diff --git a/Source/SPDatabaseRename.m b/Source/SPDatabaseRename.m index 04f71182..a6b393be 100644 --- a/Source/SPDatabaseRename.m +++ b/Source/SPDatabaseRename.m @@ -55,7 +55,7 @@ if (!sourceExists || targetExists) return NO; NSArray *tables = [tablesList allTableNames]; - NSArray *views = [tablesList allViewNames]; +// NSArray *views = [tablesList allViewNames]; // TODO: handle views when renaming database BOOL success = [self createDatabase:targetDatabase withEncoding:[sourceDatabase defaultEncoding] diff --git a/Source/SPExportControllerDelegate.m b/Source/SPExportControllerDelegate.m index 0f18ef25..8c020fc3 100644 --- a/Source/SPExportControllerDelegate.m +++ b/Source/SPExportControllerDelegate.m @@ -335,8 +335,8 @@ static inline BOOL IS_STRING(id x); timestamp:0 windowNumber:[[exportCustomFilenameTokenField window] windowNumber] context:[NSGraphicsContext currentContext] - characters:nil - charactersIgnoringModifiers:nil + characters:@"" + charactersIgnoringModifiers:@"" isARepeat:NO keyCode:0x24]; diff --git a/Source/SPExportInitializer.m b/Source/SPExportInitializer.m index 15e9de66..3238ea5c 100644 --- a/Source/SPExportInitializer.m +++ b/Source/SPExportInitializer.m @@ -47,6 +47,7 @@ #import "SPExportFileNameTokenObject.h" #import "SPConnectionControllerDelegateProtocol.h" #import "SPExportController+SharedPrivateAPI.h" +#import "SPSQLExporterDelegate.h" #import <SPMySQL/SPMySQL.h> diff --git a/Source/SPExportSettingsPersistence.m b/Source/SPExportSettingsPersistence.m index 29a981af..33118e84 100644 --- a/Source/SPExportSettingsPersistence.m +++ b/Source/SPExportSettingsPersistence.m @@ -127,6 +127,7 @@ static inline void SetOnOff(NSNumber *ref,id obj); NAMEOF(SPPDFExport); NAMEOF(SPHTMLExport); NAMEOF(SPExcelExport); + NAMEOF(SPAnyExportType); } return nil; } diff --git a/Source/SPFavoriteNode.m b/Source/SPFavoriteNode.m index b51980f7..bff760a1 100644 --- a/Source/SPFavoriteNode.m +++ b/Source/SPFavoriteNode.m @@ -81,7 +81,10 @@ static NSString *SPFavoriteNodeKey = @"SPFavoriteNode"; - (id)initWithCoder:(NSCoder *)coder { -#warning This is not a valid initializer. + if (!(self = [super init])) { + return nil; + } + [self setNodeFavorite:[coder decodeObjectForKey:SPFavoriteNodeKey]]; return self; diff --git a/Source/SPGroupNode.m b/Source/SPGroupNode.m index e1a0dfb3..e54f3652 100644 --- a/Source/SPGroupNode.m +++ b/Source/SPGroupNode.m @@ -98,7 +98,10 @@ static NSString *SPGroupNodeIsExpandedKey = @"SPGroupNodeIsExpanded"; - (id)initWithCoder:(NSCoder *)coder { -#warning This is not a valid initializer. + if (!(self = [super init])) { + return nil; + } + [self setNodeName:[coder decodeObjectForKey:SPGroupNodeNameKey]]; [self setNodeIsExpanded:[[coder decodeObjectForKey:SPGroupNodeIsExpandedKey] boolValue]]; diff --git a/Source/SPImageView.m b/Source/SPImageView.m index 23e95859..d56b7fa5 100644 --- a/Source/SPImageView.m +++ b/Source/SPImageView.m @@ -72,7 +72,7 @@ NSData *pngData = nil; NSBitmapImageRep *draggedImage = [[NSBitmapImageRep alloc] initWithData:[[sender draggingPasteboard] dataForType:@"NSTIFFPboardType"]]; if (draggedImage) { - pngData = [draggedImage representationUsingType:NSPNGFileType properties:nil]; + pngData = [draggedImage representationUsingType:NSPNGFileType properties:@{}]; [draggedImage release]; } if (pngData) { @@ -91,7 +91,7 @@ [draggedImage drawInRect:[draggedImage boundingBox]]; NSBitmapImageRep *bitmapImageRep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:[draggedImage boundingBox]]; if (bitmapImageRep) { - pngData = [bitmapImageRep representationUsingType:NSPNGFileType properties:nil]; + pngData = [bitmapImageRep representationUsingType:NSPNGFileType properties:@{}]; [bitmapImageRep release]; } [convertImage unlockFocus]; diff --git a/Source/SPPreferencesUpgrade.m b/Source/SPPreferencesUpgrade.m index 6d0a3393..11cd146c 100644 --- a/Source/SPPreferencesUpgrade.m +++ b/Source/SPPreferencesUpgrade.m @@ -32,6 +32,7 @@ #import "SPKeychain.h" #import "SPFavoritesController.h" #import "SPTreeNode.h" +#import "SPFavoriteNode.h" static NSString *SPOldFavoritesKey = @"favorites"; static NSString *SPOldDefaultEncodingKey = @"DefaultEncoding"; @@ -354,7 +355,7 @@ void SPApplyRevisionChanges(void) for(SPTreeNode *node in favs) { if([node isGroup]) continue; - NSMutableDictionary *data = [[node representedObject] nodeFavorite]; + NSMutableDictionary *data = [(SPFavoriteNode *)[node representedObject] nodeFavorite]; if(![data objectForKey:SPFavoriteColorIndexKey]) [data setObject:@(-1) forKey:SPFavoriteColorIndexKey]; } diff --git a/Source/SPQueryDocumentsController.m b/Source/SPQueryDocumentsController.m index e4689c41..a9602b61 100644 --- a/Source/SPQueryDocumentsController.m +++ b/Source/SPQueryDocumentsController.m @@ -31,6 +31,7 @@ #import "SPQueryDocumentsController.h" #import "SPCustomQuery.h" #import "SPAppController.h" +#import "SPAppleScriptSupport.h" @implementation SPQueryController (SPQueryDocumentsController) diff --git a/Source/SPTableContent.h b/Source/SPTableContent.h index 9ce2299a..ac720d01 100644 --- a/Source/SPTableContent.h +++ b/Source/SPTableContent.h @@ -305,7 +305,7 @@ - (void)setFilterTableData:(NSData *)arcData; - (NSData *)filterTableData; -- (NSString *)escapeFilterArgument:(NSString *)argument againstClause:(NSString *)clause; +//- (NSString *)escapeFilterArgument:(NSString *)argument againstClause:(NSString *)clause; - (void)openContentFilterManager; - (NSArray *)fieldEditStatusForRow:(NSInteger)rowIndex andColumn:(NSInteger)columnIndex; diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index bf45e9c5..d39edd73 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -2964,7 +2964,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper // Edit row selected - reselect the row, and start editing. if ( returnCode == NSAlertDefaultReturn ) { [tableContentView selectRowIndexes:[NSIndexSet indexSetWithIndex:currentlyEditingRow] byExtendingSelection:NO]; - [tableContentView performSelector:@selector(keyDown:) withObject:[NSEvent keyEventWithType:NSKeyDown location:NSMakePoint(0,0) modifierFlags:0 timestamp:0 windowNumber:[[tableContentView window] windowNumber] context:[NSGraphicsContext currentContext] characters:nil charactersIgnoringModifiers:nil isARepeat:NO keyCode:0x24] afterDelay:0.0]; + [tableContentView performSelector:@selector(keyDown:) withObject:[NSEvent keyEventWithType:NSKeyDown location:NSMakePoint(0,0) modifierFlags:0 timestamp:0 windowNumber:[[tableContentView window] windowNumber] context:[NSGraphicsContext currentContext] characters:@"" charactersIgnoringModifiers:@"" isARepeat:NO keyCode:0x24] afterDelay:0.0]; } else { diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m index 6e94bf88..d17d1807 100644 --- a/Source/SPTableStructure.m +++ b/Source/SPTableStructure.m @@ -1203,7 +1203,7 @@ static inline SPFieldTypeHelp *MakeFieldTypeHelp(NSString *typeName,NSString *ty // Problem: reentering edit mode for first cell doesn't function [tableSourceView selectRowIndexes:[NSIndexSet indexSetWithIndex:currentlyEditingRow] byExtendingSelection:NO]; - [tableSourceView performSelector:@selector(keyDown:) withObject:[NSEvent keyEventWithType:NSKeyDown location:NSMakePoint(0,0) modifierFlags:0 timestamp:0 windowNumber:[[tableDocumentInstance parentWindow] windowNumber] context:[NSGraphicsContext currentContext] characters:nil charactersIgnoringModifiers:nil isARepeat:NO keyCode:0x24] afterDelay:0.0]; + [tableSourceView performSelector:@selector(keyDown:) withObject:[NSEvent keyEventWithType:NSKeyDown location:NSMakePoint(0,0) modifierFlags:0 timestamp:0 windowNumber:[[tableDocumentInstance parentWindow] windowNumber] context:[NSGraphicsContext currentContext] characters:@"" charactersIgnoringModifiers:@"" isARepeat:NO keyCode:0x24] afterDelay:0.0]; } // Discard changes and cancel editing diff --git a/Source/SPTableStructureDelegate.m b/Source/SPTableStructureDelegate.m index 42a9eaa3..4c6e2db3 100644 --- a/Source/SPTableStructureDelegate.m +++ b/Source/SPTableStructureDelegate.m @@ -760,7 +760,7 @@ static void _BuildMenuWithPills(NSMenu *menu,struct _cmpMap *map,size_t mapEntri #pragma mark - #pragma mark Menu delegate methods (encoding/collation dropdown menu) -- (void)menuNeedsUpdate:(NSMenu *)menu +- (void)menuNeedsUpdate:(SPIdMenu *)menu { if(![menu isKindOfClass:[SPIdMenu class]]) return; //NOTE: NSTableView will usually copy the menu and call this method on the copy. Matching with == won't work! diff --git a/Source/SPTablesList.h b/Source/SPTablesList.h index 198f327f..433879ea 100644 --- a/Source/SPTablesList.h +++ b/Source/SPTablesList.h @@ -143,66 +143,66 @@ } // IBAction methods -- (IBAction)updateTables:(id)sender; -- (IBAction)addTable:(id)sender; -- (IBAction)closeSheet:(id)sender; -- (IBAction)removeTable:(id)sender; +- (IBAction)updateTables:(nullable id)sender; +- (IBAction)addTable:(nullable id)sender; +- (IBAction)closeSheet:(nullable id)sender; +- (IBAction)removeTable:(nullable id)sender; #ifndef SP_CODA /* method decls */ -- (IBAction)copyTable:(id)sender; -- (IBAction)renameTable:(id)sender; -- (IBAction)truncateTable:(id)sender; -- (IBAction)openTableInNewTab:(id)sender; -- (IBAction)openTableInNewWindow:(id)sender; -- (IBAction)togglePaneCollapse:(id)sender; +- (IBAction)copyTable:(nullable id)sender; +- (IBAction)renameTable:(nullable id)sender; +- (IBAction)truncateTable:(nullable id)sender; +- (IBAction)openTableInNewTab:(nullable id)sender; +- (IBAction)openTableInNewWindow:(nullable id)sender; +- (IBAction)togglePaneCollapse:(nullable id)sender; #endif // Additional methods -- (void)setConnection:(SPMySQLConnection *)theConnection; -- (void)setSelectionState:(NSDictionary *)selectionDetails; +- (void)setConnection:(nonnull SPMySQLConnection *)theConnection; +- (void)setSelectionState:(nullable NSDictionary *)selectionDetails; #ifndef SP_CODA /* method decls */ -- (void)selectTableAtIndex:(NSNumber *)row; +- (void)selectTableAtIndex:(nullable NSNumber *)row; - (void)makeTableListFilterHaveFocus; - (void)makeTableListHaveFocus; #endif // Getters -- (NSArray *)selectedTableNames; -- (NSArray *)selectedTableItems; -- (NSArray *)selectedTableTypes; -- (NSString *)tableName; +- (nonnull NSArray *)selectedTableNames; +- (nonnull NSArray *)selectedTableItems; +- (nonnull NSArray *)selectedTableTypes; +- (nullable NSString *)tableName; - (SPTableType)tableType; -- (NSArray *)tables; -- (NSArray *)tableTypes; -- (NSArray *)allTableAndViewNames; -- (NSArray *)allTableNames; -- (NSArray *)allViewNames; -- (NSArray *)allFunctionNames; -- (NSArray *)allProcedureNames; -- (NSArray *)allEventNames; -- (NSArray *)allDatabaseNames; -- (NSArray *)allSystemDatabaseNames; -- (NSString *)selectedDatabase; +- (nonnull NSArray *)tables; +- (nonnull NSArray *)tableTypes; +- (nonnull NSArray *)allTableAndViewNames; +- (nonnull NSArray *)allTableNames; +- (nonnull NSArray *)allViewNames; +- (nonnull NSArray *)allFunctionNames; +- (nonnull NSArray *)allProcedureNames; +- (nonnull NSArray *)allEventNames; +- (nonnull NSArray *)allDatabaseNames; +- (nonnull NSArray *)allSystemDatabaseNames; +- (nullable NSString *)selectedDatabase; // Setters -- (BOOL)selectItemWithName:(NSString *)theName; +- (BOOL)selectItemWithName:(nullable NSString *)theName; #ifndef SP_CODA /* method decls */ -- (BOOL)selectItemsWithNames:(NSArray *)theNames; +- (BOOL)selectItemsWithNames:(nonnull NSArray *)theNames; // Table list filter interaction - (void)showFilter; - (void)hideFilter; - (void)clearFilter; #endif -- (IBAction) updateFilter:(id)sender; +- (IBAction) updateFilter:(nullable id)sender; // Task interaction -- (void)startDocumentTaskForTab:(NSNotification *)aNotification; -- (void)endDocumentTaskForTab:(NSNotification *)aNotification; +- (void)startDocumentTaskForTab:(nullable NSNotification *)aNotification; +- (void)endDocumentTaskForTab:(nullable NSNotification *)aNotification; - (void)setTableListSelectability:(BOOL)isSelectable; -- (BOOL)isTableNameValid:(NSString *)tableName forType:(SPTableType)tableType; -- (BOOL)isTableNameValid:(NSString *)tableName forType:(SPTableType)tableType ignoringSelectedTable:(BOOL)ignoreSelectedTable; +- (BOOL)isTableNameValid:(nullable NSString *)tableName forType:(SPTableType)tableType; +- (BOOL)isTableNameValid:(nullable NSString *)tableName forType:(SPTableType)tableType ignoringSelectedTable:(BOOL)ignoreSelectedTable; #ifdef SP_CODA /* method decls */ @property (assign) SPTableStructure* tableSourceInstance; @@ -224,4 +224,7 @@ - (void)tableView:(NSTableView *)aTableView setObjectValue:(id)anObject forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex; #endif + +- (BOOL)selectionShouldChangeInTableView:(nullable NSTableView *)aTableView; + @end diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m index 92f7cae5..67f26c31 100644 --- a/Source/SPTablesList.m +++ b/Source/SPTablesList.m @@ -182,7 +182,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; /** * Loads all table names in array tables and reload the tableView */ -- (IBAction)updateTables:(id)sender +- (IBAction)updateTables:(nullable id)sender { SPMySQLResult *theResult; NSString *previousSelectedTable = nil; @@ -1647,7 +1647,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable"; /** * Table view delegate method */ -- (BOOL)selectionShouldChangeInTableView:(NSTableView *)aTableView +- (BOOL)selectionShouldChangeInTableView:(nullable NSTableView *)aTableView { // Don't allow selection changes while performing a task. if (!tableListIsSelectable) return NO; diff --git a/Source/SPTextView.m b/Source/SPTextView.m index 3c6d7b53..ce5f8454 100644 --- a/Source/SPTextView.m +++ b/Source/SPTextView.m @@ -1122,8 +1122,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS NSPasteboard *pb = [NSPasteboard generalPasteboard]; NSTextStorage *textStorage = [self textStorage]; - NSData *rtf = [textStorage RTFFromRange:[self selectedRange] - documentAttributes:nil]; + NSData *rtf = [textStorage RTFFromRange:[self selectedRange] documentAttributes:@{}]; if (rtf) { diff --git a/Source/SPTooltip.h b/Source/SPTooltip.h index 8777ddff..b0d03de3 100644 --- a/Source/SPTooltip.h +++ b/Source/SPTooltip.h @@ -30,7 +30,7 @@ #import <WebKit/WebKit.h> -@interface SPTooltip : NSWindow +@interface SPTooltip : NSWindow <WebFrameLoadDelegate> { WebView* webView; WebPreferences* webPreferences; diff --git a/Source/SPTreeNode.h b/Source/SPTreeNode.h index aa2edbdc..e05bfa33 100644 --- a/Source/SPTreeNode.h +++ b/Source/SPTreeNode.h @@ -40,23 +40,25 @@ BOOL isGroup; } +@property (nullable, readonly, copy) NSArray<SPTreeNode *> *childNodes; + /** * @property isGroup Indicates whether or not the node is a group. */ @property (readwrite, assign) BOOL isGroup; -- (void)removeObjectFromChildren:(id)object; +- (void)removeObjectFromChildren:(nonnull id)object; -- (NSMutableArray *)descendants; -- (NSMutableArray *)childLeafs; -- (NSMutableArray *)allChildLeafs; -- (NSMutableArray *)groupChildren; +- (nonnull NSMutableArray *)descendants; +- (nonnull NSMutableArray *)childLeafs; +- (nonnull NSMutableArray *)allChildLeafs; +- (nonnull NSMutableArray *)groupChildren; -- (SPTreeNode *)parentFromArray:(NSArray *)array; +- (nullable SPTreeNode *)parentFromArray:(nonnull NSArray *)array; -- (BOOL)isDescendantOfOrOneOfNodes:(NSArray *)nodes; -- (BOOL)isDescendantOfNodes:(NSArray *)nodes; +- (BOOL)isDescendantOfOrOneOfNodes:(nonnull NSArray *)nodes; +- (BOOL)isDescendantOfNodes:(nonnull NSArray *)nodes; -- (NSDictionary *)dictionaryRepresentation; +- (nonnull NSDictionary *)dictionaryRepresentation; @end diff --git a/Source/SPTreeNode.m b/Source/SPTreeNode.m index 22cfb1da..f6d419d8 100644 --- a/Source/SPTreeNode.m +++ b/Source/SPTreeNode.m @@ -37,6 +37,7 @@ static NSString *SPTreeNodeIsGroupKey = @"SPTreeNodeIsGroup"; @implementation SPTreeNode +@dynamic childNodes; @synthesize isGroup; #pragma mark - diff --git a/Source/SPWindowController.m b/Source/SPWindowController.m index d9214ada..b6d04184 100644 --- a/Source/SPWindowController.m +++ b/Source/SPWindowController.m @@ -118,7 +118,6 @@ enum { // Set up a new tab with the connection view as the identifier, add the view, and add it to the tab view NSTabViewItem *newItem = [[[NSTabViewItem alloc] initWithIdentifier:newTableDocument] autorelease]; - [newItem setColor:nil]; //cocoa defaults to [NSColor controlColor] but we want the tabstyle to choose a default color [newItem setView:[newTableDocument databaseView]]; [tabView addTabViewItem:newItem]; |