diff options
author | stuconnolly <stuart02@gmail.com> | 2011-03-07 20:12:52 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2011-03-07 20:12:52 +0000 |
commit | 1e5288e9840e201a00bcb5ca3035d7aa807f1f8d (patch) | |
tree | 0c1a47953f57b71c41cc7a63e156629c6c9d645b /Source/SPConnectionController.m | |
parent | 915a3831525bf3a9350648d82f86dd54ae366292 (diff) | |
download | sequelpro-1e5288e9840e201a00bcb5ca3035d7aa807f1f8d.tar.gz sequelpro-1e5288e9840e201a00bcb5ca3035d7aa807f1f8d.tar.bz2 sequelpro-1e5288e9840e201a00bcb5ca3035d7aa807f1f8d.zip |
Bring outline view branch up to date with trunk (r3203:r3224).
Diffstat (limited to 'Source/SPConnectionController.m')
-rw-r--r-- | Source/SPConnectionController.m | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index d3c75e16..b5ab8010 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -35,6 +35,9 @@ #import "SPTableTextFieldCell.h" #import "SPFavoritesController.h" #import "SPFavoriteNode.h" +#import "SPGeneralPreferencePane.h" +#import "SPDatabaseViewController.h" +#import "SPTreeNode.h" // Constants static const NSString *SPRemoveNode = @"RemoveNode"; @@ -101,7 +104,7 @@ static NSComparisonResult compareFavoritesUsingKey(id favorite1, id favorite2, v */ - (id)initWithDocument:(SPDatabaseDocument *)document { - if (self = [super init]) { + if ((self = [super init])) { // Weak reference dbDocument = document; @@ -533,7 +536,7 @@ static NSComparisonResult compareFavoritesUsingKey(id favorite1, id favorite2, v // Perform re-sorting [self _sortFavorites]; - [sender setState:reverseFavoritesSort]; + [(NSMenuItem *)sender setState:reverseFavoritesSort]; } /** @@ -1039,8 +1042,6 @@ static NSComparisonResult compareFavoritesUsingKey(id favorite1, id favorite2, v NSString *favoriteSSHHost = [favorite objectForKey:SPFavoriteSSHHostKey]; NSString *favoriteID = [favorite objectForKey:SPFavoriteIDKey]; - NSInteger favoriteType = [[favorite objectForKey:SPFavoriteTypeKey] integerValue]; - // Remove passwords from the Keychain [keychain deletePasswordForName:[keychain nameForFavoriteName:favoriteName id:favoriteID] account:[keychain accountForUser:favoriteUser host:((type == SPSocketConnection) ? @"localhost" : favoriteHost) database:favoriteDatabase]]; @@ -1351,16 +1352,18 @@ static NSComparisonResult compareFavoritesUsingKey(id favorite1, id favorite2, v */ - (SPTreeNode *)_favoriteNodeForFavoriteID:(NSInteger)favoriteID { - SPTreeNode *node = nil; + SPTreeNode *favoriteNode = nil; - if (!favoritesRoot) return; + if (!favoritesRoot) return favoriteNode; - for (node in [favoritesRoot allChildLeafs]) + for (SPTreeNode *node in [favoritesRoot allChildLeafs]) { if ([[[[node representedObject] nodeFavorite] objectForKey:SPFavoriteIDKey] integerValue] == favoriteID) { - return node; + favoriteNode = node; } } + + return favoriteNode; } /** |