diff options
author | stuconnolly <stuart02@gmail.com> | 2011-07-11 21:47:07 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2011-07-11 21:47:07 +0000 |
commit | fa36e8280a3e3b02bbb39c152bd08061b302f168 (patch) | |
tree | c13dbb4dc4311a4a413de80429e40b720e5e7bca /Source/SPDataImport.m | |
parent | 79bba63e1bed358c458f49351d8c4836c0fec20b (diff) | |
download | sequelpro-fa36e8280a3e3b02bbb39c152bd08061b302f168.tar.gz sequelpro-fa36e8280a3e3b02bbb39c152bd08061b302f168.tar.bz2 sequelpro-fa36e8280a3e3b02bbb39c152bd08061b302f168.zip |
Minor tidy up.
Diffstat (limited to 'Source/SPDataImport.m')
-rw-r--r-- | Source/SPDataImport.m | 69 |
1 files changed, 34 insertions, 35 deletions
diff --git a/Source/SPDataImport.m b/Source/SPDataImport.m index d1b2b67a..e5d7e36c 100644 --- a/Source/SPDataImport.m +++ b/Source/SPDataImport.m @@ -45,10 +45,10 @@ #define SP_FILE_READ_ERROR_STRING NSLocalizedString(@"File read error", @"File read error title (Import Dialog)") -@interface SPDataImport (PrivateAPI) +@interface SPDataImport () -- (void) _importBackgroundProcess:(NSString *)filename; -- (void) _resetFieldMappingGlobals; +- (void)_importBackgroundProcess:(NSString *)filename; +- (void)_resetFieldMappingGlobals; @end @@ -1683,56 +1683,29 @@ } #pragma mark - - -/** - * Dealloc. - */ -- (void)dealloc -{ - if (fieldMappingImportArray) [fieldMappingImportArray release]; - if (geometryFields) [geometryFields release]; - if (geometryFieldsMapIndex) [geometryFieldsMapIndex release]; - if (bitFields) [bitFields release]; - if (nullableNumericFields) [nullableNumericFields release]; - if (bitFieldsMapIndex) [bitFieldsMapIndex release]; - if (nullableNumericFieldsMapIndex) [nullableNumericFieldsMapIndex release]; - - if (lastFilename) [lastFilename release]; - if (prefs) [prefs release]; - if(selectedTableTarget) [selectedTableTarget release]; - - for (id retainedObject in nibObjectsToRelease) [retainedObject release]; - - [nibObjectsToRelease release]; - - [super dealloc]; -} - -@end - -@implementation SPDataImport (PrivateAPI) +#pragma mark Private API /** * Starts the import process on a background thread. */ -- (void) _importBackgroundProcess:(NSString *)filename +- (void)_importBackgroundProcess:(NSString *)filename { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSString *fileType = [[importFormatPopup selectedItem] title]; - + // Use the appropriate processing function for the file type if ([fileType isEqualToString:@"SQL"]) [self importSQLFile:filename]; else if ([fileType isEqualToString:@"CSV"]) [self importCSVFile:filename]; - + [pool release]; } /** * Release and reset any field mapping global variables. */ -- (void) _resetFieldMappingGlobals +- (void)_resetFieldMappingGlobals { if (csvImportTailString) [csvImportTailString release], csvImportTailString = nil; if (csvImportHeaderString) [csvImportHeaderString release], csvImportHeaderString = nil; @@ -1743,4 +1716,30 @@ if (fieldMapperOperator) [fieldMapperOperator release], fieldMapperOperator = nil; } +#pragma mark - + +/** + * Dealloc. + */ +- (void)dealloc +{ + if (fieldMappingImportArray) [fieldMappingImportArray release]; + if (geometryFields) [geometryFields release]; + if (geometryFieldsMapIndex) [geometryFieldsMapIndex release]; + if (bitFields) [bitFields release]; + if (nullableNumericFields) [nullableNumericFields release]; + if (bitFieldsMapIndex) [bitFieldsMapIndex release]; + if (nullableNumericFieldsMapIndex) [nullableNumericFieldsMapIndex release]; + + if (lastFilename) [lastFilename release]; + if (prefs) [prefs release]; + if(selectedTableTarget) [selectedTableTarget release]; + + for (id retainedObject in nibObjectsToRelease) [retainedObject release]; + + [nibObjectsToRelease release]; + + [super dealloc]; +} + @end |