diff options
author | Max <post@wickenrode.com> | 2014-12-26 20:37:39 +0100 |
---|---|---|
committer | Max <post@wickenrode.com> | 2014-12-26 20:37:39 +0100 |
commit | c7362cc8c6d3c02d8e9b5f5a31735bb3fbbf0b02 (patch) | |
tree | 3c22d79aa7532f80999d77236ccca0970c44c3ab /Source/SPFieldMapperController.h | |
parent | 03d11e5d82a7c2a0c5db624020632a7d10b5a13a (diff) | |
download | sequelpro-c7362cc8c6d3c02d8e9b5f5a31735bb3fbbf0b02.tar.gz sequelpro-c7362cc8c6d3c02d8e9b5f5a31735bb3fbbf0b02.tar.bz2 sequelpro-c7362cc8c6d3c02d8e9b5f5a31735bb3fbbf0b02.zip |
************** IMPORTANT: SEE BELOW **************
This change should fix the "slow CSV import dialog" issue on 10.10 (details below). To accomplish that, some major changes had to be made to the CSV import code. PLEASE VERIFY THE CORRECTNESS OF THE NEXT FEW CSV IMPORTS YOU DO!
* Renamed some variables for better search visibility
* Changed some instances where NSNumbers were being compared using "==" instead of "isEqual…" (does not work with object literals!)
* The CSV import dialog would recreate the popup menus on *every* call to "tableView:objectValueFor…". However Instruments suggests that [NSMenu removeAllItems] and [NSMenu addItemsWithTitles:] are **really** expensive, esp. when called multiple times per second (e.g. when scrolling in the table view). This commit moves the popup menu setup into its own method and only calls it when the data actually changes.
* The 'destination table column' was for some reason a NSPopupButtonCell which only ever had one item and sometimes got changed to a NSTextFieldCell in code. I didn't see any need to keep the popup cell and replaced it with a simple text cell.
Diffstat (limited to 'Source/SPFieldMapperController.h')
-rw-r--r-- | Source/SPFieldMapperController.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/SPFieldMapperController.h b/Source/SPFieldMapperController.h index a12adcb8..76b65c49 100644 --- a/Source/SPFieldMapperController.h +++ b/Source/SPFieldMapperController.h @@ -33,7 +33,7 @@ @class SPTablesList; @class SPMySQLConnection; -@interface SPFieldMapperController : NSWindowController <NSTokenFieldCellDelegate> +@interface SPFieldMapperController : NSWindowController <NSTokenFieldCellDelegate, NSMenuDelegate> { IBOutlet SPTableView *fieldMapperTableView; IBOutlet NSScrollView *fieldMapperTableScrollView; @@ -110,9 +110,9 @@ NSMutableArray *fieldMappingTableDefaultValues; NSMutableArray *defaultFieldTypesForComboBox; - NSNumber *doImport; - NSNumber *doNotImport; - NSNumber *isEqual; + NSNumber *doImportKey; + NSNumber *doNotImportKey; + NSNumber *isEqualKey; NSString *doImportString; NSString *doNotImportString; NSString *isEqualString; @@ -135,6 +135,7 @@ NSUInteger windowMinHeigth; NSInteger numberOfImportColumns; NSInteger fieldMappingCurrentRow; + NSInteger firstDefaultItemOffset; BOOL fieldMappingImportArrayIsPreview; BOOL importFieldNamesHeader; |