diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-03-19 07:34:54 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-03-19 07:34:54 +0000 |
commit | 5f5c57ab20f536145491e9b25b1a72fae5bb29cc (patch) | |
tree | 2db18c7e3a207f51949c5b27361bc6b4b1f3de9a /Source/SPNavigatorController.m | |
parent | 0efe0ba02c0b6a562496a0d87325e61f8da7fbfe (diff) | |
download | sequelpro-5f5c57ab20f536145491e9b25b1a72fae5bb29cc.tar.gz sequelpro-5f5c57ab20f536145491e9b25b1a72fae5bb29cc.tar.bz2 sequelpro-5f5c57ab20f536145491e9b25b1a72fae5bb29cc.zip |
• some progress re Navigator
Diffstat (limited to 'Source/SPNavigatorController.m')
-rw-r--r-- | Source/SPNavigatorController.m | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/Source/SPNavigatorController.m b/Source/SPNavigatorController.m index 1dda5af3..e2edc2c2 100644 --- a/Source/SPNavigatorController.m +++ b/Source/SPNavigatorController.m @@ -87,8 +87,6 @@ static SPNavigatorController *sharedNavigatorController = nil; { prefs = [NSUserDefaults standardUserDefaults]; - // [self updateEntries:self]; - [self setWindowFrameAutosaveName:@"SPNavigator"]; } @@ -112,10 +110,14 @@ static SPNavigatorController *sharedNavigatorController = nil; connectionName = [doc host]; if(![schemaData objectForKey:connectionName]) { id data = [[doc valueForKeyPath:@"mySQLConnection"] getDbStructure]; - if(data) + if(data) { [schemaData setObject:data forKey:connectionName]; - else - [schemaData setObject:@"No data available" forKey:connectionName]; + } else { + if([[doc valueForKeyPath:@"mySQLConnection"] serverMajorVersion] > 4) + [schemaData setObject:[NSDictionary dictionary] forKey:[NSString stringWithFormat:@"%@ – no data loaded yet", connectionName]]; + else + [schemaData setObject:[NSDictionary dictionary] forKey:[NSString stringWithFormat:@"%@ – no data for this server version", connectionName]]; + } } } [outlineSchema1 reloadData]; @@ -165,13 +167,8 @@ static SPNavigatorController *sharedNavigatorController = nil; if(item == nil) return [schemaData count]; - if([item isKindOfClass:[NSDictionary class]]) { - // if([item objectForKey:@" struct_type "]) - // return [item count] - 1; - // else - return [item count]; - } - + if([item isKindOfClass:[NSDictionary class]]) + return [item count]; return 0; } @@ -215,11 +212,8 @@ static SPNavigatorController *sharedNavigatorController = nil; [[tableColumn dataCell] setImage:[NSImage imageNamed:@"network-small"]]; } if([[parentObject allKeysForObject:item] count]) - // if(![[[parentObject allKeysForObject:item] objectAtIndex:0] hasPrefix:@" "]) - // return [[parentObject allKeysForObject:item] objectAtIndex:0]; - // return [[parentObject allKeysForObject:item] componentsJoinedByString:@"|"]; - - return [NSString stringWithFormat:@"%@ %ld", [[parentObject allKeysForObject:item] description], [outlineView levelForItem:item]]; + if(![[[parentObject allKeysForObject:item] objectAtIndex:0] hasPrefix:@" "]) + return [[parentObject allKeysForObject:item] objectAtIndex:0]; return nil; } @@ -258,7 +252,7 @@ static SPNavigatorController *sharedNavigatorController = nil; if([[[parentObject allKeysForObject:item] objectAtIndex:0] hasPrefix:@" "]) return 5.0; - return 148.0; + return 17.0; } - (BOOL)outlineView:(NSOutlineView *)outlineView shouldExpandItem:(id)item |