diff options
author | bamse16 <marius@marius.me.uk> | 2009-03-11 04:26:30 +0000 |
---|---|---|
committer | bamse16 <marius@marius.me.uk> | 2009-03-11 04:26:30 +0000 |
commit | 14e31698388f4472cedf62dbd4f60a5749de0306 (patch) | |
tree | 13cfb496637ae7cfabca806f9d2d7db0d05aea8f /Source/TablesList.m | |
parent | e8d8d6cc38cc92b7201806ed42db50a4c4b324ea (diff) | |
download | sequelpro-14e31698388f4472cedf62dbd4f60a5749de0306.tar.gz sequelpro-14e31698388f4472cedf62dbd4f60a5749de0306.tar.bz2 sequelpro-14e31698388f4472cedf62dbd4f60a5749de0306.zip |
Small fixes clang complained about. Others will follow
Diffstat (limited to 'Source/TablesList.m')
-rw-r--r-- | Source/TablesList.m | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/TablesList.m b/Source/TablesList.m index e1122768..602e4644 100644 --- a/Source/TablesList.m +++ b/Source/TablesList.m @@ -139,8 +139,6 @@ copies a table, if desired with content - (IBAction)copyTable:(id)sender { CMMCPResult *queryResult; - NSScanner *scanner = [NSScanner alloc]; - NSString *scanString; // NSArray *fieldNames; // NSArray *theRow; // NSMutableString *rowValue = [NSMutableString string]; @@ -151,8 +149,9 @@ copies a table, if desired with content if ( [tablesListView numberOfSelectedRows] != 1 ) return; - if ( ![tableSourceInstance saveRowOnDeselect] || ![tableContentInstance saveRowOnDeselect] ) + if ( ![tableSourceInstance saveRowOnDeselect] || ![tableContentInstance saveRowOnDeselect] ) { return; + } [tableWindow endEditingFor:nil]; //open copyTableSheet @@ -187,10 +186,14 @@ copies a table, if desired with content } else { //insert new table name in create syntax and create new table + NSScanner *scanner = [NSScanner alloc]; + NSString *scanString; + [scanner initWithString:[[queryResult fetchRowAsDictionary] objectForKey:@"Create Table"]]; [scanner scanUpToString:@"(" intoString:nil]; [scanner scanUpToString:@"" intoString:&scanString]; [mySQLConnection queryString:[NSString stringWithFormat:@"CREATE TABLE `%@` %@", [copyTableNameField stringValue], scanString]]; + [scanner release]; if ( ![[mySQLConnection getLastErrorMessage] isEqualToString:@""] ) { //error while creating new table |