aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2011-03-06 14:14:24 +0000
committerstuconnolly <stuart02@gmail.com>2011-03-06 14:14:24 +0000
commit755287031cdc15298155a5dbffe43476801d97b3 (patch)
treedb2eea5a233ea4d948d5210a353c7f8a04cc1352
parent8b39d2dbe699d1108a44f2e490817d09205988ef (diff)
downloadsequelpro-755287031cdc15298155a5dbffe43476801d97b3.tar.gz
sequelpro-755287031cdc15298155a5dbffe43476801d97b3.tar.bz2
sequelpro-755287031cdc15298155a5dbffe43476801d97b3.zip
Fix tooltips for favorite nodes that don't yet have a hostname.
-rw-r--r--Source/SPConnectionControllerDelegate.m6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/SPConnectionControllerDelegate.m b/Source/SPConnectionControllerDelegate.m
index 76a4c35e..897c86ff 100644
--- a/Source/SPConnectionControllerDelegate.m
+++ b/Source/SPConnectionControllerDelegate.m
@@ -114,7 +114,11 @@
SPTreeNode *node = (SPTreeNode *)item;
if (![node isGroup]) {
- toolTip = [NSString stringWithFormat:@"%@ (%@)", [[[node representedObject] nodeFavorite] objectForKey:SPFavoriteNameKey], [[[node representedObject] nodeFavorite] objectForKey:SPFavoriteHostKey]];
+
+ NSString *favoriteName = [[[node representedObject] nodeFavorite] objectForKey:SPFavoriteNameKey];
+ NSString *favoriteHostname = [[[node representedObject] nodeFavorite] objectForKey:SPFavoriteHostKey];
+
+ toolTip = ([favoriteHostname length]) ? [NSString stringWithFormat:@"%@ (%@)", favoriteName, favoriteHostname] : favoriteName;
}
// Only display a tooltip for group nodes that are a child of the root node
else if ([[node parentNode] parentNode]) {