diff options
author | stuconnolly <stuart02@gmail.com> | 2009-07-21 16:47:11 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2009-07-21 16:47:11 +0000 |
commit | 8b8f3e6cea540b17262aadf6d97a8ad28fe41c03 (patch) | |
tree | ad6bb7f53b03924aa24d0cf5822a27b3bd453592 /Source/TableContent.m | |
parent | 383863f98dfc488db0181e01d39da1bb025d421b (diff) | |
download | sequelpro-8b8f3e6cea540b17262aadf6d97a8ad28fe41c03.tar.gz sequelpro-8b8f3e6cea540b17262aadf6d97a8ad28fe41c03.tar.bz2 sequelpro-8b8f3e6cea540b17262aadf6d97a8ad28fe41c03.zip |
Merge framework integration branch back to trunk. Summary of changes:
- Includes all custom code from subclasses CMMCPConnection and CMMCPResult, meaning they have subsequently been removed from the project.
- All previous Sequel Pro specific code in the above subclasses has been removed in favour of the delegate (currently set to TableDocumet) informing the framework of such information.
- All references to CMMCPConnection and CMMCPResult have subsequently been changed to MCPConnection and MCPResult.
- Framework includes MySQL 5.1.36 client libraries and source headers.
- Framework is now built as a 4-way (32/64 bit, i386/PPC arch) binary.
- All import references to <MCPKit_bundled/MCPKit_bundled.h> have been changed to <MCPKit/MCPKit.h>.
- New script 'build-mysql-client.sh' can be used to build the MySQL client libraries from the MySQL source. See the script's header for a list of available options or run it with no arguments to display it's usage.
Note that there are still a few changes to be made to the framework with regard to removing Sequel Pro specific calls to the delegate. These however can be made later on as they have no effect on functionality and are merely design changes.
Also, note that any future development done on the framework should be made to be as 'generic' as possible, with no Sequel Pro specific references. This should allow the framework to be integrated into another project without the need for SP specific code.
Diffstat (limited to 'Source/TableContent.m')
-rw-r--r-- | Source/TableContent.m | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/Source/TableContent.m b/Source/TableContent.m index 2e7d32c2..5e0def75 100644 --- a/Source/TableContent.m +++ b/Source/TableContent.m @@ -25,13 +25,13 @@ // // More info at <http://code.google.com/p/sequel-pro/> +#import <MCPKit/MCPKit.h> + #import "TableContent.h" #import "TableDocument.h" #import "TablesList.h" #import "CMImageView.h" #import "CMCopyTable.h" -#import "CMMCPConnection.h" -#import "CMMCPResult.h" #import "SPDataCellFormatter.h" #import "SPTableData.h" #import "SPQueryConsole.h" @@ -43,7 +43,6 @@ #import "QLPreviewPanel.h" #import "SPFieldEditorController.h" - @implementation TableContent /** @@ -95,7 +94,7 @@ NSDictionary *columnDefinition; NSTableColumn *theCol; NSString *query; - CMMCPResult *queryResult; + MCPResult *queryResult; BOOL preserveCurrentView = [aTable isEqualToString:selectedTable]; NSString *preservedFilterField = nil, *preservedFilterComparison, *preservedFilterValue; @@ -437,7 +436,7 @@ - (IBAction)reloadTableValues:(id)sender { NSString *queryString; - CMMCPResult *queryResult; + MCPResult *queryResult; //query started [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryWillBePerformed" object:self]; @@ -500,7 +499,7 @@ */ - (IBAction)filterTable:(id)sender { - CMMCPResult *theResult; + MCPResult *theResult; int tag = [[compareField selectedItem] tag]; NSString *compareOperator = @""; NSMutableString *argument = [[NSMutableString alloc] initWithString:[argumentField stringValue]]; @@ -796,7 +795,7 @@ */ { NSMutableArray *tempRow; - CMMCPResult *queryResult; + MCPResult *queryResult; NSDictionary *row; NSArray *dbDataRow = nil; int i; @@ -993,12 +992,12 @@ return currentResult; } +// Additional methods -//additional methods -- (void)setConnection:(CMMCPConnection *)theConnection -/* - sets the connection (received from TableDocument) and makes things that have to be done only once +/** + * Sets the connection (received from TableDocument) and makes things that have to be done only once */ +- (void)setConnection:(MCPConnection *)theConnection { mySQLConnection = theConnection; @@ -1140,7 +1139,7 @@ /* * Fetches the result as an array, with an array for each row in it */ -- (NSArray *)fetchResultAsArray:(CMMCPResult *)theResult +- (NSArray *)fetchResultAsArray:(MCPResult *)theResult { unsigned long numOfRows = [theResult numOfRows]; NSMutableArray *tempResult = [NSMutableArray arrayWithCapacity:numOfRows]; @@ -1199,7 +1198,7 @@ NSArray *columnNames; NSMutableString *queryString; NSString *query; - CMMCPResult *queryResult; + MCPResult *queryResult; id rowObject; NSMutableString *rowValue = [NSMutableString string]; NSString *currentTime = [[NSDate date] descriptionWithCalendarFormat:@"%H:%M:%S" timeZone:nil locale:nil]; @@ -1393,7 +1392,7 @@ */ - (NSString *)argumentForRow:(int)row { - CMMCPResult *theResult; + MCPResult *theResult; NSDictionary *theRow; id tempValue; NSMutableString *value = [NSMutableString string]; @@ -1531,7 +1530,7 @@ NSMutableArray *tempArray = [NSMutableArray array]; NSMutableArray *tempResult = [NSMutableArray array]; NSString *queryString, *wherePart; - CMMCPResult *queryResult; + MCPResult *queryResult; int i, errors; if ( [contextInfo isEqualToString:@"addrow"] ) { @@ -1782,7 +1781,7 @@ */ { NSString *queryString; - CMMCPResult *queryResult; + MCPResult *queryResult; if ( [selectedTable isEqualToString:@""] || !selectedTable ) return; @@ -1941,7 +1940,7 @@ NSArray *tempRow; NSMutableArray *modifiedRow = [NSMutableArray array]; // id theValue; - CMMCPResult *tempResult; + MCPResult *tempResult; // If not isEditingRow and the preference value for not showing blobs is set, check whether the row contains any blobs. if ( [prefs boolForKey:@"LoadBlobsAsNeeded"] && !isEditingRow ) { |