diff options
author | rowanbeentje <rowan@beent.je> | 2012-02-08 01:42:21 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2012-02-08 01:42:21 +0000 |
commit | 700d4e71f39e7e10f6838543f8f9f2fda81a8eba (patch) | |
tree | 7f3e75b6842ceaa46dee26842c4e8bc7c4de35f2 /Source | |
parent | 36c061403637d5fefc1473ac3b668e54b1341871 (diff) | |
download | sequelpro-700d4e71f39e7e10f6838543f8f9f2fda81a8eba.tar.gz sequelpro-700d4e71f39e7e10f6838543f8f9f2fda81a8eba.tar.bz2 sequelpro-700d4e71f39e7e10f6838543f8f9f2fda81a8eba.zip |
- Cleanup: improve compatibility with 10.7 SDK to reduce compiler warnings
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPAppController.m | 2 | ||||
-rw-r--r-- | Source/SPBundleEditorController.m | 4 | ||||
-rw-r--r-- | Source/SPBundleHTMLOutputController.m | 4 | ||||
-rw-r--r-- | Source/SPConnectionController.m | 2 | ||||
-rw-r--r-- | Source/SPContentFilterManager.m | 9 | ||||
-rw-r--r-- | Source/SPCopyTable.h | 4 | ||||
-rw-r--r-- | Source/SPCopyTable.m | 42 | ||||
-rw-r--r-- | Source/SPCustomQuery.m | 10 | ||||
-rw-r--r-- | Source/SPDataImport.m | 2 | ||||
-rw-r--r-- | Source/SPDatabaseDocument.m | 6 | ||||
-rw-r--r-- | Source/SPEditorPreferencePane.m | 4 | ||||
-rw-r--r-- | Source/SPFavoritesPreferencePane.m | 2 | ||||
-rw-r--r-- | Source/SPFieldEditorController.m | 27 | ||||
-rw-r--r-- | Source/SPIndexesController.h | 3 | ||||
-rw-r--r-- | Source/SPNavigatorController.m | 2 | ||||
-rw-r--r-- | Source/SPNotLoaded.m | 2 | ||||
-rw-r--r-- | Source/SPProcessListController.m | 2 | ||||
-rw-r--r-- | Source/SPQueryController.m | 6 | ||||
-rw-r--r-- | Source/SPQueryFavoriteManager.m | 8 | ||||
-rw-r--r-- | Source/SPServerVariablesController.m | 6 | ||||
-rw-r--r-- | Source/SPTableContent.h | 6 | ||||
-rw-r--r-- | Source/SPTableContent.m | 20 | ||||
-rw-r--r-- | Source/SPTableStructure.h | 6 | ||||
-rw-r--r-- | Source/SPTableStructure.m | 14 | ||||
-rw-r--r-- | Source/SPTableStructureDelegate.m | 4 |
25 files changed, 98 insertions, 99 deletions
diff --git a/Source/SPAppController.m b/Source/SPAppController.m index 271dd661..4f4bab2c 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -171,7 +171,7 @@ YY_BUFFER_STATE yy_scan_string (const char *); - (void)panelSelectionDidChange:(id)sender { if ([sender isKindOfClass:[NSOpenPanel class]]) { - if([[[[sender filename] pathExtension] lowercaseString] isEqualToString:SPFileExtensionSQL]) { + if([[[[[sender URL] path] pathExtension] lowercaseString] isEqualToString:SPFileExtensionSQL]) { [encodingPopUp setEnabled:YES]; } else { [encodingPopUp setEnabled:NO]; diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m index 8736375a..8d4d1c65 100644 --- a/Source/SPBundleEditorController.m +++ b/Source/SPBundleEditorController.m @@ -771,7 +771,7 @@ { NSSavePanel *panel = [NSSavePanel savePanel]; - [panel setRequiredFileType:SPUserBundleFileExtension]; + [panel setAllowedFileTypes:[NSArray arrayWithObject:SPUserBundleFileExtension]]; [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:NO]; @@ -1068,7 +1068,7 @@ NSString *bundleFileName = [aBundle objectForKey:kBundleNameKey]; NSString *possibleExisitingBundleFilePath = [NSString stringWithFormat:@"%@/%@.%@", bundlePath, bundleFileName, SPUserBundleFileExtension]; - NSString *savePath = [sheet filename]; + NSString *savePath = [[sheet URL] path]; BOOL isDir; BOOL copyingWasSuccessful = YES; diff --git a/Source/SPBundleHTMLOutputController.m b/Source/SPBundleHTMLOutputController.m index e49cce11..1b37be2e 100644 --- a/Source/SPBundleHTMLOutputController.m +++ b/Source/SPBundleHTMLOutputController.m @@ -185,7 +185,7 @@ if (returnCode == NSOKButton) { NSString *sourceCode = [webView stringByEvaluatingJavaScriptFromString:@"document.getElementsByTagName('html')[0].outerHTML"]; NSError *err = nil; - [sourceCode writeToFile:[sheet filename] + [sourceCode writeToURL:[sheet URL] atomically:YES encoding:NSUTF8StringEncoding error:&err]; @@ -265,7 +265,7 @@ { NSSavePanel *panel = [NSSavePanel savePanel]; - [panel setRequiredFileType:@"html"]; + [panel setAllowedFileTypes:[NSArray arrayWithObject:@"html"]]; [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:YES]; diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index 61c6281c..94af9056 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -675,7 +675,7 @@ - (void)chooseKeyLocationSheetDidEnd:(NSOpenPanel *)openPanel returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo { #ifndef SP_REFACTOR /* !!! ssh key location */ - NSString *abbreviatedFileName = [[openPanel filename] stringByAbbreviatingWithTildeInPath]; + NSString *abbreviatedFileName = [[[openPanel URL] path] stringByAbbreviatingWithTildeInPath]; // SSH key file selection if (contextInfo == sshSSHKeyButton) { diff --git a/Source/SPContentFilterManager.m b/Source/SPContentFilterManager.m index 0d4b7c18..7c6213b2 100644 --- a/Source/SPContentFilterManager.m +++ b/Source/SPContentFilterManager.m @@ -309,7 +309,7 @@ { NSSavePanel *panel = [NSSavePanel savePanel]; - [panel setRequiredFileType:SPFileExtensionDefault]; + [panel setAllowedFileTypes:[NSArray arrayWithObject:SPFileExtensionDefault]]; [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:NO]; @@ -773,12 +773,11 @@ SEL action = [menuItem action]; - if ( (action == @selector(duplicateContentFilter:))) + if (action == @selector(duplicateContentFilter:)) { return ([contentFilterTableView numberOfSelectedRows] == 1); } - else if ( (action == @selector(removeContentFilter:)) || - ( action == @selector(exportFavorites:))) + else if ( (action == @selector(removeContentFilter:)) || (action == @selector(exportFavorites:)) ) { return ([contentFilterTableView numberOfSelectedRows] > 0); } @@ -937,7 +936,7 @@ } NSError *error = nil; - [plist writeToFile:[panel filename] options:NSAtomicWrite error:&error]; + [plist writeToURL:[panel URL] options:NSAtomicWrite error:&error]; if (error) [[NSAlert alertWithError:error] runModal]; } diff --git a/Source/SPCopyTable.h b/Source/SPCopyTable.h index 6009e5d1..84db1e9d 100644 --- a/Source/SPCopyTable.h +++ b/Source/SPCopyTable.h @@ -53,10 +53,10 @@ extern NSInteger SPEditCopyAsSQL; NSUserDefaults *prefs; NSRange fieldEditorSelectedRange; - NSString *copyBlobFileDirectory; + NSString *tmpBlobFileDirectory; } -@property(readwrite,assign) NSString *copyBlobFileDirectory; +@property(readwrite,assign) NSString *tmpBlobFileDirectory; @property(readwrite,assign) NSRange fieldEditorSelectedRange; diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m index e8b1533d..78773412 100644 --- a/Source/SPCopyTable.m +++ b/Source/SPCopyTable.m @@ -58,7 +58,7 @@ static const NSInteger kBlobAsImageFile = 4; * selection in the field editor's editTextView */ @synthesize fieldEditorSelectedRange; -@synthesize copyBlobFileDirectory; +@synthesize tmpBlobFileDirectory; /** * Cell editing in SPCustomQuery or for views in SPTableContent @@ -160,10 +160,10 @@ static const NSInteger kBlobAsImageFile = 4; Class mcpGeometryData = [MCPGeometryData class]; NSUInteger rowCounter = 0; - if((withBlobHandling == kBlobAsFile || withBlobHandling == kBlobAsImageFile) && copyBlobFileDirectory && [copyBlobFileDirectory length]) { + if((withBlobHandling == kBlobAsFile || withBlobHandling == kBlobAsImageFile) && tmpBlobFileDirectory && [tmpBlobFileDirectory length]) { NSFileManager *fm = [NSFileManager defaultManager]; - [fm removeItemAtPath:copyBlobFileDirectory error:nil]; - [fm createDirectoryAtPath:copyBlobFileDirectory withIntermediateDirectories:YES attributes:nil error:nil]; + [fm removeItemAtPath:tmpBlobFileDirectory error:nil]; + [fm createDirectoryAtPath:tmpBlobFileDirectory withIntermediateDirectories:YES attributes:nil error:nil]; } while ( rowIndex != NSNotFound ) @@ -187,13 +187,13 @@ static const NSInteger kBlobAsImageFile = 4; [displayString release]; } } - else if(withBlobHandling == kBlobAsFile && copyBlobFileDirectory && [copyBlobFileDirectory length]) { - NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.dat", copyBlobFileDirectory, rowCounter, c]; + else if(withBlobHandling == kBlobAsFile && tmpBlobFileDirectory && [tmpBlobFileDirectory length]) { + NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.dat", tmpBlobFileDirectory, rowCounter, c]; [cellData writeToFile:fp atomically:NO]; [result appendFormat:@"%@\t", fp]; } - else if(withBlobHandling == kBlobAsImageFile && copyBlobFileDirectory && [copyBlobFileDirectory length]) { - NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.tif", copyBlobFileDirectory, rowCounter, c]; + else if(withBlobHandling == kBlobAsImageFile && tmpBlobFileDirectory && [tmpBlobFileDirectory length]) { + NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.tif", tmpBlobFileDirectory, rowCounter, c]; NSImage *image = [[NSImage alloc] initWithData:cellData]; if (image) { NSData *d = [[NSData alloc] initWithData:[image TIFFRepresentationUsingCompression:NSTIFFCompressionLZW factor:1]]; @@ -211,8 +211,8 @@ static const NSInteger kBlobAsImageFile = 4; } } else if ([cellData isKindOfClass:mcpGeometryData]) { - if((withBlobHandling == kBlobAsFile || withBlobHandling == kBlobAsImageFile) && copyBlobFileDirectory && [copyBlobFileDirectory length]) { - NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.pdf", copyBlobFileDirectory, rowCounter, c]; + if((withBlobHandling == kBlobAsFile || withBlobHandling == kBlobAsImageFile) && tmpBlobFileDirectory && [tmpBlobFileDirectory length]) { + NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.pdf", tmpBlobFileDirectory, rowCounter, c]; SPGeometryDataView *v = [[SPGeometryDataView alloc] initWithCoordinates:[cellData coordinates]]; NSData *thePDF = [v pdfData]; if(thePDF) { @@ -299,10 +299,10 @@ static const NSInteger kBlobAsImageFile = 4; NSUInteger rowCounter = 0; - if((withBlobHandling == kBlobAsFile || withBlobHandling == kBlobAsImageFile) && copyBlobFileDirectory && [copyBlobFileDirectory length]) { + if((withBlobHandling == kBlobAsFile || withBlobHandling == kBlobAsImageFile) && tmpBlobFileDirectory && [tmpBlobFileDirectory length]) { NSFileManager *fm = [NSFileManager defaultManager]; - [fm removeItemAtPath:copyBlobFileDirectory error:nil]; - [fm createDirectoryAtPath:copyBlobFileDirectory withIntermediateDirectories:YES attributes:nil error:nil]; + [fm removeItemAtPath:tmpBlobFileDirectory error:nil]; + [fm createDirectoryAtPath:tmpBlobFileDirectory withIntermediateDirectories:YES attributes:nil error:nil]; } while ( rowIndex != NSNotFound ) @@ -326,13 +326,13 @@ static const NSInteger kBlobAsImageFile = 4; [displayString release]; } } - else if(withBlobHandling == kBlobAsFile && copyBlobFileDirectory && [copyBlobFileDirectory length]) { - NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.dat", copyBlobFileDirectory, rowCounter, c]; + else if(withBlobHandling == kBlobAsFile && tmpBlobFileDirectory && [tmpBlobFileDirectory length]) { + NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.dat", tmpBlobFileDirectory, rowCounter, c]; [cellData writeToFile:fp atomically:NO]; [result appendFormat:@"\"%@\",", fp]; } - else if(withBlobHandling == kBlobAsImageFile && copyBlobFileDirectory && [copyBlobFileDirectory length]) { - NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.tif", copyBlobFileDirectory, rowCounter, c]; + else if(withBlobHandling == kBlobAsImageFile && tmpBlobFileDirectory && [tmpBlobFileDirectory length]) { + NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.tif", tmpBlobFileDirectory, rowCounter, c]; NSImage *image = [[NSImage alloc] initWithData:cellData]; if (image) { NSData *d = [[NSData alloc] initWithData:[image TIFFRepresentationUsingCompression:NSTIFFCompressionLZW factor:1]]; @@ -350,8 +350,8 @@ static const NSInteger kBlobAsImageFile = 4; } } else if ([cellData isKindOfClass:mcpGeometryData]) { - if((withBlobHandling == kBlobAsFile || withBlobHandling == kBlobAsImageFile) && copyBlobFileDirectory && [copyBlobFileDirectory length]) { - NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.pdf", copyBlobFileDirectory, rowCounter, c]; + if((withBlobHandling == kBlobAsFile || withBlobHandling == kBlobAsImageFile) && tmpBlobFileDirectory && [tmpBlobFileDirectory length]) { + NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.pdf", tmpBlobFileDirectory, rowCounter, c]; SPGeometryDataView *v = [[SPGeometryDataView alloc] initWithCoordinates:[cellData coordinates]]; NSData *thePDF = [v pdfData]; if(thePDF) { @@ -1285,9 +1285,9 @@ static const NSInteger kBlobAsImageFile = 4; if(blobHandling != kBlobExclude) { NSString *bundleBlobFilePath = [NSString stringWithFormat:@"%@_%@", SPBundleTaskCopyBlobFileDirectory, uuid]; [env setObject:bundleBlobFilePath forKey:SPBundleShellVariableBlobFileDirectory]; - [self setCopyBlobFileDirectory:bundleBlobFilePath]; + [self setTmpBlobFileDirectory:bundleBlobFilePath]; } else { - [self setCopyBlobFileDirectory:@""]; + [self setTmpBlobFileDirectory:@""]; } if([inputAction isEqualToString:SPBundleInputSourceSelectedTableRowsAsTab]) { diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index 40f73f58..61cac5f6 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -467,7 +467,7 @@ #ifndef SP_REFACTOR NSSavePanel *panel = [NSSavePanel savePanel]; - [panel setRequiredFileType:SPFileExtensionSQL]; + [panel setAllowedFileTypes:[NSArray arrayWithObject:SPFileExtensionSQL]]; [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:YES]; @@ -3592,10 +3592,10 @@ [prefs synchronize]; #endif - [[self buildHistoryString] writeToFile:[panel filename] - atomically:YES - encoding:[[encodingPopUp selectedItem] tag] - error:&error]; + [[self buildHistoryString] writeToURL:[panel URL] + atomically:YES + encoding:[[encodingPopUp selectedItem] tag] + error:&error]; if (error) [[NSAlert alertWithError:error] runModal]; } diff --git a/Source/SPDataImport.m b/Source/SPDataImport.m index b3d19f11..7f90eea7 100644 --- a/Source/SPDataImport.m +++ b/Source/SPDataImport.m @@ -315,7 +315,7 @@ progressCancelled = NO; if(lastFilename) [lastFilename release]; lastFilename = nil; - lastFilename = [[NSString stringWithString:[(NSOpenPanel*)sheet filename]] retain]; + lastFilename = [[NSString stringWithString:[[(NSOpenPanel*)sheet URL] path]] retain]; NSString *importFileName = [NSString stringWithString:lastFilename]; if (lastFilename == nil || ![lastFilename length]) { diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 2e834dd9..53d9b5c6 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -2185,7 +2185,7 @@ static NSString *SPCreateSyntx = @"SPCreateSyntax"; { NSSavePanel *panel = [NSSavePanel savePanel]; - [panel setRequiredFileType:SPFileExtensionSQL]; + [panel setAllowedFileTypes:[NSArray arrayWithObject:SPFileExtensionSQL]]; [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:YES]; @@ -2817,7 +2817,7 @@ static NSString *SPCreateSyntx = @"SPCreateSyntax"; { if ( returnCode ) { - NSString *fileName = [panel filename]; + NSString *fileName = [[panel URL] path]; NSError *error = nil; // Save file as SQL file by using the chosen encoding @@ -3486,7 +3486,7 @@ static NSString *SPCreateSyntx = @"SPCreateSyntax"; if ([createSyntax length] > 0) { NSString *output = [NSString stringWithFormat:@"-- %@ '%@'\n\n%@\n", NSLocalizedString(@"Create syntax for", @"create syntax for table comment"), [self table], createSyntax]; - [output writeToFile:[sheet filename] atomically:YES encoding:NSUTF8StringEncoding error:NULL]; + [output writeToURL:[sheet URL] atomically:YES encoding:NSUTF8StringEncoding error:NULL]; } } } diff --git a/Source/SPEditorPreferencePane.m b/Source/SPEditorPreferencePane.m index 08e91936..f2802180 100644 --- a/Source/SPEditorPreferencePane.m +++ b/Source/SPEditorPreferencePane.m @@ -128,7 +128,7 @@ static NSString *SPCustomColorSchemeNameLC = @"user-defined"; { NSSavePanel *panel = [NSSavePanel savePanel]; - [panel setRequiredFileType:SPColorThemeFileExtension]; + [panel setAllowedFileTypes:[NSArray arrayWithObject:SPColorThemeFileExtension]]; [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:NO]; @@ -521,7 +521,7 @@ static NSString *SPCustomColorSchemeNameLC = @"user-defined"; { if ([contextInfo isEqualToString:SPExportColorScheme]) { if (returnCode == NSOKButton) { - [self _saveColorThemeAtPath:[panel filename]]; + [self _saveColorThemeAtPath:[[panel URL] path]]; } } else if ([contextInfo isEqualToString:SPImportColorScheme]) { diff --git a/Source/SPFavoritesPreferencePane.m b/Source/SPFavoritesPreferencePane.m index 4f640f11..159e8687 100644 --- a/Source/SPFavoritesPreferencePane.m +++ b/Source/SPFavoritesPreferencePane.m @@ -647,7 +647,7 @@ */ - (void)chooseKeyLocationSheetDidEnd:(NSOpenPanel *)openPanel returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo { - NSString *abbreviatedFileName = [[openPanel filename] stringByAbbreviatingWithTildeInPath]; + NSString *abbreviatedFileName = [[[openPanel URL] path] stringByAbbreviatingWithTildeInPath]; // SSH key file selection if (contextInfo == sshSSHKeyButton) { diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m index 7c8a960c..2df24c24 100644 --- a/Source/SPFieldEditorController.m +++ b/Source/SPFieldEditorController.m @@ -548,7 +548,7 @@ NSString *fileDefault = @""; if([editSheetSegmentControl selectedSegment] == 1 && [sheetEditData isKindOfClass:[MCPGeometryData class]]) { - [panel setRequiredFileType:@"pdf"]; + [panel setAllowedFileTypes:[NSArray arrayWithObject:@"pdf"]]; [panel setAllowsOtherFileTypes:NO]; } else { [panel setAllowsOtherFileTypes:YES]; @@ -642,7 +642,6 @@ - (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo { if (returnCode == NSOKButton) { - NSString *fileName = [panel filename]; NSString *contents = nil; editSheetWillBeInitialized = YES; @@ -655,7 +654,7 @@ } // load new data/images - sheetEditData = [[NSData alloc] initWithContentsOfFile:fileName]; + sheetEditData = [[NSData alloc] initWithContentsOfURL:[panel URL]]; NSImage *image = [[NSImage alloc] initWithData:sheetEditData]; contents = [[NSString alloc] initWithData:sheetEditData encoding:encoding]; @@ -710,37 +709,37 @@ [editSheetProgressBar startAnimation:self]; - NSString *fileName = [panel filename]; + NSURL *fileURL = [panel URL]; // Write binary field types directly to the file if ( [sheetEditData isKindOfClass:[NSData class]] ) { - [sheetEditData writeToFile:fileName atomically:YES]; + [sheetEditData writeToURL:fileURL atomically:YES]; } else if ( [sheetEditData isKindOfClass:[MCPGeometryData class]] ) { if ( [editSheetSegmentControl selectedSegment] == 0 || editImage == nil ) { - [[editTextView string] writeToFile:fileName - atomically:YES - encoding:encoding - error:NULL]; + [[editTextView string] writeToURL:fileURL + atomically:YES + encoding:encoding + error:NULL]; } else if (editImage != nil){ SPGeometryDataView *v = [[[SPGeometryDataView alloc] initWithCoordinates:[sheetEditData coordinates] targetDimension:2000.0f] autorelease]; NSData *pdf = [v pdfData]; if(pdf) - [pdf writeToFile:fileName atomically:YES]; + [pdf writeToURL:fileURL atomically:YES]; } } // Write other field types' representations to the file via the current encoding else { - [[sheetEditData description] writeToFile:fileName - atomically:YES - encoding:encoding - error:NULL]; + [[sheetEditData description] writeToURL:fileURL + atomically:YES + encoding:encoding + error:NULL]; } [editSheetProgressBar stopAnimation:self]; diff --git a/Source/SPIndexesController.h b/Source/SPIndexesController.h index 7a139125..7fae2082 100644 --- a/Source/SPIndexesController.h +++ b/Source/SPIndexesController.h @@ -70,7 +70,8 @@ BOOL _mainNibLoaded; NSString *table; - NSMutableArray *fields, *indexes, *indexedFields, *supportsLength, *requiresLength; + NSMutableArray *fields, *indexes, *indexedFields; + NSArray *supportsLength, *requiresLength; #ifndef SP_REFACTOR /* ivars */ NSUserDefaults *prefs; diff --git a/Source/SPNavigatorController.m b/Source/SPNavigatorController.m index ca0a0c69..30b47006 100644 --- a/Source/SPNavigatorController.m +++ b/Source/SPNavigatorController.m @@ -133,7 +133,7 @@ static NSComparisonResult compareStrings(NSString *s1, NSString *s2, void* conte - (id)autorelease { return self; } -- (void)release { } +- (oneway void)release { } #ifndef SP_REFACTOR /** diff --git a/Source/SPNotLoaded.m b/Source/SPNotLoaded.m index 66d6f209..335ccbfa 100644 --- a/Source/SPNotLoaded.m +++ b/Source/SPNotLoaded.m @@ -69,7 +69,7 @@ static SPNotLoaded *notLoaded = nil; - (NSUInteger) retainCount { return NSUIntegerMax; } -- (void) release {} +- (oneway void) release {} - (id) autorelease { return self; } diff --git a/Source/SPProcessListController.m b/Source/SPProcessListController.m index 4e2f60bd..825b598d 100644 --- a/Source/SPProcessListController.m +++ b/Source/SPProcessListController.m @@ -406,7 +406,7 @@ static const NSString *SPTableViewIDColumnIdentifier = @"Id"; [processesString appendString:@"\n"]; } - [processesString writeToFile:[panel filename] atomically:YES encoding:NSUTF8StringEncoding error:NULL]; + [processesString writeToURL:[panel URL] atomically:YES encoding:NSUTF8StringEncoding error:NULL]; } } } diff --git a/Source/SPQueryController.m b/Source/SPQueryController.m index c2c0c1d6..82a19091 100644 --- a/Source/SPQueryController.m +++ b/Source/SPQueryController.m @@ -125,7 +125,7 @@ static SPQueryController *sharedQueryController = nil; - (id)autorelease { return self; } -- (void)release { } +- (oneway void)release { } #pragma mark - #pragma mark QueryConsoleController @@ -205,7 +205,7 @@ static SPQueryController *sharedQueryController = nil; #ifndef SP_REFACTOR NSSavePanel *panel = [NSSavePanel savePanel]; - [panel setRequiredFileType:SPFileExtensionSQL]; + [panel setAllowedFileTypes:[NSArray arrayWithObject:SPFileExtensionSQL]]; [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:YES]; @@ -302,7 +302,7 @@ static SPQueryController *sharedQueryController = nil; { #ifndef SP_REFACTOR if (returnCode == NSOKButton) { - [[self _getConsoleStringWithTimeStamps:[includeTimeStampsButton state] connections:[includeConnectionButton state]] writeToFile:[sheet filename] atomically:YES encoding:NSUTF8StringEncoding error:NULL]; + [[self _getConsoleStringWithTimeStamps:[includeTimeStampsButton state] connections:[includeConnectionButton state]] writeToFile:[[sheet URL] path] atomically:YES encoding:NSUTF8StringEncoding error:NULL]; } #endif } diff --git a/Source/SPQueryFavoriteManager.m b/Source/SPQueryFavoriteManager.m index 90575e33..28f824fe 100644 --- a/Source/SPQueryFavoriteManager.m +++ b/Source/SPQueryFavoriteManager.m @@ -299,7 +299,7 @@ { NSSavePanel *panel = [NSSavePanel savePanel]; - [panel setRequiredFileType:SPFileExtensionSQL]; + [panel setAllowedFileTypes:[NSArray arrayWithObject:SPFileExtensionSQL]]; [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:YES]; @@ -319,7 +319,7 @@ { NSSavePanel *panel = [NSSavePanel savePanel]; - [panel setRequiredFileType:SPFileExtensionDefault]; + [panel setAllowedFileTypes:[NSArray arrayWithObject:SPFileExtensionDefault]]; [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:NO]; @@ -828,7 +828,7 @@ [prefs synchronize]; #endif - [[favoriteQueryTextView string] writeToFile:[panel filename] atomically:YES encoding:[[encodingPopUp selectedItem] tag] error:&error]; + [[favoriteQueryTextView string] writeToURL:[panel URL] atomically:YES encoding:[[encodingPopUp selectedItem] tag] error:&error]; if (error) [[NSAlert alertWithError:error] runModal]; } @@ -873,7 +873,7 @@ } NSError *error = nil; - [plist writeToFile:[panel filename] options:NSAtomicWrite error:&error]; + [plist writeToURL:[panel URL] options:NSAtomicWrite error:&error]; if (error) [[NSAlert alertWithError:error] runModal]; } diff --git a/Source/SPServerVariablesController.m b/Source/SPServerVariablesController.m index f2eb60e0..5b9114d8 100644 --- a/Source/SPServerVariablesController.m +++ b/Source/SPServerVariablesController.m @@ -124,8 +124,8 @@ { NSSavePanel *panel = [NSSavePanel savePanel]; - [panel setRequiredFileType:@"cnf"]; - + [panel setAllowedFileTypes:[NSArray arrayWithObject:@"cnf"]]; + [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:YES]; [panel setCanSelectHiddenExtension:YES]; @@ -174,7 +174,7 @@ [variablesString appendFormat:@"%@ = %@\n", [variable objectForKey:@"Variable_name"], [variable objectForKey:@"Value"]]; } - [variablesString writeToFile:[panel filename] atomically:YES encoding:NSUTF8StringEncoding error:NULL]; + [variablesString writeToURL:[panel URL] atomically:YES encoding:NSUTF8StringEncoding error:NULL]; } } } diff --git a/Source/SPTableContent.h b/Source/SPTableContent.h index cc965e19..90cfc40c 100644 --- a/Source/SPTableContent.h +++ b/Source/SPTableContent.h @@ -51,7 +51,7 @@ IBOutlet id argumentField; IBOutlet id filterButton; IBOutlet id addButton; - IBOutlet id copyButton; + IBOutlet id duplicateButton; IBOutlet id removeButton; IBOutlet id reloadButton; #ifndef SP_REFACTOR @@ -189,7 +189,7 @@ // Edit methods - (IBAction)addRow:(id)sender; -- (IBAction)copyRow:(id)sender; +- (IBAction)duplicateRow:(id)sender; - (IBAction)removeRow:(id)sender; - (void)removeRowSheetDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(NSString *)contextInfo; @@ -271,7 +271,7 @@ @property (assign) id secondBetweenField; @property (assign) id argumentField; @property (assign) NSButton* addButton; -@property (assign) NSButton* copyButton; +@property (assign) NSButton* duplicateButton; @property (assign) NSButton* removeButton; @property (assign) NSButton* reloadButton; @property (assign) NSButton* paginationNextButton; diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 14f07866..a1ff0daa 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -67,7 +67,7 @@ @synthesize argumentField; @synthesize betweenTextField; @synthesize compareField; -@synthesize copyButton; +@synthesize duplicateButton; @synthesize fieldField; @synthesize filterButton; @synthesize firstBetweenField; @@ -453,7 +453,7 @@ // Disable table action buttons [addButton setEnabled:NO]; - [copyButton setEnabled:NO]; + [duplicateButton setEnabled:NO]; [removeButton setEnabled:NO]; // Clear restoration settings @@ -699,7 +699,7 @@ // Set the state of the table buttons [addButton setEnabled:(enableInteraction && [tablesListInstance tableType] == SPTableTypeTable)]; - [copyButton setEnabled:NO]; + [duplicateButton setEnabled:NO]; [removeButton setEnabled:NO]; // Reset the table store if required - basically if the table is being changed, @@ -1787,7 +1787,7 @@ /** * Copies a row of the table-array and goes into edit mode */ -- (IBAction)copyRow:(id)sender +- (IBAction)duplicateRow:(id)sender { NSMutableArray *tempRow; MCPResult *queryResult; @@ -4270,15 +4270,15 @@ // and update the status of the delete/duplicate buttons if([tablesListInstance tableType] == SPTableTypeTable) { if ([tableContentView numberOfSelectedRows] > 0) { - [copyButton setEnabled:([tableContentView numberOfSelectedRows] == 1)]; + [duplicateButton setEnabled:([tableContentView numberOfSelectedRows] == 1)]; [removeButton setEnabled:YES]; } else { - [copyButton setEnabled:NO]; + [duplicateButton setEnabled:NO]; [removeButton setEnabled:NO]; } } else { - [copyButton setEnabled:NO]; + [duplicateButton setEnabled:NO]; [removeButton setEnabled:NO]; } } @@ -4645,7 +4645,7 @@ [addButton setEnabled:NO]; [removeButton setEnabled:NO]; - [copyButton setEnabled:NO]; + [duplicateButton setEnabled:NO]; [reloadButton setEnabled:NO]; [filterButton setEnabled:NO]; tableRowsSelectable = NO; @@ -4678,7 +4678,7 @@ if ([tableContentView numberOfSelectedRows] > 0) { if([tablesListInstance tableType] == SPTableTypeTable) { [removeButton setEnabled:YES]; - [copyButton setEnabled:YES]; + [duplicateButton setEnabled:YES]; } } @@ -4842,7 +4842,7 @@ } // Duplicate row - if (action == @selector(copyRow:)) { + if (action == @selector(duplicateRow:)) { return (([tableContentView numberOfSelectedRows]) == 1 && ([tablesListInstance tableType] == SPTableTypeTable)); } diff --git a/Source/SPTableStructure.h b/Source/SPTableStructure.h index ce0302fa..63ac74b8 100644 --- a/Source/SPTableStructure.h +++ b/Source/SPTableStructure.h @@ -50,7 +50,7 @@ #endif IBOutlet SPTableView* tableSourceView; IBOutlet id addFieldButton; - IBOutlet id copyFieldButton; + IBOutlet id duplicateFieldButton; IBOutlet id removeFieldButton; IBOutlet id reloadFieldsButton; #ifndef SP_REFACTOR /* ivars */ @@ -95,7 +95,7 @@ @property (assign) SPIndexesController* indexesController; @property (assign) id indexesTableView; @property (assign) id addFieldButton; -@property (assign) id copyFieldButton; +@property (assign) id duplicateFieldButton; @property (assign) id removeFieldButton; @property (assign) id reloadFieldsButton; #endif @@ -117,7 +117,7 @@ // Edit methods - (IBAction)addField:(id)sender; -- (IBAction)copyField:(id)sender; +- (IBAction)duplicateField:(id)sender; - (IBAction)removeField:(id)sender; - (void)removeFieldSheetDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo; - (IBAction)resetAutoIncrement:(id)sender; diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m index 5993a933..f9c56eb9 100644 --- a/Source/SPTableStructure.m +++ b/Source/SPTableStructure.m @@ -49,7 +49,7 @@ @synthesize indexesController; @synthesize indexesTableView; @synthesize addFieldButton; -@synthesize copyFieldButton; +@synthesize duplicateFieldButton; @synthesize removeFieldButton; @synthesize reloadFieldsButton; #endif @@ -440,7 +440,7 @@ [enumFields removeAllObjects]; [indexesTableView deselectAll:self]; [addFieldButton setEnabled:NO]; - [copyFieldButton setEnabled:NO]; + [duplicateFieldButton setEnabled:NO]; [removeFieldButton setEnabled:NO]; #ifndef SP_REFACTOR [addIndexButton setEnabled:NO]; @@ -619,7 +619,7 @@ /** * Copies a field and goes in edit mode for the new field */ -- (IBAction)copyField:(id)sender +- (IBAction)duplicateField:(id)sender { NSMutableDictionary *tempRow; NSUInteger rowToCopy; @@ -1221,7 +1221,7 @@ [tableSourceView reloadData]; [indexesTableView reloadData]; [addFieldButton setEnabled:NO]; - [copyFieldButton setEnabled:NO]; + [duplicateFieldButton setEnabled:NO]; [removeFieldButton setEnabled:NO]; #ifndef SP_REFACTOR [addIndexButton setEnabled:NO]; @@ -1318,7 +1318,7 @@ } // Duplicate field - if ([menuItem action] == @selector(copyField:)) { + if ([menuItem action] == @selector(duplicateField:)) { return ([tableSourceView numberOfSelectedRows] == 1); } @@ -1577,7 +1577,7 @@ [tableSourceView setEnabled:NO]; [addFieldButton setEnabled:NO]; [removeFieldButton setEnabled:NO]; - [copyFieldButton setEnabled:NO]; + [duplicateFieldButton setEnabled:NO]; [reloadFieldsButton setEnabled:NO]; #ifndef SP_REFACTOR [editTableButton setEnabled:NO]; @@ -1609,7 +1609,7 @@ if (editingEnabled && [tableSourceView numberOfSelectedRows] > 0) { [removeFieldButton setEnabled:YES]; - [copyFieldButton setEnabled:YES]; + [duplicateFieldButton setEnabled:YES]; } [reloadFieldsButton setEnabled:YES]; diff --git a/Source/SPTableStructureDelegate.m b/Source/SPTableStructureDelegate.m index 1daac497..997bfea2 100644 --- a/Source/SPTableStructureDelegate.m +++ b/Source/SPTableStructureDelegate.m @@ -403,7 +403,7 @@ // If we are editing a row, attempt to save that row - if saving failed, reselect the edit row. if (isEditingRow && [tableSourceView selectedRow] != currentlyEditingRow && ![self saveRowOnDeselect]) return; - [copyFieldButton setEnabled:YES]; + [duplicateFieldButton setEnabled:YES]; // Check if there is currently a field selected and change button state accordingly if ([tableSourceView numberOfSelectedRows] > 0 && [tablesListInstance tableType] == SPTableTypeTable) { @@ -411,7 +411,7 @@ } else { [removeFieldButton setEnabled:NO]; - [copyFieldButton setEnabled:NO]; + [duplicateFieldButton setEnabled:NO]; } // If the table only has one field, disable the remove button. This removes the need to check that the user |