aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-07-31 18:56:03 +0000
committerstuconnolly <stuart02@gmail.com>2009-07-31 18:56:03 +0000
commit0bbb64b1533540fd989c86219afb1cbe6df36dc6 (patch)
treeefe9bc19690f72fdc8074d1b746d4d0eadf9e84f /Source
parent43f758956eefb4525766f53d6c32ca4caab473a1 (diff)
downloadsequelpro-0bbb64b1533540fd989c86219afb1cbe6df36dc6.tar.gz
sequelpro-0bbb64b1533540fd989c86219afb1cbe6df36dc6.tar.bz2
sequelpro-0bbb64b1533540fd989c86219afb1cbe6df36dc6.zip
The size of the import array only needs to be counted once.
Diffstat (limited to 'Source')
-rw-r--r--Source/TableDump.m11
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/TableDump.m b/Source/TableDump.m
index b4ee6660..321ae9f2 100644
--- a/Source/TableDump.m
+++ b/Source/TableDump.m
@@ -561,6 +561,8 @@
escapedBy:[importFieldsEscapedField stringValue]
lineEnds:[importLinesTerminatedField stringValue]] retain];
+ long importArrayCount = [importArray count];
+
//close progress sheet
[NSApp endSheet:singleProgressSheet];
[singleProgressSheet orderOut:nil];
@@ -568,7 +570,7 @@
[singleProgressBar setUsesThreadedAnimation:NO];
[singleProgressBar setIndeterminate:NO];
- if([importArray count] == 0){
+ if(importArrayCount == 0){
NSBeginAlertSheet(NSLocalizedString(@"Error", @"Error"),
NSLocalizedString(@"OK", @"OK button"),
nil, nil,
@@ -609,8 +611,8 @@
if (fieldMappingArray) [fieldMappingArray release], fieldMappingArray = nil;
[self setupFieldMappingArray];
[rowDownButton setEnabled:NO];
- [rowUpButton setEnabled:([importArray count] > 1)];
- [recordCountLabel setStringValue:[NSString stringWithFormat:@"%i of %i records", currentRow+1, [importArray count]]];
+ [rowUpButton setEnabled:(importArrayCount > 1)];
+ [recordCountLabel setStringValue:[NSString stringWithFormat:@"%i of %i records", currentRow+1, importArrayCount]];
//set up tableView buttons
NSPopUpButtonCell *buttonCell = [[NSPopUpButtonCell alloc] init];
@@ -663,8 +665,7 @@
}
}
- //import array
- long importArrayCount = [importArray count];
+ // import array
long fieldMappingArrayCount = [fieldMappingArray count];
insertFormatString = [NSString stringWithFormat:@"INSERT INTO %@ (%@) VALUES (%%@)",
[[fieldMappingPopup titleOfSelectedItem] backtickQuotedString], fNames];